Compare commits
11
Commits
6cf86cd95f
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff01a6b14f | ||
|
|
fe8f2140ee | ||
|
|
e80b6c642f | ||
|
|
371745ebd6 | ||
|
|
072c0886d5 | ||
|
|
6b24947628 | ||
|
|
494663940b | ||
|
|
3c13653738 | ||
|
|
953fa442fa | ||
|
|
3f1b04e045 | ||
|
|
2365177ddd |
@@ -210,7 +210,10 @@ steps:
|
|||||||
- "!vllm/distributed/kv_transfer/"
|
- "!vllm/distributed/kv_transfer/"
|
||||||
- tests/models/language/pooling
|
- tests/models/language/pooling
|
||||||
commands:
|
commands:
|
||||||
- pytest -v -s models/language/pooling -m 'not core_model'
|
# Per-test timeout: a hung test fails with a stack dump instead of holding
|
||||||
|
# the job until Buildkite cancels it, which also blocks the full run's
|
||||||
|
# coverage collection. A whole shard takes 12-21 minutes.
|
||||||
|
- pytest -v -s models/language/pooling -m 'not core_model' --timeout=900 --timeout-method=thread
|
||||||
mirror:
|
mirror:
|
||||||
amd:
|
amd:
|
||||||
parallelism: 4
|
parallelism: 4
|
||||||
|
|||||||
+4
-1
@@ -425,6 +425,7 @@ function(cuda_archs_loose_intersection OUT_CUDA_ARCHS SRC_CUDA_ARCHS TGT_CUDA_AR
|
|||||||
if("${_base}" IN_LIST _TGT_CUDA_ARCHS)
|
if("${_base}" IN_LIST _TGT_CUDA_ARCHS)
|
||||||
list(REMOVE_ITEM _SRC_CUDA_ARCHS "${_arch}")
|
list(REMOVE_ITEM _SRC_CUDA_ARCHS "${_arch}")
|
||||||
list(REMOVE_ITEM _TGT_CUDA_ARCHS "${_base}")
|
list(REMOVE_ITEM _TGT_CUDA_ARCHS "${_base}")
|
||||||
|
list(REMOVE_ITEM _TGT_CUDA_ARCHS "${_base}a" "${_base}f")
|
||||||
list(APPEND _CUDA_ARCHS "${_arch}")
|
list(APPEND _CUDA_ARCHS "${_arch}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@@ -464,8 +465,10 @@ function(cuda_archs_loose_intersection OUT_CUDA_ARCHS SRC_CUDA_ARCHS TGT_CUDA_AR
|
|||||||
string(REGEX REPLACE "[af]$" "" _base "${_arch}")
|
string(REGEX REPLACE "[af]$" "" _base "${_arch}")
|
||||||
if ("${_base}" IN_LIST _SRC_CUDA_ARCHS)
|
if ("${_base}" IN_LIST _SRC_CUDA_ARCHS)
|
||||||
list(REMOVE_ITEM _TGT_CUDA_ARCHS "${_arch}")
|
list(REMOVE_ITEM _TGT_CUDA_ARCHS "${_arch}")
|
||||||
list(REMOVE_ITEM _SRC_CUDA_ARCHS "${_base}")
|
|
||||||
list(APPEND _CUDA_ARCHS "${_arch}")
|
list(APPEND _CUDA_ARCHS "${_arch}")
|
||||||
|
if (NOT "${_base}" IN_LIST _TGT_CUDA_ARCHS)
|
||||||
|
list(REMOVE_ITEM _SRC_CUDA_ARCHS "${_base}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,70 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 256, 1, 8, 8, true, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 1, 8, 4, true, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 1, 4, 8, true, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 256, 1, 8, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 1, 8, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 1, 4, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 256, 2, 16, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 2, 8, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 2, 4, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 256, 3, 16, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 3, 8, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 3, 4, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 256, 4, 16, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 4, 8, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 4, 4, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 1, 8, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 1, 8, 4, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 1, 4, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 1, 8, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 1, 8, 4, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 1, 4, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 256, 1, 8, 8, true, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 1, 8, 4, true, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 1, 4, 8, true, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 256, 1, 8, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 1, 8, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 1, 4, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 256, 2, 16, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 2, 8, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 2, 4, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 256, 3, 16, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 3, 8, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 3, 4, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 256, 4, 16, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 4, 8, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 4, 4, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,70 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 256, 1, 8, 8, true, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 1, 8, 4, true, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 1, 4, 8, true, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 256, 1, 8, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 1, 8, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 1, 4, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 256, 2, 16, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 2, 8, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 2, 4, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 256, 3, 16, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 3, 8, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 3, 4, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 256, 4, 16, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 4, 8, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), 128, 4, 4, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 1, 8, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 1, 8, 4, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 1, 4, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE2M1f.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 1, 8, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 1, 8, 4, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 1, 4, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kFE4M3fn.id(), vllm::kBFloat16.id(), vllm::kFE8M0fnu.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kBFloat16.id(), vllm::kU8B128.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 256, 1, 8, 8, true, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 1, 8, 4, true, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 1, 4, 8, true, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 256, 1, 8, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 1, 8, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 1, 4, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 256, 2, 16, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 2, 8, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 2, 4, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 256, 3, 16, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 3, 8, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 3, 4, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 256, 4, 16, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 4, 8, 4, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE2M1f.id(), vllm::kFloat16.id(), vllm::kFE4M3fn.id(), 128, 4, 4, 8, false, 4, 1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kFE4M3fn.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, true, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kFloat16.id(), vllm::kU8B128.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kBFloat16.id(), vllm::kBFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
// auto generated by generate_kernels.py
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "kernel.h"
|
|
||||||
#include "marlin_template.h"
|
|
||||||
|
|
||||||
namespace MARLIN_NAMESPACE_NAME {
|
|
||||||
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, -1, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 2, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 4, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 1, 8, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 1, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 2, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 2, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 3, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 3, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 256, 4, 16, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 8, 4, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
template __global__ void Marlin<vllm::kS8.id(), vllm::kU4B8.id(), vllm::kFloat16.id(), vllm::kFloat16.id(), 128, 4, 4, 8, false, 4, 8, false>( MARLIN_KERNEL_PARAMS );
|
|
||||||
|
|
||||||
}
|
|
||||||
+5
-1
@@ -502,7 +502,11 @@ RUN --mount=type=cache,target=/opt/uv/cache \
|
|||||||
> /tmp/nccl-override.txt && \
|
> /tmp/nccl-override.txt && \
|
||||||
export UV_OVERRIDE=/tmp/nccl-override.txt; \
|
export UV_OVERRIDE=/tmp/nccl-override.txt; \
|
||||||
fi && \
|
fi && \
|
||||||
export TORCH_CUDA_ARCH_LIST='9.0a 10.0a' && \
|
DEEPEP_ARCH_LIST='9.0a 10.0a' && \
|
||||||
|
if [ "$(printf '%s\n' 12.9 "$CUDA_VERSION" | sort -V | head -n1)" = 12.9 ]; then \
|
||||||
|
DEEPEP_ARCH_LIST="$DEEPEP_ARCH_LIST 10.3a"; \
|
||||||
|
fi && \
|
||||||
|
export TORCH_CUDA_ARCH_LIST="$DEEPEP_ARCH_LIST" && \
|
||||||
/tmp/install_python_libraries.sh \
|
/tmp/install_python_libraries.sh \
|
||||||
--workspace /tmp/ep_kernels_workspace \
|
--workspace /tmp/ep_kernels_workspace \
|
||||||
--mode wheel \
|
--mode wheel \
|
||||||
|
|||||||
+4
-37
@@ -83,7 +83,7 @@ directly from the Triton kernel through unified virtual addressing (UVA),
|
|||||||
prefetching on a side CUDA stream so transfers overlap with the compute of
|
prefetching on a side CUDA stream so transfers overlap with the compute of
|
||||||
preceding layers. The freed GPU memory goes to the KV cache.
|
preceding layers. The freed GPU memory goes to the KV cache.
|
||||||
|
|
||||||
`cpu_offload` defaults to `true` and is set only through `--engram-config`.
|
`cpu_offload` defaults to `true` (on)
|
||||||
|
|
||||||
To keep the tables resident on GPU instead (e.g. when host memory is
|
To keep the tables resident on GPU instead (e.g. when host memory is
|
||||||
scarce):
|
scarce):
|
||||||
@@ -93,40 +93,8 @@ vllm serve deepseek-ai/DeepSeek-V4.1-Flash \
|
|||||||
--engram-config.cpu_offload false
|
--engram-config.cpu_offload false
|
||||||
```
|
```
|
||||||
|
|
||||||
CPU offload requires a GPU with UVA support; vLLM fails fast when it is
|
CPU offload requires a GPU with UVA support;
|
||||||
unavailable.
|
vLLM fails fast when it is unavailable.
|
||||||
|
|
||||||
## Host file gather (Qwen4Exp)
|
|
||||||
|
|
||||||
`host_file_gather` serves Qwen4Exp PLE rows from the loader's own file
|
|
||||||
mapping of the safetensors shards instead of allocating the table. Set
|
|
||||||
`--engram-config '{"host_file_gather": true}'`. It applies only to Qwen4Exp
|
|
||||||
and takes precedence over `cpu_offload`.
|
|
||||||
|
|
||||||
Rows stay in the checkpoint dtype: an FP8 table stays FP8 and is dequantized
|
|
||||||
on the GPU, and an unquantized table must match `--dtype`. CPU offload
|
|
||||||
converts on load; this mode rejects the mismatch at load.
|
|
||||||
|
|
||||||
Faulted pages are reclaimable page cache, shared across co-located processes.
|
|
||||||
They appear in each process's RSS as file-backed (`RssFile`), and PSS is
|
|
||||||
where they are split across processes. A write to the mapping copies that
|
|
||||||
page into anonymous RSS. Each step pays a host sync, and every TP rank
|
|
||||||
gathers all rows. Co-located ranks share the cache; ranks on different
|
|
||||||
machines do not.
|
|
||||||
|
|
||||||
Serving depends on the checkpoint files staying unchanged while the server
|
|
||||||
runs: an in-place overwrite serves the new bytes, truncation kills the worker
|
|
||||||
with SIGBUS, and deleting or renaming the files is safe.
|
|
||||||
|
|
||||||
The first touch of a row costs a disk read, and a page evicted under memory
|
|
||||||
pressure is read again on the next miss. By default no prewarm is needed; for
|
|
||||||
a fast first request, read the PLE files once after the server has started
|
|
||||||
and allocated its KV cache.
|
|
||||||
|
|
||||||
Reload is unsupported and fails closed. ROCm and elastic EP reject the key.
|
|
||||||
Load paths that do not hand over file-backed safetensors tensors fail at bind
|
|
||||||
(`eager`, `.bin`, runai, `fastsafetensors`, `instanttensor`). The multithread
|
|
||||||
loader is file-backed and is admitted. `--load-format dummy` serves zeros.
|
|
||||||
|
|
||||||
## Data-parallel topologies (DeepSeek V4.1)
|
## Data-parallel topologies (DeepSeek V4.1)
|
||||||
|
|
||||||
@@ -147,8 +115,7 @@ vllm serve deepseek-ai/DeepSeek-V4.1-Flash \
|
|||||||
```
|
```
|
||||||
|
|
||||||
`embedding_across_dp` is not supported with elastic expert parallelism yet.
|
`embedding_across_dp` is not supported with elastic expert parallelism yet.
|
||||||
Qwen4Exp PLE tables are ETP-sharded instead and honor only `cpu_offload` and
|
Qwen4Exp PLE tables are ETP-sharded instead and honor `cpu_offload` only.
|
||||||
`host_file_gather`.
|
|
||||||
|
|
||||||
## Sharing host tables across DP replicas
|
## Sharing host tables across DP replicas
|
||||||
|
|
||||||
|
|||||||
@@ -466,6 +466,31 @@ This approach is more robust than index-based access (`messages[0]`, `messages[1
|
|||||||
|
|
||||||
Example template file: [examples/pooling/score/template/nemotron-rerank.jinja](../../../examples/pooling/score/template/nemotron-rerank.jinja)
|
Example template file: [examples/pooling/score/template/nemotron-rerank.jinja](../../../examples/pooling/score/template/nemotron-rerank.jinja)
|
||||||
|
|
||||||
|
#### Templates declared by Sentence Transformers checkpoints
|
||||||
|
|
||||||
|
vLLM does not apply a checkpoint's chat template by default, since many rerankers inherit an unrelated template from their base LLM. The exception is a Sentence Transformers (v5.4+) `CrossEncoder` with a single `sequence-classification` Transformer module whose `sentence_bert_config.json` declares the `message` modality. Sentence Transformers formats the pairs of such checkpoints as `query`/`document` messages, so vLLM does the same with the saved template:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"transformer_task": "sequence-classification",
|
||||||
|
"modality_config": {
|
||||||
|
"text": {"method": "forward", "method_output_name": "logits"},
|
||||||
|
"message": {"method": "forward", "method_output_name": "logits", "format": "flat"}
|
||||||
|
},
|
||||||
|
"module_output_name": "scores",
|
||||||
|
"processing_kwargs": {"chat_template": {"add_generation_prompt": true}}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- The default chat template is used, unless `processing_kwargs.chat_template.chat_template` names another template saved with the tokenizer (e.g. `additional_chat_templates/score.jinja` for `"score"`).
|
||||||
|
- The other `processing_kwargs.chat_template` settings, such as `add_generation_prompt`, are passed to the template; the request's `chat_template_kwargs` override them.
|
||||||
|
- Message contents are passed as strings, as with `--chat-template`.
|
||||||
|
- vLLM does not restore the template suffix after truncation (`restore_suffix`). Use `max_tokens_per_doc` rather than `truncate_prompt_tokens` to truncate long documents.
|
||||||
|
- `--chat-template` (or the `chat_template` argument of `LLM.score`) takes precedence over the saved template and its settings.
|
||||||
|
- Models with a built-in score template keep using it.
|
||||||
|
|
||||||
|
The template in use is logged at startup.
|
||||||
|
|
||||||
### Enable/disable activation
|
### Enable/disable activation
|
||||||
|
|
||||||
You can enable or disable activation via `use_activation` only works for cross-encoder models.
|
You can enable or disable activation via `use_activation` only works for cross-encoder models.
|
||||||
|
|||||||
@@ -313,14 +313,12 @@ Start the server:
|
|||||||
```shell
|
```shell
|
||||||
vllm serve nvidia/llama-nemotron-rerank-vl-1b-v2 \
|
vllm serve nvidia/llama-nemotron-rerank-vl-1b-v2 \
|
||||||
--runner pooling \
|
--runner pooling \
|
||||||
--trust-remote-code \
|
--trust-remote-code
|
||||||
--chat-template examples/pooling/score/template/nemotron-vl-rerank.jinja
|
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
The chat template bundled with this checkpoint's tokenizer is not suitable
|
The checkpoint declares its score template in its Sentence Transformers config, so vLLM applies it automatically (see [Templates declared by Sentence Transformers checkpoints](scoring.md#templates-declared-by-sentence-transformers-checkpoints)).
|
||||||
for the Score/Rerank APIs. Use the provided override template when serving:
|
Revisions older than October 2026 need `--chat-template examples/pooling/score/template/nemotron-vl-rerank.jinja`.
|
||||||
`examples/pooling/score/template/nemotron-vl-rerank.jinja`.
|
|
||||||
|
|
||||||
Score a text query against an image document:
|
Score a text query against an image document:
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,50 @@
|
|||||||
# Tokens In <> Tokens Out API
|
# Tokens In <> Tokens Out API
|
||||||
|
|
||||||
`/inference/v1/generate` takes prompt token IDs and returns generated token IDs. It is the generation step of the `render → generate → derender` pipeline used in disaggregated serving (see the [Renderer APIs](renderer.md) and [Derenderer APIs](derenderer.md)).
|
`POST /inference/v1/generate` is the token-in/token-out (TITO) HTTP endpoint: it takes prompt token IDs and returns generated token IDs, logprobs keyed by integer token ID, and `finish_reason`/`stop_reason`, with no detokenization. Use it when the caller does its own tokenization and chat templating, such as an RL rollout worker. It is also the generation step of the `render → generate → derender` pipeline used in disaggregated serving (see the [Renderer APIs](renderer.md) and [Derenderer APIs](derenderer.md)).
|
||||||
|
|
||||||
The endpoint is registered on `vllm serve` with `--enable-scale-out`, and always with `--tokens-only`. `--tokens-only` also skips loading the tokenizer, so the server can't turn token IDs back into text.
|
## Enabling the endpoint (`--enable-scale-out`, `--tokens-only`)
|
||||||
|
|
||||||
|
- `--enable-scale-out` registers it, with `/render`, `/derender` and `/inference/v1/abort_requests`.
|
||||||
|
- `--tokens-only` always registers it, skips loading the tokenizer and forces `detokenize=False`. Stop strings (`sampling_params.stop`) are then rejected with a 400; use `stop_token_ids`.
|
||||||
|
- With neither flag, it returns 403 `Scale-out endpoints are disabled. Restart vllm serve with --enable-scale-out to enable them.`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
vllm serve Qwen/Qwen3-0.6B --enable-scale-out
|
||||||
|
|
||||||
|
curl -X POST http://localhost:8000/inference/v1/generate \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"token_ids": [151644, 872, 198], "sampling_params": {"max_tokens": 32, "logprobs": 1}}'
|
||||||
|
```
|
||||||
|
|
||||||
|
A full client is in [examples/scale_out/token_generation_client.py](../../../examples/scale_out/token_generation_client.py).
|
||||||
|
|
||||||
|
## Request fields
|
||||||
|
|
||||||
|
| Field | Notes |
|
||||||
|
| --- | --- |
|
||||||
|
| `token_ids` | Required `list[int]`: the already-templated prompt. Non-empty, no negative IDs. |
|
||||||
|
| `sampling_params` | Required. Any [SamplingParams](../../api/README.md#inference-parameters) field, e.g. `max_tokens`, `temperature`, `logprobs`, `stop_token_ids`. Without `max_tokens`, the server applies its own default (as on the OpenAI endpoints), not 16. |
|
||||||
|
| `output_mode` | `"tokens"` (default) or `"text"`, see [Output modes](#output-modes). |
|
||||||
|
| `stream`, `stream_options` | SSE chunks ending with `data: [DONE]`. |
|
||||||
|
| `return_token_ids` | Echo the final prompt IDs as `prompt_token_ids`. |
|
||||||
|
| `features` / `content_parts` | Multimodal input, mutually exclusive. |
|
||||||
|
| `request_id`, `model`, `cache_salt`, `priority`, `kv_transfer_params`, `ec_transfer_params` | Optional. |
|
||||||
|
|
||||||
|
## Response fields
|
||||||
|
|
||||||
|
| `choices[i]` field | Notes |
|
||||||
|
| --- | --- |
|
||||||
|
| `token_ids` | Generated token IDs. |
|
||||||
|
| `finish_reason` | `stop`, `length` or `abort`. |
|
||||||
|
| `stop_reason` | Stop token ID or string; `null` on EOS, length and abort. |
|
||||||
|
| `logprobs` | `{"content": [{"token_id", "logprob", "rank", "top_logprobs": [...]}]}`, one entry per token, sampled token first. `token_id` is an integer, not the older `"token_id:<id>"` string. Needs `sampling_params.logprobs`. |
|
||||||
|
| `weight_versions`, `routed_experts`, `sampling_mask` | Optional, see [Weight versions](#weight-versions); the last two need `--enable-return-routed-experts` / `--return-sampling-mask`. |
|
||||||
|
|
||||||
|
The top level adds `request_id`, `usage`, `prompt_token_ids` and `prompt_logprobs`. Stream chunks carry the same per-choice fields for the new tokens.
|
||||||
|
|
||||||
|
## Targeting a data-parallel rank (`X-data-parallel-rank`)
|
||||||
|
|
||||||
|
Send the header `X-data-parallel-rank: <int>` to pin a request to one data-parallel (DP) engine rank; there is no body field. Without the header, or with a non-integer value, the request is load balanced. A rank outside `[0, data_parallel_size)` is rejected.
|
||||||
|
|
||||||
## Output modes
|
## Output modes
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ The following open-source RL libraries use vLLM for fast rollouts (sorted alphab
|
|||||||
|
|
||||||
For weight synchronization between training and inference, see the [Weight Transfer](weight_transfer/README.md) documentation, which covers the pluggable backend system with [NCCL](weight_transfer/nccl.md) (multi-GPU) and [IPC](weight_transfer/ipc.md) (same-GPU) engines. To verify that an update landed on every rank, see the [Weight Checker](weight_checker.md).
|
For weight synchronization between training and inference, see the [Weight Transfer](weight_transfer/README.md) documentation, which covers the pluggable backend system with [NCCL](weight_transfer/nccl.md) (multi-GPU) and [IPC](weight_transfer/ipc.md) (same-GPU) engines. To verify that an update landed on every rank, see the [Weight Checker](weight_checker.md).
|
||||||
|
|
||||||
|
For MoE policies, see [Routed Experts Return](routed_experts.md) (`--enable-return-routed-experts`) to get the per-token expert routing of each rollout for routing replay (R3) in the trainer.
|
||||||
|
|
||||||
For pipelining generation and training to improve GPU utilization and throughput, see the [Async Reinforcement Learning](async_rl.md) guide, which covers the pause/resume API for safely updating weights mid-flight.
|
For pipelining generation and training to improve GPU utilization and throughput, see the [Async Reinforcement Learning](async_rl.md) guide, which covers the pause/resume API for safely updating weights mid-flight.
|
||||||
|
|
||||||
See the following notebooks showing how to use vLLM for GRPO:
|
See the following notebooks showing how to use vLLM for GRPO:
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
# Routed Experts Return (MoE Routing Replay / R3)
|
||||||
|
|
||||||
|
`--enable-return-routed-experts` makes vLLM return the routed experts (the expert IDs each MoE layer's router selected) for every token of a request. RL trainers use it for MoE routing replay (R3): the training forward pass reuses the rollout's routing.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
vllm serve Qwen/Qwen3-30B-A3B --enable-return-routed-experts
|
||||||
|
# offline: LLM("Qwen/Qwen3-30B-A3B", enable_return_routed_experts=True)
|
||||||
|
```
|
||||||
|
|
||||||
|
The flag sets `AuxOutputConfig.enable_return_routed_experts` (full form: `--aux-output-config '{"enable_return_routed_experts": true, "max_bytes": N}'`). There is no per-request on/off switch.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
Startup fails with a `ValueError` unless:
|
||||||
|
|
||||||
|
- **Model Runner V2** is used (`VLLM_USE_V2_MODEL_RUNNER=1` if vLLM falls back to V1);
|
||||||
|
- the runner is `generate` and the model is **MoE**;
|
||||||
|
- **prefix caching is enabled** (the default). `--no-enable-prefix-caching` fails; the old v0.21 advice to disable it is wrong.
|
||||||
|
|
||||||
|
Rejected at startup: adaptive speculative verification, PP > 1, DCP/PCP > 1, and the `NixlConnector`, `NixlPullConnector`, `NixlPushConnector`, `MoRIIOConnector`, `MooncakeConnector` KV connectors. Regular speculative decoding works.
|
||||||
|
|
||||||
|
### How it works: aux output connector
|
||||||
|
|
||||||
|
Routing is stored by the aux output connector (`vllm/distributed/aux_output_connector/`, configured via `--aux-output-config`), keyed by KV block hash and shared with prefix caching, which is why prefix caching is required. `max_bytes` is its host-memory LRU capacity (default: derived from KV cache capacity). If a prefix-cache hit needs evicted rows, the worker raises `BlockObjectStoreError`; increase `max_bytes`.
|
||||||
|
|
||||||
|
## Output format
|
||||||
|
|
||||||
|
| API | Field |
|
||||||
|
| --- | --- |
|
||||||
|
| Offline (`LLM`, `AsyncLLM`) | `CompletionOutput.routed_experts`: `np.ndarray` or `None` |
|
||||||
|
| `/v1/completions`, `/v1/chat/completions` | `choices[i].routed_experts`: base64 `.npy`, **non-streaming only** |
|
||||||
|
| `/inference/v1/generate` | `routed_experts` per choice (base64 `.npy`); with `stream: true`, on the final chunk |
|
||||||
|
|
||||||
|
- **Shape:** `(num_tokens - 1 - routed_experts_prompt_start, num_moe_layers, num_experts_per_tok)`, `num_tokens` = prompt + output. The last sampled token has no row.
|
||||||
|
- **Rows:** row `i` is position `routed_experts_prompt_start + i` of `prompt_token_ids + output_token_ids`.
|
||||||
|
- **dtype:** `uint8` for at most 256 experts, else `uint16`; logical expert IDs.
|
||||||
|
- Filled only when the request finishes. `None` if the flag is off or the request aborted before any forward pass.
|
||||||
|
|
||||||
|
```python
|
||||||
|
import base64, io
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
experts = np.load(io.BytesIO(base64.b64decode(choice["routed_experts"])))
|
||||||
|
```
|
||||||
|
|
||||||
|
## `routed_experts_prompt_start`
|
||||||
|
|
||||||
|
Per-request, default `0`: drops the first N prompt-token rows (e.g. routing already received in earlier turns). Must be `0 <= value <= prompt_len`, else HTTP 400. Pass it top-level on `/v1/*completions`, inside `sampling_params` on `/inference/v1/generate`, or as `SamplingParams(routed_experts_prompt_start=...)`.
|
||||||
|
|
||||||
|
## Limitations
|
||||||
|
|
||||||
|
- The Rust HTTP frontend never returns `routed_experts` and always sends `routed_experts_prompt_start = 0`. Use the Python API server.
|
||||||
|
|
||||||
|
Example: [examples/rl/routed_experts_e2e.py](../../examples/rl/routed_experts_e2e.py).
|
||||||
@@ -139,8 +139,9 @@ Each position then carries the sampled token's logprob and the top-128
|
|||||||
drop them. The finite entries are the sampling mask when it has at most `k`
|
drop them. The finite entries are the sampling mask when it has at most `k`
|
||||||
tokens.
|
tokens.
|
||||||
- The sampled token is always the first entry and may repeat inside the top-k.
|
- The sampled token is always the first entry and may repeat inside the top-k.
|
||||||
- `/inference/v1/generate` encodes IDs as `token_id:<id>`; the OpenAI
|
- The `token_id:<id>` strings come from the OpenAI endpoints with
|
||||||
endpoints need `return_tokens_as_token_ids`.
|
`return_tokens_as_token_ids`; `/inference/v1/generate` returns an integer
|
||||||
|
`token_id` instead.
|
||||||
|
|
||||||
## Limitations
|
## Limitations
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ engine.send_weights() # called on every rank
|
|||||||
|
|
||||||
## API Endpoints
|
## API Endpoints
|
||||||
|
|
||||||
When running vLLM as an HTTP server, the following endpoints are available for weight transfer. `HTTPVLLMWeightSyncClient` speaks the first four for you.
|
When running vLLM as an HTTP server, the following endpoints are available for weight transfer. `HTTPVLLMWeightSyncClient` speaks the first five for you. A trainer may also implement the protocol directly without importing vLLM: see the wire contracts in [NCCL](nccl.md#trainer-without-vllm-over-http) and [IPC](ipc.md#trainer-without-vllm-over-http). This keeps the trainer decoupled from vLLM: it needs no vLLM install or version pin, only this documented HTTP and wire contract, so trainer and server can upgrade independently (non-PyTorch trainers such as JAX can use it too).
|
||||||
|
|
||||||
| Endpoint | Method | Description |
|
| Endpoint | Method | Description |
|
||||||
| -------- | ------ | ----------- |
|
| -------- | ------ | ----------- |
|
||||||
@@ -153,6 +153,7 @@ When running vLLM as an HTTP server, the following endpoints are available for w
|
|||||||
| `/start_weight_update` | POST | Start a weight update |
|
| `/start_weight_update` | POST | Start a weight update |
|
||||||
| `/update_weights` | POST | Transfer a batch of weights with backend-specific metadata |
|
| `/update_weights` | POST | Transfer a batch of weights with backend-specific metadata |
|
||||||
| `/finish_weight_update` | POST | Finish the update and optionally commit its `weight_version` |
|
| `/finish_weight_update` | POST | Finish the update and optionally commit its `weight_version` |
|
||||||
|
| `/shutdown_weight_transfer_engine` | POST | Release the transfer channel without stopping inference |
|
||||||
| `/update_weight_version` | POST | Update `weight_version` without changing model weights |
|
| `/update_weight_version` | POST | Update `weight_version` without changing model weights |
|
||||||
| `/weight_info` | GET | Get the latest committed weight version |
|
| `/weight_info` | GET | Get the latest committed weight version |
|
||||||
| `/pause` | POST | Pause generation before weight sync to handle inflight requests |
|
| `/pause` | POST | Pause generation before weight sync to handle inflight requests |
|
||||||
@@ -162,6 +163,12 @@ When running vLLM as an HTTP server, the following endpoints are available for w
|
|||||||
!!! note
|
!!! note
|
||||||
The HTTP weight transfer endpoints require `VLLM_SERVER_DEV_MODE=1` to be set.
|
The HTTP weight transfer endpoints require `VLLM_SERVER_DEV_MODE=1` to be set.
|
||||||
|
|
||||||
|
!!! warning
|
||||||
|
If `/update_weights` fails, the model is left mid-reload while `/health`
|
||||||
|
stays 200, and `/finish_weight_update` is rejected. Before generating again,
|
||||||
|
resend a full `/start_weight_update` → `/update_weights` →
|
||||||
|
`/finish_weight_update` (see [#57854](https://github.com/vllm-project/vllm/pull/57854)).
|
||||||
|
|
||||||
The Rust frontend's optional gRPC `Control` service exposes the same pause, sleep, weight-transfer, and weight-version lifecycle for trusted sidecars. The `ServerInfo.rl_capabilities` response reports whether weight transfer and sleep mode were configured. Backend-specific `init_info` and `update_info` remain JSON metadata; model tensors continue to move over the configured NCCL, IPC, sparse-NCCL, or sharded-RDT transport.
|
The Rust frontend's optional gRPC `Control` service exposes the same pause, sleep, weight-transfer, and weight-version lifecycle for trusted sidecars. The `ServerInfo.rl_capabilities` response reports whether weight transfer and sleep mode were configured. Backend-specific `init_info` and `update_info` remain JSON metadata; model tensors continue to move over the configured NCCL, IPC, sparse-NCCL, or sharded-RDT transport.
|
||||||
|
|
||||||
## Extending the System
|
## Extending the System
|
||||||
|
|||||||
@@ -110,6 +110,43 @@ mode carries a per-chunk barrier across ranks: without it, a rank could overwrit
|
|||||||
its buffer while its colocated worker is still reading the current chunk. This is
|
its buffer while its colocated worker is still reading the current chunk. This is
|
||||||
handled inside `send_weights()`.
|
handled inside `send_weights()`.
|
||||||
|
|
||||||
|
## Trainer Without vLLM over HTTP
|
||||||
|
|
||||||
|
A colocated trainer can speak the [HTTP endpoints](README.md#api-endpoints)
|
||||||
|
directly, with only PyTorch and an HTTP client. The server needs
|
||||||
|
`VLLM_ALLOW_INSECURE_SERIALIZATION=1`; without it, init and start return 200 and
|
||||||
|
the first `/update_weights` returns 500. Reference:
|
||||||
|
[`rlhf_http_ipc_no_vllm.py`](../../../examples/rl/rlhf_http_ipc_no_vllm.py).
|
||||||
|
|
||||||
|
`POST /init_weight_transfer_engine` body: `{"init_info": {"packed": false}}`.
|
||||||
|
|
||||||
|
`POST /update_weights` body `{"update_info": {...}}`:
|
||||||
|
|
||||||
|
| Field | Meaning |
|
||||||
|
| ----- | ------- |
|
||||||
|
| `names`, `dtype_names`, `shapes` | Checkpoint names, `torch` dtype attribute names (`"bfloat16"`), full shapes |
|
||||||
|
| `ipc_handles_pickled` | `base64(pickle.dumps(handles))`. Unpacked: a list with one dict per name. Packed: one dict for the shared buffer |
|
||||||
|
| `tensor_sizes` | Packed only: byte size of each tensor in the chunk, in `names` order |
|
||||||
|
|
||||||
|
- A handle dict is `{gpu_uuid: reduce_tensor(t)[1]}` with one entry per GPU the
|
||||||
|
server uses (`torch.multiprocessing.reductions.reduce_tensor`).
|
||||||
|
`gpu_uuid = str(torch.cuda.get_device_properties(i).uuid)`, **without** the
|
||||||
|
`GPU-` prefix that `nvidia-smi` prints. The worker overwrites `args[6]`
|
||||||
|
(device index) with its own.
|
||||||
|
- `ipc_handles` (unpickled) is not JSON-serializable; over HTTP use
|
||||||
|
`ipc_handles_pickled`.
|
||||||
|
- Packed: export one `uint8` buffer once and reuse it for every chunk. Copy
|
||||||
|
`t.contiguous().view(-1).view(torch.uint8)` in `names` order and close a chunk
|
||||||
|
**before** the next tensor would overflow it (unlike NCCL, which closes after).
|
||||||
|
A tensor larger than the buffer is an error. Synchronize before each
|
||||||
|
`/update_weights`; do not overwrite the buffer until the call returns.
|
||||||
|
- Keep every exported tensor alive until `/finish_weight_update` returns, then
|
||||||
|
drop the references and call `torch.cuda.ipc_collect()`.
|
||||||
|
- Multi-rank trainers: each rank exports handles for its own GPU, the ranks
|
||||||
|
gather the `{uuid: args}` dicts to rank 0 over their own `torch.distributed`
|
||||||
|
group and merge them per index, and rank 0 sends all HTTP. In packed mode,
|
||||||
|
barrier before and after each `/update_weights`.
|
||||||
|
|
||||||
## Rank-Local Updates
|
## Rank-Local Updates
|
||||||
|
|
||||||
For different parameter subsets per worker, `update_info` may be a list indexed
|
For different parameter subsets per worker, `update_info` may be a list indexed
|
||||||
@@ -119,4 +156,5 @@ worker to participate.
|
|||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
- [RLHF with IPC weight syncing (`vllm serve`, HTTP)](../../../examples/rl/rlhf_http_ipc.py) - **Start here.** Server and training model share a single GPU; HTTP control plane, CUDA IPC data plane. Launches and tears down its own server
|
- [RLHF with IPC weight syncing (`vllm serve`, HTTP)](../../../examples/rl/rlhf_http_ipc.py) - **Start here.** Server and training model share a single GPU; HTTP control plane, CUDA IPC data plane. Launches and tears down its own server
|
||||||
|
- [IPC weight syncing from a trainer that does not import vLLM](../../../examples/rl/rlhf_http_ipc_no_vllm.py) - `torch` + `requests` only, `ipc_handles_pickled` over HTTP; see [Trainer Without vLLM over HTTP](#trainer-without-vllm-over-http)
|
||||||
- [RLHF with IPC + FSDP2 and expert parallelism](../../../examples/rl/rlhf_ipc_fsdp_ep.py) - Multi-rank trainer colocated with a `--data-parallel-size 4` server on the same 4 GPUs: every FSDP rank builds an engine and joins the handle all-gather, with packed chunking and sleep/wake around the transfer
|
- [RLHF with IPC + FSDP2 and expert parallelism](../../../examples/rl/rlhf_ipc_fsdp_ep.py) - Multi-rank trainer colocated with a `--data-parallel-size 4` server on the same 4 GPUs: every FSDP rank builds an engine and joins the handle all-gather, with packed chunking and sleep/wake around the transfer
|
||||||
|
|||||||
@@ -130,6 +130,51 @@ pass — this is the invariant to test first.
|
|||||||
IPC does not read `metadata()` at all: it derives the update info from
|
IPC does not read `metadata()` at all: it derives the update info from
|
||||||
iteration as it goes, so it cannot observe a divergence.
|
iteration as it goes, so it cannot observe a divergence.
|
||||||
|
|
||||||
|
## Trainer Without vLLM over HTTP
|
||||||
|
|
||||||
|
A trainer can speak the [HTTP endpoints](README.md#api-endpoints) directly, with
|
||||||
|
only PyTorch and an HTTP client. It mints the `ncclUniqueId` itself and is NCCL
|
||||||
|
rank 0. Reference: [`rlhf_http_nccl_no_vllm.py`](../../../examples/rl/rlhf_http_nccl_no_vllm.py).
|
||||||
|
|
||||||
|
`POST /init_weight_transfer_engine` body `{"init_info": {...}}`:
|
||||||
|
|
||||||
|
| Field | Default | Meaning |
|
||||||
|
| ----- | ------- | ------- |
|
||||||
|
| `nccl_unique_id_b64` | — | Standard (not URL-safe) base64 of the 128-byte `ncclUniqueId`. Replaces `master_address` / `master_port` |
|
||||||
|
| `rank_offset` | — | First worker rank; `1` for one trainer rank |
|
||||||
|
| `world_size` | — | Trainer ranks + `GET /get_world_size` |
|
||||||
|
| `packed` | `false` | Packed broadcasting |
|
||||||
|
| `packed_buffer_size_bytes` | 1 GiB | Must match the trainer's chunking |
|
||||||
|
| `packed_num_buffers` | 2 | Worker-side receive buffers |
|
||||||
|
|
||||||
|
- Worker rank = `rank_offset + dp_index * (TP * PP) + rank`.
|
||||||
|
- `/init_weight_transfer_engine` returns only after all ranks join: send it in
|
||||||
|
the background while the trainer calls `ncclCommInitRank(world_size, uid, 0)`.
|
||||||
|
There is no timeout; if the trainer never joins, the workers wait forever.
|
||||||
|
- Right after init every worker issues a warm-up `all_reduce` (sum) of
|
||||||
|
`torch.zeros(1)` (one float32 element). The trainer must issue the same one
|
||||||
|
before any other collective.
|
||||||
|
|
||||||
|
Each sync: `POST /start_weight_update`, then `POST /update_weights` with
|
||||||
|
`{"update_info": {"names", "dtype_names", "shapes"}}` **in the background**
|
||||||
|
while rank 0 broadcasts in `names` order, then `POST /finish_weight_update`.
|
||||||
|
`dtype_names` are `torch` attribute names (`"bfloat16"`); `shapes` are full
|
||||||
|
checkpoint shapes.
|
||||||
|
|
||||||
|
- Unpacked: one broadcast per tensor.
|
||||||
|
- Packed: concatenate `t.contiguous().view(-1).view(torch.uint8)` in `names`
|
||||||
|
order; broadcast a chunk as soon as its size **exceeds**
|
||||||
|
`packed_buffer_size_bytes` (the crossing tensor stays in the chunk), then the
|
||||||
|
remainder.
|
||||||
|
|
||||||
|
Trainer-side communicators without vLLM:
|
||||||
|
|
||||||
|
| Communicator | Status |
|
||||||
|
| ------------ | ------ |
|
||||||
|
| `torch.distributed.ProcessGroupNCCL` on a private `TCPStore` + `eager_connect_single_device` | Works; the unique id is read from store key `"0"`, a torch implementation detail (used by the example) |
|
||||||
|
| `ctypes` against torch's bundled `libnccl.so.2` | Works |
|
||||||
|
| `torch.cuda.nccl.init_rank` | Fails on Python 3.10+ (`PY_SSIZE_T_CLEAN` `SystemError`) |
|
||||||
|
|
||||||
## Sparse NCCL
|
## Sparse NCCL
|
||||||
|
|
||||||
Sparse, flat-index weight patches use
|
Sparse, flat-index weight patches use
|
||||||
@@ -196,6 +241,7 @@ Sparse NCCL sends only `O(nnz)` indices and values. Checkpoint application still
|
|||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
- [RLHF with NCCL weight syncing (`vllm serve`, HTTP)](../../../examples/rl/rlhf_http_nccl.py) - **Start here.** Trainer on one GPU, 2x tensor-parallel fp8 server on two others; HTTP control plane, NCCL data plane. Launches and tears down its own server
|
- [RLHF with NCCL weight syncing (`vllm serve`, HTTP)](../../../examples/rl/rlhf_http_nccl.py) - **Start here.** Trainer on one GPU, 2x tensor-parallel fp8 server on two others; HTTP control plane, NCCL data plane. Launches and tears down its own server
|
||||||
|
- [NCCL weight syncing from a trainer that does not import vLLM](../../../examples/rl/rlhf_http_nccl_no_vllm.py) - `torch` + `requests` only, `nccl_unique_id_b64` rendezvous; see [Trainer Without vLLM over HTTP](#trainer-without-vllm-over-http)
|
||||||
- [RLHF with NCCL + FSDP2 and expert parallelism](../../../examples/rl/rlhf_nccl_fsdp_ep.py) - Multi-rank trainer: every FSDP rank builds an engine and joins the `full_tensor()` gather while only rank 0 touches the wire
|
- [RLHF with NCCL + FSDP2 and expert parallelism](../../../examples/rl/rlhf_nccl_fsdp_ep.py) - Multi-rank trainer: every FSDP rank builds an engine and joins the `full_tensor()` gather while only rank 0 touches the wire
|
||||||
- [RLHF with sparse NCCL weight syncing (offline, Ray)](../../../examples/rl/rlhf_sparse_nccl.py) - Qwen3 MoE per-expert checkpoint updates with one trainer GPU and two TP2/EP2 inference GPUs
|
- [RLHF with sparse NCCL weight syncing (offline, Ray)](../../../examples/rl/rlhf_sparse_nccl.py) - Qwen3 MoE per-expert checkpoint updates with one trainer GPU and two TP2/EP2 inference GPUs
|
||||||
- [RLHF with async weight syncing (offline, Ray)](../../../examples/rl/rlhf_async_new_apis.py) - Async generation with mid-flight pause, weight sync, resume, and validation against a fresh model; uses an in-process `AsyncLLMEngine` with `RayVLLMWeightSyncClient`
|
- [RLHF with async weight syncing (offline, Ray)](../../../examples/rl/rlhf_async_new_apis.py) - Async generation with mid-flight pause, weight sync, resume, and validation against a fresh model; uses an in-process `AsyncLLMEngine` with `RayVLLMWeightSyncClient`
|
||||||
|
|||||||
@@ -0,0 +1,168 @@
|
|||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||||
|
"""CUDA IPC weight sync over HTTP from a trainer that never imports vLLM.
|
||||||
|
|
||||||
|
The trainer uses only `torch`, `requests`, `safetensors`, `pybase64` and the
|
||||||
|
stdlib, and speaks the wire protocol in
|
||||||
|
`docs/training/weight_transfer/ipc.md` ("Trainer Without vLLM over HTTP"):
|
||||||
|
it exports its tensors with `torch.multiprocessing.reductions.reduce_tensor`
|
||||||
|
and sends the handles, pickled and base64-encoded, in `ipc_handles_pickled`.
|
||||||
|
|
||||||
|
IPC requires colocation: this process holds a full copy of the weights on every
|
||||||
|
GPU the server uses, and keys each handle by that GPU's UUID. A multi-process
|
||||||
|
trainer would instead gather the per-rank `{uuid: args}` dicts to one rank.
|
||||||
|
|
||||||
|
Start a server; IPC handles are pickled, so it needs
|
||||||
|
`VLLM_ALLOW_INSECURE_SERIALIZATION=1` (the weights it starts with are discarded):
|
||||||
|
|
||||||
|
VLLM_SERVER_DEV_MODE=1 VLLM_ALLOW_INSECURE_SERIALIZATION=1 \
|
||||||
|
CUDA_VISIBLE_DEVICES=0 vllm serve Qwen/Qwen3-0.6B \
|
||||||
|
--load-format dummy --enforce-eager --gpu-memory-utilization 0.4 \
|
||||||
|
--weight-transfer-config '{"backend": "ipc"}'
|
||||||
|
|
||||||
|
Then run the trainer on the same GPU(s) (`--packed` for chunked transfer):
|
||||||
|
|
||||||
|
CUDA_VISIBLE_DEVICES=0 python examples/rl/rlhf_http_ipc_no_vllm.py \
|
||||||
|
--checkpoint /path/to/Qwen3-0.6B
|
||||||
|
|
||||||
|
For a TP=2 server on GPUs 0-1, use `CUDA_VISIBLE_DEVICES=0,1` on both sides and
|
||||||
|
pass `--num-gpus 2` to the trainer.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
class _BlockVLLM:
|
||||||
|
def find_spec(self, name, path=None, target=None):
|
||||||
|
if name.split(".")[0] == "vllm":
|
||||||
|
raise ImportError(f"this trainer must not import {name!r}")
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
sys.meta_path.insert(0, _BlockVLLM())
|
||||||
|
|
||||||
|
import argparse # noqa: E402
|
||||||
|
import glob # noqa: E402
|
||||||
|
import pickle # noqa: E402
|
||||||
|
|
||||||
|
import pybase64 as base64 # noqa: E402
|
||||||
|
import requests # noqa: E402
|
||||||
|
import torch # noqa: E402
|
||||||
|
from safetensors.torch import load_file # noqa: E402
|
||||||
|
from torch.multiprocessing.reductions import reduce_tensor # noqa: E402
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("--url", default="http://localhost:8000")
|
||||||
|
parser.add_argument("--checkpoint", required=True, help="dir with *.safetensors")
|
||||||
|
parser.add_argument("--num-gpus", type=int, default=1)
|
||||||
|
parser.add_argument("--packed", action="store_true")
|
||||||
|
parser.add_argument("--packed-buffer-size-bytes", type=int, default=512 << 20)
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
def post(path: str, body: dict | None = None) -> dict:
|
||||||
|
r = requests.post(args.url + path, json=body or {}, timeout=600)
|
||||||
|
r.raise_for_status()
|
||||||
|
return r.json()
|
||||||
|
|
||||||
|
|
||||||
|
def generate(prompts: list[str]) -> list[str]:
|
||||||
|
model = requests.get(args.url + "/v1/models", timeout=60).json()["data"][0]["id"]
|
||||||
|
body = {"model": model, "prompt": prompts, "max_tokens": 16, "temperature": 0}
|
||||||
|
choices = post("/v1/completions", body)["choices"]
|
||||||
|
return [c["text"] for c in sorted(choices, key=lambda c: c["index"])]
|
||||||
|
|
||||||
|
|
||||||
|
# Weights are {gpu_uuid: {name: tensor}}: one full copy per colocated GPU. The
|
||||||
|
# UUID is str(torch.cuda.get_device_properties(i).uuid), with no "GPU-" prefix.
|
||||||
|
Weights = dict[str, dict[str, torch.Tensor]]
|
||||||
|
|
||||||
|
|
||||||
|
def update_weights(
|
||||||
|
weights: Weights,
|
||||||
|
names: list[str],
|
||||||
|
ipc_handles: list[dict[str, tuple]] | dict[str, tuple],
|
||||||
|
tensor_sizes: list[int] | None = None,
|
||||||
|
) -> None:
|
||||||
|
w = next(iter(weights.values()))
|
||||||
|
update_info = {
|
||||||
|
"names": names,
|
||||||
|
"dtype_names": [str(w[n].dtype).removeprefix("torch.") for n in names],
|
||||||
|
"shapes": [list(w[n].shape) for n in names],
|
||||||
|
"ipc_handles_pickled": base64.b64encode(pickle.dumps(ipc_handles)).decode(),
|
||||||
|
}
|
||||||
|
if tensor_sizes is not None:
|
||||||
|
update_info["tensor_sizes"] = tensor_sizes
|
||||||
|
post("/update_weights", {"update_info": update_info})
|
||||||
|
|
||||||
|
|
||||||
|
def send_unpacked(weights: Weights, names: list[str]) -> list[torch.Tensor]:
|
||||||
|
"""One /update_weights call; one {uuid: args} dict per parameter."""
|
||||||
|
copies = {u: {n: w[n].contiguous() for n in names} for u, w in weights.items()}
|
||||||
|
handles = [{u: reduce_tensor(copies[u][n])[1] for u in copies} for n in names]
|
||||||
|
update_weights(weights, names, handles)
|
||||||
|
return [t for c in copies.values() for t in c.values()]
|
||||||
|
|
||||||
|
|
||||||
|
def send_packed(weights: Weights, names: list[str], cap: int) -> list[torch.Tensor]:
|
||||||
|
"""One /update_weights call per chunk; one {uuid: args} dict per chunk."""
|
||||||
|
buffers = {
|
||||||
|
u: torch.empty(cap, dtype=torch.uint8, device=w[names[0]].device)
|
||||||
|
for u, w in weights.items()
|
||||||
|
}
|
||||||
|
handle = {u: reduce_tensor(b)[1] for u, b in buffers.items()} # export once
|
||||||
|
chunk: list[str] = []
|
||||||
|
sizes: list[int] = []
|
||||||
|
|
||||||
|
def flush() -> None:
|
||||||
|
for b in buffers.values():
|
||||||
|
torch.accelerator.synchronize(b.device) # copies must land before the read
|
||||||
|
update_weights(weights, chunk, handle, sizes)
|
||||||
|
chunk.clear()
|
||||||
|
sizes.clear()
|
||||||
|
|
||||||
|
for n in names:
|
||||||
|
nbytes = next(iter(weights.values()))[n].nbytes
|
||||||
|
assert nbytes <= cap, f"{n} ({nbytes} B) exceeds the buffer"
|
||||||
|
if chunk and sum(sizes) + nbytes > cap: # close *before* overflowing
|
||||||
|
flush()
|
||||||
|
offset = sum(sizes)
|
||||||
|
for u, w in weights.items():
|
||||||
|
flat = w[n].contiguous().view(-1).view(torch.uint8)
|
||||||
|
buffers[u][offset : offset + nbytes].copy_(flat)
|
||||||
|
chunk.append(n)
|
||||||
|
sizes.append(nbytes)
|
||||||
|
if chunk:
|
||||||
|
flush()
|
||||||
|
return list(buffers.values())
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
weights: Weights = {}
|
||||||
|
for i in range(args.num_gpus):
|
||||||
|
uuid = str(torch.cuda.get_device_properties(i).uuid)
|
||||||
|
weights[uuid] = {}
|
||||||
|
for path in sorted(glob.glob(f"{args.checkpoint}/*.safetensors")):
|
||||||
|
weights[uuid].update(load_file(path, device=f"cuda:{i}"))
|
||||||
|
names = sorted(next(iter(weights.values())))
|
||||||
|
|
||||||
|
prompts = ["The capital of France is", "def fibonacci(n):"]
|
||||||
|
print("before:", generate(prompts))
|
||||||
|
|
||||||
|
post("/init_weight_transfer_engine", {"init_info": {"packed": args.packed}})
|
||||||
|
post("/start_weight_update")
|
||||||
|
if args.packed:
|
||||||
|
exported = send_packed(weights, names, args.packed_buffer_size_bytes)
|
||||||
|
else:
|
||||||
|
exported = send_unpacked(weights, names)
|
||||||
|
post("/finish_weight_update", {"weight_version": None})
|
||||||
|
# The worker reads the exported memory until finish; only then release it.
|
||||||
|
del exported
|
||||||
|
torch.cuda.ipc_collect()
|
||||||
|
|
||||||
|
print("after: ", generate(prompts))
|
||||||
|
assert not [m for m in sys.modules if m.split(".")[0] == "vllm"]
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -0,0 +1,174 @@
|
|||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||||
|
"""NCCL weight sync over HTTP from a trainer that never imports vLLM.
|
||||||
|
|
||||||
|
The trainer uses only `torch`, `requests`, `safetensors`, `pybase64` and the
|
||||||
|
stdlib, and speaks the wire protocol in
|
||||||
|
`docs/training/weight_transfer/nccl.md` ("Trainer Without vLLM over HTTP"):
|
||||||
|
`nccl_unique_id_b64` rendezvous, a one-element warm-up `all_reduce`, then
|
||||||
|
`/start_weight_update` -> `/update_weights` (concurrent with the rank-0
|
||||||
|
broadcast) -> `/finish_weight_update`.
|
||||||
|
|
||||||
|
The NCCL communicator is a plain `torch.distributed.ProcessGroupNCCL` over a
|
||||||
|
private `TCPStore` that only the trainer joins. Its `ncclUniqueId` is read back
|
||||||
|
from store key "0", which is a torch implementation detail.
|
||||||
|
|
||||||
|
Start a server on GPUs 0-1 (the weights it starts with are discarded):
|
||||||
|
|
||||||
|
VLLM_SERVER_DEV_MODE=1 CUDA_VISIBLE_DEVICES=0,1 vllm serve Qwen/Qwen3-0.6B \
|
||||||
|
--tensor-parallel-size 2 --load-format dummy --enforce-eager \
|
||||||
|
--weight-transfer-config '{"backend": "nccl"}'
|
||||||
|
|
||||||
|
Then run the trainer on GPU 2 (`--packed` for packed broadcasting):
|
||||||
|
|
||||||
|
CUDA_VISIBLE_DEVICES=2 python examples/rl/rlhf_http_nccl_no_vllm.py \
|
||||||
|
--checkpoint /path/to/Qwen3-0.6B
|
||||||
|
"""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
class _BlockVLLM:
|
||||||
|
def find_spec(self, name, path=None, target=None):
|
||||||
|
if name.split(".")[0] == "vllm":
|
||||||
|
raise ImportError(f"this trainer must not import {name!r}")
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
sys.meta_path.insert(0, _BlockVLLM())
|
||||||
|
|
||||||
|
import argparse # noqa: E402
|
||||||
|
import datetime # noqa: E402
|
||||||
|
import glob # noqa: E402
|
||||||
|
import threading # noqa: E402
|
||||||
|
|
||||||
|
import pybase64 as base64 # noqa: E402
|
||||||
|
import requests # noqa: E402
|
||||||
|
import torch # noqa: E402
|
||||||
|
import torch.distributed as dist # noqa: E402
|
||||||
|
from safetensors.torch import load_file # noqa: E402
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("--url", default="http://localhost:8000")
|
||||||
|
parser.add_argument("--checkpoint", required=True, help="dir with *.safetensors")
|
||||||
|
parser.add_argument("--packed", action="store_true")
|
||||||
|
parser.add_argument("--packed-buffer-size-bytes", type=int, default=64 << 20)
|
||||||
|
parser.add_argument("--store-port", type=int, default=29612)
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
def post(path: str, body: dict | None = None) -> dict:
|
||||||
|
r = requests.post(args.url + path, json=body or {}, timeout=600)
|
||||||
|
r.raise_for_status()
|
||||||
|
return r.json()
|
||||||
|
|
||||||
|
|
||||||
|
class PostInBackground(threading.Thread):
|
||||||
|
"""An HTTP call that only returns once this process joins the collective."""
|
||||||
|
|
||||||
|
def __init__(self, path: str, body: dict) -> None:
|
||||||
|
super().__init__()
|
||||||
|
self.path, self.body = path, body
|
||||||
|
self.error: BaseException | None = None
|
||||||
|
self.start()
|
||||||
|
|
||||||
|
def run(self) -> None:
|
||||||
|
try:
|
||||||
|
post(self.path, self.body)
|
||||||
|
except BaseException as e:
|
||||||
|
self.error = e
|
||||||
|
|
||||||
|
def result(self) -> None:
|
||||||
|
self.join()
|
||||||
|
if self.error is not None:
|
||||||
|
raise self.error
|
||||||
|
|
||||||
|
|
||||||
|
def generate(prompts: list[str]) -> list[str]:
|
||||||
|
model = requests.get(args.url + "/v1/models", timeout=60).json()["data"][0]["id"]
|
||||||
|
body = {"model": model, "prompt": prompts, "max_tokens": 16, "temperature": 0}
|
||||||
|
choices = post("/v1/completions", body)["choices"]
|
||||||
|
return [c["text"] for c in sorted(choices, key=lambda c: c["index"])]
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
device = torch.device("cuda:0")
|
||||||
|
torch.accelerator.set_device_index(device)
|
||||||
|
weights: dict[str, torch.Tensor] = {}
|
||||||
|
for path in sorted(glob.glob(f"{args.checkpoint}/*.safetensors")):
|
||||||
|
weights.update(load_file(path, device="cuda:0"))
|
||||||
|
names = sorted(weights)
|
||||||
|
|
||||||
|
prompts = ["The capital of France is", "def fibonacci(n):"]
|
||||||
|
print("before:", generate(prompts))
|
||||||
|
|
||||||
|
# Trainer is NCCL rank 0; vLLM worker i is rank 1 + i.
|
||||||
|
world_size = 1 + requests.get(args.url + "/get_world_size").json()["world_size"]
|
||||||
|
store = dist.TCPStore(
|
||||||
|
"127.0.0.1", args.store_port, is_master=True, wait_for_workers=False
|
||||||
|
)
|
||||||
|
pg = dist.ProcessGroupNCCL(store, 0, world_size, dist.ProcessGroupNCCL.Options())
|
||||||
|
connect = threading.Thread(target=pg.eager_connect_single_device, args=(device,))
|
||||||
|
connect.start() # publishes the unique id, then waits in ncclCommInitRank
|
||||||
|
reader = dist.TCPStore("127.0.0.1", args.store_port, is_master=False)
|
||||||
|
reader.wait(["0"], datetime.timedelta(seconds=60))
|
||||||
|
unique_id = reader.get("0")
|
||||||
|
assert len(unique_id) == 128
|
||||||
|
|
||||||
|
init = PostInBackground(
|
||||||
|
"/init_weight_transfer_engine",
|
||||||
|
{
|
||||||
|
"init_info": {
|
||||||
|
"nccl_unique_id_b64": base64.b64encode(unique_id).decode(),
|
||||||
|
"rank_offset": 1,
|
||||||
|
"world_size": world_size,
|
||||||
|
"packed": args.packed,
|
||||||
|
"packed_buffer_size_bytes": args.packed_buffer_size_bytes,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
connect.join()
|
||||||
|
pg.allreduce([torch.zeros(1, device=device)]).wait() # vLLM's warm-up
|
||||||
|
init.result()
|
||||||
|
|
||||||
|
def broadcast(t: torch.Tensor) -> None:
|
||||||
|
opts = dist.BroadcastOptions()
|
||||||
|
opts.rootRank = 0
|
||||||
|
pg.broadcast([t], opts).wait()
|
||||||
|
|
||||||
|
post("/start_weight_update")
|
||||||
|
update_info = {
|
||||||
|
"names": names,
|
||||||
|
"dtype_names": [str(weights[n].dtype).removeprefix("torch.") for n in names],
|
||||||
|
"shapes": [list(weights[n].shape) for n in names],
|
||||||
|
}
|
||||||
|
update = PostInBackground("/update_weights", {"update_info": update_info})
|
||||||
|
if not args.packed:
|
||||||
|
for n in names:
|
||||||
|
broadcast(weights[n].contiguous())
|
||||||
|
else:
|
||||||
|
# Same chunking as the worker: a chunk closes right after the tensor
|
||||||
|
# that pushes it past the buffer size.
|
||||||
|
chunk: list[torch.Tensor] = []
|
||||||
|
size = 0
|
||||||
|
for n in names:
|
||||||
|
chunk.append(weights[n].contiguous().view(-1).view(torch.uint8))
|
||||||
|
size += chunk[-1].numel()
|
||||||
|
if size > args.packed_buffer_size_bytes:
|
||||||
|
broadcast(torch.cat(chunk))
|
||||||
|
chunk, size = [], 0
|
||||||
|
if chunk:
|
||||||
|
broadcast(torch.cat(chunk))
|
||||||
|
torch.accelerator.synchronize()
|
||||||
|
update.result()
|
||||||
|
post("/finish_weight_update", {"weight_version": None})
|
||||||
|
|
||||||
|
print("after: ", generate(prompts))
|
||||||
|
post("/shutdown_weight_transfer_engine")
|
||||||
|
pg.shutdown()
|
||||||
|
|
||||||
|
assert not [m for m in sys.modules if m.split(".")[0] == "vllm"]
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -3,6 +3,8 @@
|
|||||||
"""Call a token-in/token-out server started with:
|
"""Call a token-in/token-out server started with:
|
||||||
|
|
||||||
vllm serve Qwen/Qwen3-0.6B --enable-scale-out
|
vllm serve Qwen/Qwen3-0.6B --enable-scale-out
|
||||||
|
|
||||||
|
Fields and DP rank routing: docs/serving/online_serving/token_in_token_out.md
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ plugins:
|
|||||||
examples/features/pause_resume.md: examples/rl/pause_resume.md
|
examples/features/pause_resume.md: examples/rl/pause_resume.md
|
||||||
serving/online_serving/decisions.md: models/structured_decisions_models.md
|
serving/online_serving/decisions.md: models/structured_decisions_models.md
|
||||||
serving/online_serving/structured_decisions.md: models/structured_decisions_models.md
|
serving/online_serving/structured_decisions.md: models/structured_decisions_models.md
|
||||||
|
training/routed_experts_replay.md: training/routed_experts.md
|
||||||
|
|
||||||
markdown_extensions:
|
markdown_extensions:
|
||||||
- attr_list
|
- attr_list
|
||||||
|
|||||||
@@ -1,172 +0,0 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
||||||
"""Configuration-level regression tests for Qwen4Exp GDN/PLE RecoverSSM selection.
|
|
||||||
|
|
||||||
``--use-replayssm`` with speculative decoding selects RecoverSSM for Qwen4Exp, as it
|
|
||||||
does for Kimi-K3 KDA. The MTP drafter's derived config shares ``cache_config`` and must
|
|
||||||
keep the choice. These tests run the real validator function against stand-in configs.
|
|
||||||
"""
|
|
||||||
|
|
||||||
from types import SimpleNamespace
|
|
||||||
from typing import Any, cast
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from vllm.config.mamba import MambaBackendEnum
|
|
||||||
from vllm.config.vllm import VllmConfig
|
|
||||||
from vllm.model_executor.layers.mamba.recoverssm_utils import uses_recoverssm
|
|
||||||
from vllm.v1.attention.backend import AttentionCGSupport
|
|
||||||
|
|
||||||
TARGET = "Qwen4ExpForConditionalGeneration"
|
|
||||||
DRAFTER = "Qwen4ExpMTP"
|
|
||||||
|
|
||||||
|
|
||||||
def _validator():
|
|
||||||
validators = VllmConfig.__pydantic_decorators__.model_validators # type: ignore[attr-defined]
|
|
||||||
return validators["validate_mamba_cached_kernel"].func
|
|
||||||
|
|
||||||
|
|
||||||
def _config(
|
|
||||||
arch: str,
|
|
||||||
cache_config=None,
|
|
||||||
num_spec: int = 3,
|
|
||||||
use_replayssm: bool = True,
|
|
||||||
supports_replayssm: bool = True,
|
|
||||||
**overrides,
|
|
||||||
):
|
|
||||||
cfg = SimpleNamespace(
|
|
||||||
num_speculative_tokens=num_spec,
|
|
||||||
model_config=SimpleNamespace(
|
|
||||||
architecture=arch, supports_replayssm=supports_replayssm
|
|
||||||
),
|
|
||||||
cache_config=cache_config
|
|
||||||
or SimpleNamespace(
|
|
||||||
use_recoverssm=False,
|
|
||||||
use_replayssm=use_replayssm,
|
|
||||||
mamba_cache_mode="align",
|
|
||||||
),
|
|
||||||
mamba_config=SimpleNamespace(
|
|
||||||
enable_stochastic_rounding=False, backend=MambaBackendEnum.TRITON
|
|
||||||
),
|
|
||||||
use_v2_model_runner=True,
|
|
||||||
parallel_config=SimpleNamespace(pipeline_parallel_size=1),
|
|
||||||
kv_transfer_config=None,
|
|
||||||
)
|
|
||||||
for key, value in overrides.items():
|
|
||||||
target, _, attr = key.partition("__")
|
|
||||||
if attr:
|
|
||||||
setattr(getattr(cfg, target), attr, value)
|
|
||||||
else:
|
|
||||||
setattr(cfg, target, value)
|
|
||||||
return cfg
|
|
||||||
|
|
||||||
|
|
||||||
def test_validator_is_registered():
|
|
||||||
assert "validate_mamba_cached_kernel" in (
|
|
||||||
VllmConfig.__pydantic_decorators__.model_validators # type: ignore[attr-defined]
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
"arch", ["Qwen4ExpForConditionalGeneration", "Qwen4ExpForCausalLM"]
|
|
||||||
)
|
|
||||||
def test_replayssm_with_spec_selects_recoverssm(arch):
|
|
||||||
cfg = _config(arch)
|
|
||||||
_validator()(cfg)
|
|
||||||
assert cfg.cache_config.use_recoverssm is True
|
|
||||||
assert uses_recoverssm(cfg.cache_config, 3)
|
|
||||||
|
|
||||||
|
|
||||||
def test_derived_drafter_keeps_the_choice_and_runs_the_checks():
|
|
||||||
target = _config(TARGET)
|
|
||||||
_validator()(target)
|
|
||||||
drafter = _config(DRAFTER, cache_config=target.cache_config)
|
|
||||||
_validator()(drafter)
|
|
||||||
assert target.cache_config.use_recoverssm is True
|
|
||||||
bad = _config(
|
|
||||||
DRAFTER,
|
|
||||||
cache_config=target.cache_config,
|
|
||||||
parallel_config__pipeline_parallel_size=2,
|
|
||||||
)
|
|
||||||
with pytest.raises(ValueError, match="pipeline_parallel_size"):
|
|
||||||
_validator()(bad)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
("override", "value", "match"),
|
|
||||||
[
|
|
||||||
("parallel_config__pipeline_parallel_size", 2, "pipeline_parallel_size"),
|
|
||||||
("mamba_config__enable_stochastic_rounding", True, "stochastic"),
|
|
||||||
("mamba_config__backend", "flashinfer", "mamba-backend triton"),
|
|
||||||
("use_v2_model_runner", False, "V2_MODEL_RUNNER"),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
def test_runtime_checks_reject(override, value, match):
|
|
||||||
cfg = _config(TARGET, **{override: value})
|
|
||||||
with pytest.raises(ValueError, match=match):
|
|
||||||
_validator()(cfg)
|
|
||||||
|
|
||||||
|
|
||||||
def test_flag_unset_keeps_the_stock_path():
|
|
||||||
cfg = _config(TARGET, use_replayssm=False)
|
|
||||||
_validator()(cfg)
|
|
||||||
assert cfg.cache_config.use_recoverssm is False
|
|
||||||
assert not uses_recoverssm(cfg.cache_config, 3)
|
|
||||||
|
|
||||||
|
|
||||||
def test_qwen4exp_replayssm_requires_speculative_decoding():
|
|
||||||
with pytest.raises(ValueError, match="requires speculative decoding"):
|
|
||||||
_validator()(_config(TARGET, num_spec=0))
|
|
||||||
|
|
||||||
|
|
||||||
def test_architecture_without_replayssm_support_is_rejected():
|
|
||||||
cfg = _config("Qwen3NextForCausalLM", supports_replayssm=False)
|
|
||||||
with pytest.raises(ValueError, match="not supported for architecture"):
|
|
||||||
_validator()(cfg)
|
|
||||||
|
|
||||||
|
|
||||||
def test_uses_recoverssm_predicate():
|
|
||||||
on = SimpleNamespace(use_recoverssm=True)
|
|
||||||
assert uses_recoverssm(on, 3)
|
|
||||||
assert not uses_recoverssm(on, 0)
|
|
||||||
assert not uses_recoverssm(SimpleNamespace(use_recoverssm=False), 3)
|
|
||||||
assert not uses_recoverssm(SimpleNamespace(), 3)
|
|
||||||
|
|
||||||
|
|
||||||
def test_builders_fall_back_to_piecewise():
|
|
||||||
from vllm.v1.attention.backends.gdn_recoverssm import GDNRecoverSSMMetadataBuilder
|
|
||||||
from vllm.v1.attention.backends.ple_recoverssm import PleRecoverSSMMetadataBuilder
|
|
||||||
|
|
||||||
for builder in (GDNRecoverSSMMetadataBuilder, PleRecoverSSMMetadataBuilder):
|
|
||||||
assert (
|
|
||||||
builder.get_cudagraph_support(cast(Any, None), cast(Any, None))
|
|
||||||
== AttentionCGSupport.NEVER
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("compile_mode", ["VLLM_COMPILE", "NONE"])
|
|
||||||
@pytest.mark.parametrize(("breakable", "expected"), [("1", "PIECEWISE"), ("0", "NONE")])
|
|
||||||
def test_never_support_falls_back_to_piecewise_with_breakable_cudagraphs(
|
|
||||||
monkeypatch, compile_mode, breakable, expected
|
|
||||||
):
|
|
||||||
"""A backend without full-graph support must keep piecewise graphs when breakable
|
|
||||||
CUDA graphs split at attention (splitting_ops is empty then, and torch.compile may
|
|
||||||
be off)."""
|
|
||||||
from vllm.config.compilation import (
|
|
||||||
CompilationConfig,
|
|
||||||
CompilationMode,
|
|
||||||
CUDAGraphMode,
|
|
||||||
)
|
|
||||||
|
|
||||||
monkeypatch.setenv("VLLM_USE_BREAKABLE_CUDAGRAPH", breakable)
|
|
||||||
compilation_config = CompilationConfig(
|
|
||||||
mode=CompilationMode[compile_mode],
|
|
||||||
cudagraph_mode=CUDAGraphMode.FULL_AND_PIECEWISE,
|
|
||||||
splitting_ops=[],
|
|
||||||
)
|
|
||||||
resolved = compilation_config.resolve_cudagraph_mode_and_sizes(
|
|
||||||
AttentionCGSupport.NEVER,
|
|
||||||
"GDNRecoverSSMAttentionBackend",
|
|
||||||
uniform_decode_query_len=4,
|
|
||||||
)
|
|
||||||
assert resolved.name == expected
|
|
||||||
@@ -65,6 +65,8 @@ def llm_reranker_processor() -> CrossEncoderIOProcessor:
|
|||||||
processor.supports_score_template = False
|
processor.supports_score_template = False
|
||||||
processor.use_sep_token = False
|
processor.use_sep_token = False
|
||||||
processor.model = None
|
processor.model = None
|
||||||
|
processor.saved_chat_template = None
|
||||||
|
processor.saved_chat_template_kwargs = {}
|
||||||
return processor
|
return processor
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,602 +0,0 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
||||||
"""GDN RecoverSSM: verify against the native fused kernel, commit against the native
|
|
||||||
per-token states, and the boundary checks (malformed metadata must raise ValueError
|
|
||||||
before any kernel reads or writes out of bounds)."""
|
|
||||||
|
|
||||||
from typing import Any, cast
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
import torch
|
|
||||||
|
|
||||||
from vllm.model_executor.layers.mamba.gdn.recoverssm_gdn import (
|
|
||||||
GDNRecoverSSMCommitContext,
|
|
||||||
gdn_recoverssm_verify,
|
|
||||||
)
|
|
||||||
from vllm.third_party.flash_linear_attention.ops.fused_sigmoid_gating import (
|
|
||||||
fused_sigmoid_gating_delta_rule_update,
|
|
||||||
)
|
|
||||||
|
|
||||||
pytestmark = pytest.mark.skipif(not torch.cuda.is_available(), reason="needs CUDA")
|
|
||||||
H, HV, K, V, T = 16, 48, 128, 128, 4
|
|
||||||
QLENS = (4, 4, 3)
|
|
||||||
|
|
||||||
|
|
||||||
def _inputs(nb: int = 10) -> dict:
|
|
||||||
torch.manual_seed(0)
|
|
||||||
dev = "cuda"
|
|
||||||
tot = sum(QLENS)
|
|
||||||
qsl = torch.tensor([0, 4, 8, 11], dtype=torch.int32, device=dev)
|
|
||||||
return dict(
|
|
||||||
A_log=(torch.rand(HV, device=dev) * 2 - 1).float(),
|
|
||||||
a=torch.randn(tot, HV, device=dev, dtype=torch.bfloat16),
|
|
||||||
b=torch.randn(tot, HV, device=dev, dtype=torch.bfloat16),
|
|
||||||
dt_bias=(torch.randn(HV, device=dev) * 0.5).bfloat16(),
|
|
||||||
q=torch.randn(1, tot, H, K, device=dev, dtype=torch.bfloat16),
|
|
||||||
k=torch.randn(1, tot, H, K, device=dev, dtype=torch.bfloat16),
|
|
||||||
v=torch.randn(1, tot, HV, V, device=dev, dtype=torch.bfloat16),
|
|
||||||
checkpoint_state=(torch.randn(nb, HV, V, K, device=dev) * 0.05).float(),
|
|
||||||
replay_cache=torch.zeros(nb, HV, T, V + K + 1, device=dev),
|
|
||||||
query_start_loc=qsl,
|
|
||||||
state_indices=torch.tensor([2, 5, 7], dtype=torch.int32, device=dev),
|
|
||||||
spec_query_len=T,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def _verify(inp: dict, **override):
|
|
||||||
d = {**inp, **override}
|
|
||||||
return gdn_recoverssm_verify(
|
|
||||||
d["A_log"],
|
|
||||||
d["a"],
|
|
||||||
d["b"],
|
|
||||||
d["dt_bias"],
|
|
||||||
d["q"],
|
|
||||||
d["k"],
|
|
||||||
d["v"],
|
|
||||||
checkpoint_state=d["checkpoint_state"],
|
|
||||||
replay_cache=d["replay_cache"],
|
|
||||||
query_start_loc=d["query_start_loc"],
|
|
||||||
state_indices=d["state_indices"],
|
|
||||||
spec_query_len=d["spec_query_len"],
|
|
||||||
out=d.get("out"),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def _native(inp: dict):
|
|
||||||
return fused_sigmoid_gating_delta_rule_update(
|
|
||||||
A_log=inp["A_log"],
|
|
||||||
a=inp["a"],
|
|
||||||
b=inp["b"],
|
|
||||||
dt_bias=inp["dt_bias"],
|
|
||||||
q=inp["q"],
|
|
||||||
k=inp["k"],
|
|
||||||
v=inp["v"],
|
|
||||||
initial_state=inp["checkpoint_state"].clone(),
|
|
||||||
inplace_final_state=False,
|
|
||||||
cu_seqlens=inp["query_start_loc"].long(),
|
|
||||||
ssm_state_indices=inp["state_indices"].long(),
|
|
||||||
use_qk_l2norm_in_kernel=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def _context(inp: dict, ckpt: torch.Tensor) -> GDNRecoverSSMCommitContext:
|
|
||||||
nb = ckpt.shape[0]
|
|
||||||
conv = [torch.zeros(nb, 8, 3 + T - 1, device="cuda", dtype=torch.bfloat16)]
|
|
||||||
return GDNRecoverSSMCommitContext.from_tensors(
|
|
||||||
conv, [ckpt], [inp["replay_cache"]], spec_query_len=T, max_num_reqs=8
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def test_verify_matches_native_and_keeps_the_checkpoint():
|
|
||||||
inp = _inputs()
|
|
||||||
before = inp["checkpoint_state"].clone()
|
|
||||||
out = _verify(inp)
|
|
||||||
ref, _ = _native(inp)
|
|
||||||
torch.testing.assert_close(
|
|
||||||
out.float(), ref.reshape(out.shape).float(), rtol=0, atol=0
|
|
||||||
)
|
|
||||||
assert torch.equal(inp["checkpoint_state"], before)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("accepted", [1, 2, 3, 4])
|
|
||||||
def test_commit_matches_native_per_token_state(accepted):
|
|
||||||
inp = _inputs()
|
|
||||||
_verify(inp)
|
|
||||||
_, states = _native(inp)
|
|
||||||
ckpt = inp["checkpoint_state"].clone()
|
|
||||||
ctx = _context(inp, ckpt)
|
|
||||||
acc = torch.tensor(
|
|
||||||
[min(accepted, q) for q in QLENS], dtype=torch.int32, device="cuda"
|
|
||||||
)
|
|
||||||
ctx.commit(acc, inp["state_indices"], inp["query_start_loc"])
|
|
||||||
for i, blk in enumerate(inp["state_indices"].tolist()):
|
|
||||||
tok = int(inp["query_start_loc"][i]) + int(acc[i]) - 1
|
|
||||||
torch.testing.assert_close(ckpt[blk], states[tok], rtol=1e-5, atol=1e-6)
|
|
||||||
others = [b for b in range(ckpt.shape[0]) if b not in inp["state_indices"].tolist()]
|
|
||||||
assert torch.equal(ckpt[others], inp["checkpoint_state"][others])
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
"case", ["short_qsl", "capacity", "hv_lt_h", "a_log", "out", "replay", "device"]
|
|
||||||
)
|
|
||||||
def test_verify_rejects_malformed_inputs(case):
|
|
||||||
inp = _inputs()
|
|
||||||
over, match = {
|
|
||||||
"short_qsl": (
|
|
||||||
dict(query_start_loc=inp["query_start_loc"][:-1]),
|
|
||||||
"query metadata",
|
|
||||||
),
|
|
||||||
"capacity": (
|
|
||||||
dict(
|
|
||||||
state_indices=inp["state_indices"][:2],
|
|
||||||
query_start_loc=inp["query_start_loc"][:3],
|
|
||||||
),
|
|
||||||
"activation capacity",
|
|
||||||
),
|
|
||||||
"hv_lt_h": (
|
|
||||||
dict(
|
|
||||||
v=inp["v"][:, :, :8].contiguous(),
|
|
||||||
a=inp["a"][:, :8].contiguous(),
|
|
||||||
b=inp["b"][:, :8].contiguous(),
|
|
||||||
),
|
|
||||||
"positive multiple",
|
|
||||||
),
|
|
||||||
"a_log": (dict(A_log=torch.zeros(HV + 1, device="cuda")), "A_log"),
|
|
||||||
"out": (
|
|
||||||
dict(
|
|
||||||
out=torch.empty(1, 11, HV, V + 1, device="cuda", dtype=torch.bfloat16)
|
|
||||||
),
|
|
||||||
"output shape",
|
|
||||||
),
|
|
||||||
"replay": (
|
|
||||||
dict(replay_cache=torch.zeros(10, HV, T, V + K, device="cuda")),
|
|
||||||
"replay buffer",
|
|
||||||
),
|
|
||||||
"device": (dict(A_log=inp["A_log"].cpu()), "same device"),
|
|
||||||
}[case]
|
|
||||||
with pytest.raises(ValueError, match=match):
|
|
||||||
_verify(inp, **over)
|
|
||||||
|
|
||||||
|
|
||||||
def test_commit_rejects_partial_or_short_metadata():
|
|
||||||
inp = _inputs()
|
|
||||||
ctx = _context(inp, inp["checkpoint_state"].clone())
|
|
||||||
acc = torch.ones(3, dtype=torch.int32, device="cuda")
|
|
||||||
bt = torch.zeros(3, 4, dtype=torch.int32, device="cuda")
|
|
||||||
with pytest.raises(ValueError, match="align metadata is incomplete"):
|
|
||||||
ctx.commit(
|
|
||||||
acc,
|
|
||||||
inp["state_indices"],
|
|
||||||
inp["query_start_loc"],
|
|
||||||
block_table=bt,
|
|
||||||
mamba_block_size=16,
|
|
||||||
)
|
|
||||||
with pytest.raises(ValueError, match="commit metadata"):
|
|
||||||
ctx.commit(acc, inp["state_indices"], inp["query_start_loc"][:-1])
|
|
||||||
with pytest.raises(ValueError, match="request mapping"):
|
|
||||||
ctx.commit(
|
|
||||||
acc,
|
|
||||||
inp["state_indices"],
|
|
||||||
inp["query_start_loc"],
|
|
||||||
request_indices=torch.zeros(2, dtype=torch.int32, device="cuda"),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def test_context_rejects_inconsistent_layers():
|
|
||||||
inp = _inputs()
|
|
||||||
ck = inp["checkpoint_state"]
|
|
||||||
conv = torch.zeros(ck.shape[0], 8, 3 + T - 1, device="cuda", dtype=torch.bfloat16)
|
|
||||||
with pytest.raises(ValueError, match="at least one layer"):
|
|
||||||
GDNRecoverSSMCommitContext.from_tensors(
|
|
||||||
[], [], [], spec_query_len=T, max_num_reqs=8
|
|
||||||
)
|
|
||||||
with pytest.raises(ValueError, match="differ"):
|
|
||||||
GDNRecoverSSMCommitContext.from_tensors(
|
|
||||||
[conv], [ck, ck], [inp["replay_cache"]], spec_query_len=T, max_num_reqs=8
|
|
||||||
)
|
|
||||||
with pytest.raises(ValueError, match="block count"):
|
|
||||||
GDNRecoverSSMCommitContext.from_tensors(
|
|
||||||
[conv[:5]], [ck], [inp["replay_cache"]], spec_query_len=T, max_num_reqs=8
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------ review round 2:
|
|
||||||
# mapping, align, extreme gates
|
|
||||||
from vllm.v1.attention.backends.recoverssm_metadata import ( # noqa: E402
|
|
||||||
recoverssm_request_indices,
|
|
||||||
recoverssm_spec_rows,
|
|
||||||
)
|
|
||||||
|
|
||||||
# (A_log range, a scale, b offset): drive g = -exp(A_log) * softplus(a + dt_bias)
|
|
||||||
# and beta = sigmoid(b)
|
|
||||||
GATES = {
|
|
||||||
"typical": (0.0, 1.0, 0.0),
|
|
||||||
"g_near_0": (-12.0, 1.0, 0.0),
|
|
||||||
"g_very_negative": (2.5, 4.0, 0.0),
|
|
||||||
"beta_near_0": (0.0, 1.0, -12.0),
|
|
||||||
"beta_near_1": (0.0, 1.0, 12.0),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _make(qlens, nb=16, seed=0, gate="typical"):
|
|
||||||
g = torch.Generator(device="cuda").manual_seed(seed)
|
|
||||||
rnd = lambda *s: torch.randn(*s, device="cuda", generator=g) # noqa: E731
|
|
||||||
a_log_shift, ascale, boff = GATES[gate]
|
|
||||||
tot = sum(qlens)
|
|
||||||
qsl = torch.tensor(
|
|
||||||
[0, *torch.tensor(qlens).cumsum(0).tolist()], dtype=torch.int32, device="cuda"
|
|
||||||
)
|
|
||||||
return dict(
|
|
||||||
A_log=(
|
|
||||||
torch.rand(HV, device="cuda", generator=g) * 2 - 1 + a_log_shift
|
|
||||||
).float(),
|
|
||||||
a=(rnd(tot, HV) * ascale).bfloat16(),
|
|
||||||
b=(rnd(tot, HV) + boff).bfloat16(),
|
|
||||||
dt_bias=(rnd(HV) * 0.5).bfloat16(),
|
|
||||||
q=rnd(1, tot, H, K).bfloat16(),
|
|
||||||
k=rnd(1, tot, H, K).bfloat16(),
|
|
||||||
v=rnd(1, tot, HV, V).bfloat16(),
|
|
||||||
checkpoint_state=(rnd(nb, HV, V, K) * 0.05).float(),
|
|
||||||
replay_cache=torch.zeros(nb, HV, T, V + K + 1, device="cuda"),
|
|
||||||
query_start_loc=qsl,
|
|
||||||
spec_query_len=T,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def test_spec_rows_mixed_batch():
|
|
||||||
# rows: 0 spec K=3 | 1 prefill | 2 draft-less decode | 3 spec K=1 | 4 padded
|
|
||||||
# zero-query | 5,6 beyond num_reqs
|
|
||||||
is_prefilling = torch.tensor([False, True, False, False, False, False, False])
|
|
||||||
qsl = torch.tensor([0, 4, 104, 105, 107, 107], dtype=torch.int32)
|
|
||||||
drafts_in = torch.tensor(
|
|
||||||
[3, -1, -1, 1, -1, 2, 0], dtype=torch.int32
|
|
||||||
) # 5, 6: garbage padding
|
|
||||||
drafts, rows = recoverssm_spec_rows(is_prefilling, qsl, drafts_in, num_reqs=5)
|
|
||||||
assert rows.tolist() == [0, 2, 3]
|
|
||||||
assert drafts.tolist() == [1, -1, 1, 1, -1, -1, -1]
|
|
||||||
idx = recoverssm_request_indices(rows, 3, torch.device("cuda"))
|
|
||||||
assert idx is not None and idx.tolist() == [0, 2, 3]
|
|
||||||
assert (
|
|
||||||
recoverssm_request_indices(torch.tensor([0, 1, 2]), 3, torch.device("cuda"))
|
|
||||||
is None
|
|
||||||
)
|
|
||||||
with pytest.raises(ValueError, match="spec rows classified"):
|
|
||||||
recoverssm_request_indices(rows, 2, torch.device("cuda"))
|
|
||||||
|
|
||||||
|
|
||||||
def test_commit_maps_noncontiguous_requests_in_align_mode():
|
|
||||||
"""Spec rows 0, 2, 3 of a 5-request batch; accepted counts, block table and
|
|
||||||
num_computed are indexed by request row. Every spec request must commit its own
|
|
||||||
state into its own block."""
|
|
||||||
qlens = [4, 1, 2] # the spec rows' windows (K=3, draft-less, K=1)
|
|
||||||
inp = _make(qlens, nb=40)
|
|
||||||
bs = 8
|
|
||||||
bt = torch.arange(1, 1 + 5 * 6, dtype=torch.int32, device="cuda").reshape(
|
|
||||||
5, 6
|
|
||||||
) # request row -> blocks
|
|
||||||
nc = torch.tensor(
|
|
||||||
[5, 0, 16, 9, 0], dtype=torch.int32, device="cuda"
|
|
||||||
) # per request row
|
|
||||||
req_rows = torch.tensor([0, 2, 3], dtype=torch.int32, device="cuda")
|
|
||||||
src = torch.stack([bt[r, int(nc[r]) // bs] for r in req_rows.tolist()]).contiguous()
|
|
||||||
inp["state_indices"] = src
|
|
||||||
_verify(inp)
|
|
||||||
_, states = _native(inp)
|
|
||||||
ckpt = inp["checkpoint_state"].clone()
|
|
||||||
ctx = _context(inp, ckpt)
|
|
||||||
acc = torch.tensor(
|
|
||||||
[3, 9, 1, 2, 9], dtype=torch.int32, device="cuda"
|
|
||||||
) # rows 1, 4 must be ignored
|
|
||||||
ctx.commit(
|
|
||||||
acc,
|
|
||||||
src,
|
|
||||||
inp["query_start_loc"],
|
|
||||||
request_indices=req_rows,
|
|
||||||
block_table=bt,
|
|
||||||
num_computed_tokens=nc,
|
|
||||||
mamba_block_size=bs,
|
|
||||||
)
|
|
||||||
for i, r in enumerate(req_rows.tolist()):
|
|
||||||
n = min(int(acc[r]), qlens[i])
|
|
||||||
c0 = int(nc[r])
|
|
||||||
final_blk = int(bt[r, max(c0 + n - 1, 0) // bs])
|
|
||||||
tok = int(inp["query_start_loc"][i]) + n - 1
|
|
||||||
torch.testing.assert_close(ckpt[final_blk], states[tok], rtol=1e-5, atol=1e-6)
|
|
||||||
|
|
||||||
|
|
||||||
# (num_computed, accepted, block size): boundary after 1 / after 2 / ending exactly on
|
|
||||||
# it / crossing and continuing / accepted = 1 without crossing / the full window
|
|
||||||
# crossing after 3. A window ending exactly on a boundary keeps its state in the block
|
|
||||||
# holding its last token: the next block may still be unallocated.
|
|
||||||
ALIGN_CASES = [
|
|
||||||
(3, 2, 4),
|
|
||||||
(2, 3, 4),
|
|
||||||
(0, 4, 4),
|
|
||||||
(6, 4, 4),
|
|
||||||
(1, 1, 4),
|
|
||||||
(5, 4, 8),
|
|
||||||
(7, 4, 8),
|
|
||||||
(4, 4, 8),
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("nc,accepted,bs", ALIGN_CASES)
|
|
||||||
def test_align_boundary_and_final_state_match_native(nc, accepted, bs):
|
|
||||||
inp = _make([T], nb=12)
|
|
||||||
bt = torch.arange(2, 8, dtype=torch.int32, device="cuda").reshape(1, 6)
|
|
||||||
src = bt[0, nc // bs].reshape(1).contiguous()
|
|
||||||
inp["state_indices"] = src
|
|
||||||
_verify(inp)
|
|
||||||
_, states = _native(inp)
|
|
||||||
ckpt = inp["checkpoint_state"].clone()
|
|
||||||
ctx = _context(inp, ckpt)
|
|
||||||
ctx.commit(
|
|
||||||
torch.tensor([accepted], dtype=torch.int32, device="cuda"),
|
|
||||||
src,
|
|
||||||
inp["query_start_loc"],
|
|
||||||
block_table=bt,
|
|
||||||
num_computed_tokens=torch.tensor([nc], dtype=torch.int32, device="cuda"),
|
|
||||||
mamba_block_size=bs,
|
|
||||||
)
|
|
||||||
next_boundary = (nc // bs + 1) * bs
|
|
||||||
final_blk = int(bt[0, max(nc + accepted - 1, 0) // bs])
|
|
||||||
if (
|
|
||||||
nc + accepted >= next_boundary
|
|
||||||
): # crosses: the boundary state goes into the source block
|
|
||||||
torch.testing.assert_close(
|
|
||||||
ckpt[int(src)], states[next_boundary - nc - 1], rtol=1e-5, atol=1e-6
|
|
||||||
)
|
|
||||||
torch.testing.assert_close(
|
|
||||||
ckpt[final_blk], states[accepted - 1], rtol=1e-5, atol=1e-6
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("gate", list(GATES))
|
|
||||||
@pytest.mark.parametrize("seed", [0, 1, 2])
|
|
||||||
def test_commit_matches_native_under_extreme_gates(gate, seed):
|
|
||||||
inp = _make(list(QLENS), nb=10, seed=seed, gate=gate)
|
|
||||||
inp["state_indices"] = torch.tensor([2, 5, 7], dtype=torch.int32, device="cuda")
|
|
||||||
_verify(inp)
|
|
||||||
_, states = _native(inp)
|
|
||||||
for accepted in (1, 2, 3, 4):
|
|
||||||
ckpt = inp["checkpoint_state"].clone()
|
|
||||||
ctx = _context(inp, ckpt)
|
|
||||||
acc = torch.tensor(
|
|
||||||
[min(accepted, q) for q in QLENS], dtype=torch.int32, device="cuda"
|
|
||||||
)
|
|
||||||
ctx.commit(acc, inp["state_indices"], inp["query_start_loc"])
|
|
||||||
for i, blk in enumerate(inp["state_indices"].tolist()):
|
|
||||||
tok = int(inp["query_start_loc"][i]) + int(acc[i]) - 1
|
|
||||||
torch.testing.assert_close(ckpt[blk], states[tok], rtol=1e-5, atol=1e-6)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("batch", [1, 2, 4])
|
|
||||||
def test_verify_on_strided_views_writes_in_place(batch):
|
|
||||||
"""The layer passes views of the packed conv output (token stride = the packed
|
|
||||||
width) and the layer's output buffer; result and replay record must equal the
|
|
||||||
contiguous-copy path."""
|
|
||||||
torch.manual_seed(batch)
|
|
||||||
H, HV, K, V, SQ, NB = 16, 48, 128, 128, 4, 6
|
|
||||||
T = batch * SQ
|
|
||||||
qd, vd = H * K, HV * V
|
|
||||||
packed = torch.randn(T, 2 * qd + 2 * vd, device="cuda", dtype=torch.bfloat16)
|
|
||||||
mixed = packed[:, : 2 * qd + vd]
|
|
||||||
a = torch.randn(T, HV, device="cuda", dtype=torch.bfloat16)
|
|
||||||
b = torch.randn(T, HV, device="cuda", dtype=torch.bfloat16)
|
|
||||||
A_log = torch.randn(HV, device="cuda")
|
|
||||||
dt_bias = torch.randn(HV, device="cuda")
|
|
||||||
checkpoint = torch.randn(NB, HV, V, K, device="cuda") * 0.05
|
|
||||||
qsl = torch.arange(0, T + 1, SQ, device="cuda", dtype=torch.int32)
|
|
||||||
si = torch.arange(1, batch + 1, device="cuda", dtype=torch.int32)
|
|
||||||
|
|
||||||
def run(q, k, v, out=None):
|
|
||||||
replay = torch.zeros(NB, HV, SQ, V + K + 1, device="cuda")
|
|
||||||
o = gdn_recoverssm_verify(
|
|
||||||
A_log,
|
|
||||||
a,
|
|
||||||
b,
|
|
||||||
dt_bias,
|
|
||||||
q,
|
|
||||||
k,
|
|
||||||
v,
|
|
||||||
checkpoint_state=checkpoint,
|
|
||||||
replay_cache=replay,
|
|
||||||
query_start_loc=qsl,
|
|
||||||
state_indices=si,
|
|
||||||
spec_query_len=SQ,
|
|
||||||
out=out,
|
|
||||||
)
|
|
||||||
return o, replay
|
|
||||||
|
|
||||||
q, k, v = (
|
|
||||||
x.contiguous().view(1, T, -1, d)
|
|
||||||
for x, d in zip(torch.split(mixed, [qd, qd, vd], dim=-1), (K, K, V))
|
|
||||||
)
|
|
||||||
want_out, want_replay = run(q, k, v)
|
|
||||||
|
|
||||||
core = torch.zeros(T + 3, HV, V, device="cuda", dtype=torch.bfloat16)
|
|
||||||
views = (
|
|
||||||
mixed[:, :qd].view(1, T, -1, K),
|
|
||||||
mixed[:, qd : 2 * qd].view(1, T, -1, K),
|
|
||||||
mixed[:, 2 * qd :].view(1, T, -1, V),
|
|
||||||
)
|
|
||||||
got_out, got_replay = run(*views, out=core[:T].unsqueeze(0))
|
|
||||||
assert got_out.data_ptr() == core.data_ptr()
|
|
||||||
assert torch.equal(core[:T].unsqueeze(0), want_out)
|
|
||||||
assert torch.equal(got_replay, want_replay)
|
|
||||||
|
|
||||||
|
|
||||||
def test_verify_on_strided_views_with_variable_query_lengths():
|
|
||||||
"""Token-strided views with ragged windows (query lengths 4, 1, 3), as MTP
|
|
||||||
scheduling produces them."""
|
|
||||||
torch.manual_seed(7)
|
|
||||||
H, HV, K, V, SQ, NB = 16, 48, 128, 128, 4, 6
|
|
||||||
qsl_list = [0, 4, 5, 8]
|
|
||||||
T = qsl_list[-1]
|
|
||||||
qd, vd = H * K, HV * V
|
|
||||||
packed = torch.randn(T, 2 * qd + 2 * vd, device="cuda", dtype=torch.bfloat16)
|
|
||||||
mixed = packed[:, : 2 * qd + vd]
|
|
||||||
a = torch.randn(T, HV, device="cuda", dtype=torch.bfloat16)
|
|
||||||
b = torch.randn(T, HV, device="cuda", dtype=torch.bfloat16)
|
|
||||||
A_log = torch.randn(HV, device="cuda")
|
|
||||||
dt_bias = torch.randn(HV, device="cuda")
|
|
||||||
checkpoint = torch.randn(NB, HV, V, K, device="cuda") * 0.05
|
|
||||||
qsl = torch.tensor(qsl_list, device="cuda", dtype=torch.int32)
|
|
||||||
si = torch.tensor([1, 3, 5], device="cuda", dtype=torch.int32)
|
|
||||||
|
|
||||||
def run(q, k, v, out=None):
|
|
||||||
replay = torch.zeros(NB, HV, SQ, V + K + 1, device="cuda")
|
|
||||||
o = gdn_recoverssm_verify(
|
|
||||||
A_log,
|
|
||||||
a,
|
|
||||||
b,
|
|
||||||
dt_bias,
|
|
||||||
q,
|
|
||||||
k,
|
|
||||||
v,
|
|
||||||
checkpoint_state=checkpoint,
|
|
||||||
replay_cache=replay,
|
|
||||||
query_start_loc=qsl,
|
|
||||||
state_indices=si,
|
|
||||||
spec_query_len=SQ,
|
|
||||||
out=out,
|
|
||||||
)
|
|
||||||
return o, replay
|
|
||||||
|
|
||||||
q, k, v = (
|
|
||||||
x.contiguous().view(1, T, -1, d)
|
|
||||||
for x, d in zip(torch.split(mixed, [qd, qd, vd], dim=-1), (K, K, V))
|
|
||||||
)
|
|
||||||
want_out, want_replay = run(q, k, v)
|
|
||||||
core = torch.zeros(T + 2, HV, V, device="cuda", dtype=torch.bfloat16)
|
|
||||||
views = (
|
|
||||||
mixed[:, :qd].view(1, T, -1, K),
|
|
||||||
mixed[:, qd : 2 * qd].view(1, T, -1, K),
|
|
||||||
mixed[:, 2 * qd :].view(1, T, -1, V),
|
|
||||||
)
|
|
||||||
_, got_replay = run(*views, out=core[:T].unsqueeze(0))
|
|
||||||
assert torch.equal(core[:T].unsqueeze(0), want_out)
|
|
||||||
assert torch.equal(got_replay, want_replay)
|
|
||||||
|
|
||||||
|
|
||||||
def test_layer_verify_qkv_views_and_fallback():
|
|
||||||
"""The layer's guard: views for a [tokens, q|k|v] conv output with a contiguous
|
|
||||||
last dimension, the contiguous-copy fallback for any other layout; same values
|
|
||||||
either way."""
|
|
||||||
from types import SimpleNamespace
|
|
||||||
|
|
||||||
from vllm.model_executor.layers.mamba.gdn.qwen_gdn_linear_attn import (
|
|
||||||
QwenGatedDeltaNetAttention as Layer,
|
|
||||||
)
|
|
||||||
|
|
||||||
H, HV, K, V, T = 4, 8, 16, 16, 5
|
|
||||||
layer = SimpleNamespace(
|
|
||||||
key_dim=H * K, value_dim=HV * V, tp_size=1, head_k_dim=K, head_v_dim=V
|
|
||||||
)
|
|
||||||
layer.rearrange_mixed_qkv = lambda x: Layer.rearrange_mixed_qkv(cast(Any, layer), x)
|
|
||||||
width = 2 * H * K + HV * V
|
|
||||||
packed = torch.randn(T, width + HV * V, dtype=torch.bfloat16) # q|k|v|z, like qkvz
|
|
||||||
strided = packed[:, :width]
|
|
||||||
q, k, v, is_view = Layer._recoverssm_verify_qkv(cast(Any, layer), strided)
|
|
||||||
assert is_view
|
|
||||||
assert q.data_ptr() == packed.data_ptr()
|
|
||||||
rq, rk, rv = Layer.rearrange_mixed_qkv(cast(Any, layer), strided)
|
|
||||||
assert torch.equal(q, rq) and torch.equal(k, rk) and torch.equal(v, rv)
|
|
||||||
|
|
||||||
# Column-major storage: last dimension not contiguous -> copies, same values.
|
|
||||||
col_major = strided.t().contiguous().t()
|
|
||||||
assert col_major.stride(-1) != 1
|
|
||||||
q2, k2, v2, is_view2 = Layer._recoverssm_verify_qkv(cast(Any, layer), col_major)
|
|
||||||
assert not is_view2
|
|
||||||
assert torch.equal(q2, rq) and torch.equal(k2, rk) and torch.equal(v2, rv)
|
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------------------------------------- BF16 recurrent state
|
|
||||||
# RecoverSSM upcasts the BF16 checkpoint, carries the accepted window in FP32 and rounds
|
|
||||||
# once when it writes the committed state. The reference is the FP32 trajectory from the
|
|
||||||
# same (already BF16-rounded) checkpoint; the committed state must equal its BF16
|
|
||||||
# rounding up to one BF16 ulp, and be no further from it than the native path is.
|
|
||||||
BF16_ULP = 2**-7
|
|
||||||
|
|
||||||
|
|
||||||
def _bf16_case(qlens, nb=12, seed=0):
|
|
||||||
inp = _make(qlens, nb=nb, seed=seed)
|
|
||||||
inp["checkpoint_state"] = inp["checkpoint_state"].bfloat16()
|
|
||||||
ref = dict(inp)
|
|
||||||
ref["checkpoint_state"] = inp["checkpoint_state"].float()
|
|
||||||
return inp, ref
|
|
||||||
|
|
||||||
|
|
||||||
def test_verify_bf16_state_matches_native():
|
|
||||||
inp, _ = _bf16_case(list(QLENS))
|
|
||||||
inp["state_indices"] = torch.tensor([2, 5, 7], dtype=torch.int32, device="cuda")
|
|
||||||
before = inp["checkpoint_state"].clone()
|
|
||||||
out = _verify(inp)
|
|
||||||
ref, _ = _native(inp)
|
|
||||||
torch.testing.assert_close(
|
|
||||||
out.float(), ref.reshape(out.shape).float(), rtol=0, atol=0
|
|
||||||
)
|
|
||||||
assert torch.equal(inp["checkpoint_state"], before)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("accepted", [1, 2, 3, 4])
|
|
||||||
@pytest.mark.parametrize("seed", [0, 1])
|
|
||||||
def test_commit_bf16_state_rounds_once(accepted, seed):
|
|
||||||
inp, ref_inp = _bf16_case(list(QLENS), seed=seed)
|
|
||||||
idx = torch.tensor([2, 5, 7], dtype=torch.int32, device="cuda")
|
|
||||||
inp["state_indices"] = ref_inp["state_indices"] = idx
|
|
||||||
_verify(inp)
|
|
||||||
_, native_states = _native(inp)
|
|
||||||
_, ref_states = _native(ref_inp)
|
|
||||||
ckpt = inp["checkpoint_state"].clone()
|
|
||||||
_context(inp, ckpt).commit(
|
|
||||||
torch.tensor(
|
|
||||||
[min(accepted, q) for q in QLENS], dtype=torch.int32, device="cuda"
|
|
||||||
),
|
|
||||||
idx,
|
|
||||||
inp["query_start_loc"],
|
|
||||||
)
|
|
||||||
for i, blk in enumerate(idx.tolist()):
|
|
||||||
tok = int(inp["query_start_loc"][i]) + min(accepted, QLENS[i]) - 1
|
|
||||||
ref = ref_states[tok].float()
|
|
||||||
got = ckpt[blk].float()
|
|
||||||
torch.testing.assert_close(
|
|
||||||
got, ref.bfloat16().float(), rtol=BF16_ULP, atol=1e-5
|
|
||||||
)
|
|
||||||
err_rssm = (got - ref).abs().mean()
|
|
||||||
err_native = (native_states[tok].bfloat16().float() - ref).abs().mean()
|
|
||||||
assert err_rssm <= err_native * 1.05 + 1e-7, (err_rssm, err_native)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("nc,accepted,bs", ALIGN_CASES)
|
|
||||||
def test_align_boundary_bf16_state(nc, accepted, bs):
|
|
||||||
inp, ref_inp = _bf16_case([T])
|
|
||||||
bt = torch.arange(2, 8, dtype=torch.int32, device="cuda").reshape(1, 6)
|
|
||||||
src = bt[0, nc // bs].reshape(1).contiguous()
|
|
||||||
inp["state_indices"] = ref_inp["state_indices"] = src
|
|
||||||
_verify(inp)
|
|
||||||
_, ref_states = _native(ref_inp)
|
|
||||||
ckpt = inp["checkpoint_state"].clone()
|
|
||||||
_context(inp, ckpt).commit(
|
|
||||||
torch.tensor([accepted], dtype=torch.int32, device="cuda"),
|
|
||||||
src,
|
|
||||||
inp["query_start_loc"],
|
|
||||||
block_table=bt,
|
|
||||||
num_computed_tokens=torch.tensor([nc], dtype=torch.int32, device="cuda"),
|
|
||||||
mamba_block_size=bs,
|
|
||||||
)
|
|
||||||
next_boundary = (nc // bs + 1) * bs
|
|
||||||
final_blk = int(bt[0, max(nc + accepted - 1, 0) // bs])
|
|
||||||
if nc + accepted >= next_boundary:
|
|
||||||
torch.testing.assert_close(
|
|
||||||
ckpt[int(src)].float(),
|
|
||||||
ref_states[next_boundary - nc - 1].float().bfloat16().float(),
|
|
||||||
rtol=BF16_ULP,
|
|
||||||
atol=1e-5,
|
|
||||||
)
|
|
||||||
torch.testing.assert_close(
|
|
||||||
ckpt[final_blk].float(),
|
|
||||||
ref_states[accepted - 1].float().bfloat16().float(),
|
|
||||||
rtol=BF16_ULP,
|
|
||||||
atol=1e-5,
|
|
||||||
)
|
|
||||||
@@ -1,153 +0,0 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
||||||
"""PLE short-conv RecoverSSM against the sequential reference.
|
|
||||||
|
|
||||||
Reference: the stock decode path fed the accepted tokens one at a time.
|
|
||||||
RecoverSSM: one spec-mode conv over the whole window from the checkpoint
|
|
||||||
(offset 0), then ``_PleConvCommit`` compacts the accepted suffix to the front.
|
|
||||||
The conv history is pure data movement, so the states must be bit-identical,
|
|
||||||
and the outputs of the accepted tokens must match as well.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
import torch
|
|
||||||
|
|
||||||
from vllm.model_executor.layers.mamba.mamba_utils import is_conv_state_dim_first
|
|
||||||
from vllm.models.qwen4_exp.nvidia.ops.ple import ple_conv
|
|
||||||
from vllm.v1.attention.backends.ple_recoverssm import _PleConvCommit
|
|
||||||
|
|
||||||
C, KSIZE, DIL, SQ, NB = 512, 4, 3, 4, 8
|
|
||||||
STATE_LEN = (KSIZE - 1) * DIL
|
|
||||||
WIDTH = STATE_LEN + SQ - 1
|
|
||||||
DEV = "cuda"
|
|
||||||
|
|
||||||
|
|
||||||
def _state():
|
|
||||||
if is_conv_state_dim_first():
|
|
||||||
raw = torch.zeros(NB, C, WIDTH, dtype=torch.bfloat16, device=DEV)
|
|
||||||
return raw, raw
|
|
||||||
raw = torch.zeros(NB, WIDTH, C, dtype=torch.bfloat16, device=DEV)
|
|
||||||
return raw, raw.transpose(-1, -2)
|
|
||||||
|
|
||||||
|
|
||||||
def _i32(xs):
|
|
||||||
return torch.tensor(xs, dtype=torch.int32, device=DEV)
|
|
||||||
|
|
||||||
|
|
||||||
def _setup(seed, blocks):
|
|
||||||
g = torch.Generator(device=DEV).manual_seed(seed)
|
|
||||||
w = torch.randn(C, KSIZE, generator=g, device=DEV).to(torch.bfloat16)
|
|
||||||
x = torch.randn(len(blocks) * SQ, C, generator=g, device=DEV).to(torch.bfloat16)
|
|
||||||
outer = torch.randn_like(x)
|
|
||||||
raw, view = _state()
|
|
||||||
for b in blocks:
|
|
||||||
view[b, :, :STATE_LEN] = torch.randn(C, STATE_LEN, generator=g, device=DEV).to(
|
|
||||||
torch.bfloat16
|
|
||||||
)
|
|
||||||
return w, x, outer, raw, view
|
|
||||||
|
|
||||||
|
|
||||||
def _sequential(w, x, outer, view, block, first, count):
|
|
||||||
"""Stock decode, one token at a time, on a copy of the checkpoint block."""
|
|
||||||
ref = view.clone()
|
|
||||||
res = torch.zeros(count, C, dtype=torch.bfloat16, device=DEV)
|
|
||||||
for i in range(count):
|
|
||||||
t = first + i
|
|
||||||
ple_conv(
|
|
||||||
inputs=x[t : t + 1],
|
|
||||||
residual=res[i : i + 1],
|
|
||||||
conv_state=ref,
|
|
||||||
conv_weights=w,
|
|
||||||
state_indices=_i32([block]),
|
|
||||||
outer_residual=outer[t : t + 1],
|
|
||||||
mode="decode",
|
|
||||||
dilation=DIL,
|
|
||||||
)
|
|
||||||
return ref[block, :, :STATE_LEN].clone(), res
|
|
||||||
|
|
||||||
|
|
||||||
def _spec(w, x, outer, view, blocks):
|
|
||||||
res = torch.zeros(len(blocks) * SQ, C, dtype=torch.bfloat16, device=DEV)
|
|
||||||
ple_conv(
|
|
||||||
inputs=x,
|
|
||||||
residual=res,
|
|
||||||
conv_state=view,
|
|
||||||
conv_weights=w,
|
|
||||||
state_indices=_i32(blocks),
|
|
||||||
outer_residual=outer,
|
|
||||||
mode="spec",
|
|
||||||
dilation=DIL,
|
|
||||||
query_start_loc=_i32(list(range(0, len(blocks) * SQ + 1, SQ))),
|
|
||||||
num_accepted_tokens=_i32([1] * len(blocks)),
|
|
||||||
spec_query_len=SQ,
|
|
||||||
)
|
|
||||||
return res
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("accepted", [1, 2, SQ])
|
|
||||||
@pytest.mark.parametrize("seed", [0, 1])
|
|
||||||
def test_ple_commit_matches_sequential(accepted, seed):
|
|
||||||
block = 3
|
|
||||||
w, x, outer, raw, view = _setup(seed, [block])
|
|
||||||
want_state, want_out = _sequential(w, x, outer, view, block, 0, accepted)
|
|
||||||
history = torch.cat([view[block, :, :STATE_LEN], x[:accepted].T], dim=1)
|
|
||||||
|
|
||||||
got_out = _spec(w, x, outer, view, [block])
|
|
||||||
ctx = _PleConvCommit([raw], spec_query_len=SQ, max_num_reqs=NB)
|
|
||||||
ctx.commit(_i32([accepted]), _i32([block]), _i32([0, SQ]))
|
|
||||||
|
|
||||||
got_state = view[block, :, :STATE_LEN]
|
|
||||||
assert torch.equal(got_state, want_state)
|
|
||||||
assert torch.equal(got_state, history[:, -STATE_LEN:])
|
|
||||||
assert torch.equal(got_out[:accepted], want_out)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
("num_computed", "accepted", "crosses"),
|
|
||||||
[(6, 3, True), (6, 2, True), (1, 2, False), (7, SQ, True)],
|
|
||||||
)
|
|
||||||
def test_ple_commit_align_boundary(num_computed, accepted, crosses):
|
|
||||||
block_size, src, nxt = 8, 2, 5
|
|
||||||
w, x, outer, raw, view = _setup(7, [src])
|
|
||||||
boundary_len = block_size - num_computed
|
|
||||||
want_final, _ = _sequential(w, x, outer, view, src, 0, accepted)
|
|
||||||
want_boundary, _ = _sequential(w, x, outer, view, src, 0, min(boundary_len, SQ))
|
|
||||||
|
|
||||||
_spec(w, x, outer, view, [src])
|
|
||||||
ctx = _PleConvCommit([raw], spec_query_len=SQ, max_num_reqs=NB)
|
|
||||||
ctx.commit(
|
|
||||||
_i32([accepted]),
|
|
||||||
_i32([src]),
|
|
||||||
_i32([0, SQ]),
|
|
||||||
block_table=_i32([[src, nxt]]),
|
|
||||||
num_computed_tokens=_i32([num_computed]),
|
|
||||||
mamba_block_size=block_size,
|
|
||||||
)
|
|
||||||
|
|
||||||
final_block = nxt if num_computed + accepted > block_size else src
|
|
||||||
assert torch.equal(view[final_block, :, :STATE_LEN], want_final)
|
|
||||||
if crosses:
|
|
||||||
assert torch.equal(view[src, :, :STATE_LEN], want_boundary)
|
|
||||||
|
|
||||||
|
|
||||||
def test_ple_commit_non_contiguous_request_rows():
|
|
||||||
blocks, accepted = [1, 6], [3, 1]
|
|
||||||
w, x, outer, raw, view = _setup(11, blocks)
|
|
||||||
want = [
|
|
||||||
_sequential(w, x, outer, view, b, i * SQ, a)[0]
|
|
||||||
for i, (b, a) in enumerate(zip(blocks, accepted))
|
|
||||||
]
|
|
||||||
|
|
||||||
_spec(w, x, outer, view, blocks)
|
|
||||||
# Spec rows 0 and 1 belong to requests 1 and 3 of a four-request batch.
|
|
||||||
counts = _i32([9, accepted[0], 9, accepted[1]])
|
|
||||||
ctx = _PleConvCommit([raw], spec_query_len=SQ, max_num_reqs=NB)
|
|
||||||
ctx.commit(
|
|
||||||
counts,
|
|
||||||
_i32(blocks),
|
|
||||||
_i32([0, SQ, 2 * SQ]),
|
|
||||||
request_indices=_i32([1, 3]),
|
|
||||||
)
|
|
||||||
|
|
||||||
for b, ref in zip(blocks, want):
|
|
||||||
assert torch.equal(view[b, :, :STATE_LEN], ref)
|
|
||||||
@@ -2,13 +2,8 @@
|
|||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import torch
|
|
||||||
import torch.nn as nn
|
|
||||||
|
|
||||||
from vllm.model_executor.offloader.prefetch import (
|
from vllm.model_executor.offloader.prefetch import _get_next_prefetch_index
|
||||||
_get_next_prefetch_index,
|
|
||||||
_TowerUnitStreamer,
|
|
||||||
)
|
|
||||||
|
|
||||||
pytestmark = pytest.mark.skip_global_cleanup
|
pytestmark = pytest.mark.skip_global_cleanup
|
||||||
|
|
||||||
@@ -40,61 +35,3 @@ def test_next_prefetch_index_preserves_slot_ownership(
|
|||||||
target % prefetch_step == index % prefetch_step
|
target % prefetch_step == index % prefetch_step
|
||||||
for index, target in enumerate(targets)
|
for index, target in enumerate(targets)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_tower_unit_streamer_roundtrip_cpu(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
||||||
"""Host-resident weights must compute identically to resident weights,
|
|
||||||
and be back on host storage after each forward."""
|
|
||||||
monkeypatch.setattr(torch.cuda, "is_current_stream_capturing", lambda: False)
|
|
||||||
|
|
||||||
lin = nn.Linear(4, 4, bias=False)
|
|
||||||
weight = lin.weight.detach().clone()
|
|
||||||
|
|
||||||
streamer = _TowerUnitStreamer(lin, ["weight"], torch.device("cpu"))
|
|
||||||
streamer.offload_to_host_now()
|
|
||||||
assert lin.weight.device.type == "cpu"
|
|
||||||
|
|
||||||
streamer.sync_storage()
|
|
||||||
assert streamer.offloaded_bytes == weight.numel() * weight.element_size()
|
|
||||||
|
|
||||||
streamer.hook_forward()
|
|
||||||
x = torch.randn(2, 4)
|
|
||||||
out = lin(x)
|
|
||||||
assert torch.allclose(out, x @ weight.T)
|
|
||||||
# Weights released back to host after the forward.
|
|
||||||
assert lin.weight.device.type == "cpu"
|
|
||||||
|
|
||||||
# Re-running post_init-style hooking must not double-wrap the forward.
|
|
||||||
streamer.hook_forward()
|
|
||||||
assert torch.allclose(lin(x), out)
|
|
||||||
|
|
||||||
|
|
||||||
def test_offload_config_tower_only_prefetch_is_valid() -> None:
|
|
||||||
from vllm.config.offload import OffloadConfig, PrefetchOffloadConfig
|
|
||||||
|
|
||||||
cfg = OffloadConfig(
|
|
||||||
offload_backend="prefetch",
|
|
||||||
prefetch=PrefetchOffloadConfig(offload_towers=True),
|
|
||||||
)
|
|
||||||
assert cfg.prefetch.offload_towers
|
|
||||||
assert cfg.prefetch.offload_group_size == 0
|
|
||||||
|
|
||||||
|
|
||||||
def test_offload_config_prefetch_requires_layers_or_towers() -> None:
|
|
||||||
from vllm.config.offload import OffloadConfig
|
|
||||||
|
|
||||||
with pytest.raises(ValueError):
|
|
||||||
OffloadConfig(offload_backend="prefetch")
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(not torch.cuda.is_available(), reason="needs CUDA")
|
|
||||||
def test_create_offloader_selects_prefetch_for_towers() -> None:
|
|
||||||
from vllm.config.offload import OffloadConfig, PrefetchOffloadConfig
|
|
||||||
from vllm.model_executor.offloader.base import create_offloader
|
|
||||||
from vllm.model_executor.offloader.prefetch import PrefetchOffloader
|
|
||||||
|
|
||||||
offloader = create_offloader(
|
|
||||||
OffloadConfig(prefetch=PrefetchOffloadConfig(offload_towers=True))
|
|
||||||
)
|
|
||||||
assert isinstance(offloader, PrefetchOffloader)
|
|
||||||
assert offloader.supports_tower_offload
|
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||||
|
|
||||||
from types import SimpleNamespace
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
import vllm.model_executor.warmup.qwen_triton_warmup as qwen_triton_warmup_module
|
|
||||||
from vllm.model_executor.warmup.qwen_triton_warmup import (
|
from vllm.model_executor.warmup.qwen_triton_warmup import (
|
||||||
_FLA_POST_CONV_WARMUP_LENGTHS,
|
_FLA_POST_CONV_WARMUP_LENGTHS,
|
||||||
_QwenGDNWarmupConfig,
|
_QwenGDNWarmupConfig,
|
||||||
@@ -56,57 +53,3 @@ def test_qwen_gdn_prefill_warmup_kernels_compile_on_gpu() -> None:
|
|||||||
_warm_fused_post_conv_kernel(device, config)
|
_warm_fused_post_conv_kernel(device, config)
|
||||||
assert _FLA_POST_CONV_WARMUP_LENGTHS == (1, 2, 16)
|
assert _FLA_POST_CONV_WARMUP_LENGTHS == (1, 2, 16)
|
||||||
torch.accelerator.synchronize(device)
|
torch.accelerator.synchronize(device)
|
||||||
|
|
||||||
|
|
||||||
def _warmup_runner() -> SimpleNamespace:
|
|
||||||
return SimpleNamespace(
|
|
||||||
device=torch.device("cpu"),
|
|
||||||
compilation_config=SimpleNamespace(static_forward_context={}),
|
|
||||||
max_num_tokens=1,
|
|
||||||
is_pooling_model=False,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def _warmup_model_config(model_type: str) -> SimpleNamespace:
|
|
||||||
return SimpleNamespace(
|
|
||||||
hf_text_config=SimpleNamespace(model_type=model_type),
|
|
||||||
hf_config=SimpleNamespace(model_type=model_type),
|
|
||||||
dtype=torch.bfloat16,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
("model_type", "dispatched"),
|
|
||||||
[
|
|
||||||
("qwen4_exp", True),
|
|
||||||
("qwen4_exp_text", True),
|
|
||||||
("qwen3_next", True),
|
|
||||||
# The drafter never reaches this warmup: the worker passes its own
|
|
||||||
# model_config, which is the target's.
|
|
||||||
("qwen4_exp_mtp", False),
|
|
||||||
("llama", False),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
def test_qwen_triton_warmup_dispatch_gate(
|
|
||||||
monkeypatch: pytest.MonkeyPatch,
|
|
||||||
model_type: str,
|
|
||||||
dispatched: bool,
|
|
||||||
) -> None:
|
|
||||||
"""Which model types reach the Qwen Triton warmup at all.
|
|
||||||
|
|
||||||
Stops at the gate: the kernels themselves need a GPU and are covered by the
|
|
||||||
CUDA test above.
|
|
||||||
"""
|
|
||||||
reached: list[object] = []
|
|
||||||
|
|
||||||
def _record(static_forward_context: object) -> None:
|
|
||||||
reached.append(static_forward_context)
|
|
||||||
return None
|
|
||||||
|
|
||||||
monkeypatch.setattr(qwen_triton_warmup_module, "_qwen_gdn_warmup_config", _record)
|
|
||||||
|
|
||||||
qwen_triton_warmup_module.qwen_triton_warmup(
|
|
||||||
_warmup_runner(), _warmup_model_config(model_type)
|
|
||||||
)
|
|
||||||
|
|
||||||
assert bool(reached) is dispatched
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ def test_kda_recurrent_state_dtype_follows_ssm_cache_dtype(ssm_dtype, expected):
|
|||||||
cache_config = SimpleNamespace(
|
cache_config = SimpleNamespace(
|
||||||
mamba_cache_dtype="auto",
|
mamba_cache_dtype="auto",
|
||||||
mamba_ssm_cache_dtype=ssm_dtype,
|
mamba_ssm_cache_dtype=ssm_dtype,
|
||||||
use_recoverssm=False,
|
use_kda_recoverssm=False,
|
||||||
)
|
)
|
||||||
vllm_config = SimpleNamespace(model_config=model_config, cache_config=cache_config)
|
vllm_config = SimpleNamespace(model_config=model_config, cache_config=cache_config)
|
||||||
want = (torch.bfloat16, expected)
|
want = (torch.bfloat16, expected)
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ def test_kda_recoverssm_config_state_layout():
|
|||||||
cache_config=SimpleNamespace(
|
cache_config=SimpleNamespace(
|
||||||
mamba_cache_dtype="auto",
|
mamba_cache_dtype="auto",
|
||||||
mamba_ssm_cache_dtype="auto",
|
mamba_ssm_cache_dtype="auto",
|
||||||
use_recoverssm=True,
|
use_kda_recoverssm=True,
|
||||||
),
|
),
|
||||||
parallel_config=SimpleNamespace(tensor_parallel_size=1),
|
parallel_config=SimpleNamespace(tensor_parallel_size=1),
|
||||||
speculative_config=SimpleNamespace(num_speculative_tokens=2),
|
speculative_config=SimpleNamespace(num_speculative_tokens=2),
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ def _make_builder(
|
|||||||
)
|
)
|
||||||
vllm_config.cache_config.mamba_cache_mode = mamba_cache_mode
|
vllm_config.cache_config.mamba_cache_mode = mamba_cache_mode
|
||||||
vllm_config.cache_config.use_replayssm = use_recoverssm
|
vllm_config.cache_config.use_replayssm = use_recoverssm
|
||||||
vllm_config.cache_config.use_recoverssm = use_recoverssm
|
vllm_config.cache_config.use_kda_recoverssm = use_recoverssm
|
||||||
vllm_config.cache_config.prefix_match_unit = prefix_match_unit
|
vllm_config.cache_config.prefix_match_unit = prefix_match_unit
|
||||||
hash_block_size = hash_block_size or prefix_match_unit or mamba_block_size
|
hash_block_size = hash_block_size or prefix_match_unit or mamba_block_size
|
||||||
vllm_config.cache_config.hash_block_size = hash_block_size
|
vllm_config.cache_config.hash_block_size = hash_block_size
|
||||||
@@ -169,7 +169,7 @@ def test_kda_recoverssm_startup_metadata_flow_without_model(monkeypatch):
|
|||||||
cache_config=SimpleNamespace(
|
cache_config=SimpleNamespace(
|
||||||
mamba_cache_dtype="auto",
|
mamba_cache_dtype="auto",
|
||||||
mamba_ssm_cache_dtype="auto",
|
mamba_ssm_cache_dtype="auto",
|
||||||
use_recoverssm=True,
|
use_kda_recoverssm=True,
|
||||||
),
|
),
|
||||||
parallel_config=SimpleNamespace(tensor_parallel_size=1),
|
parallel_config=SimpleNamespace(tensor_parallel_size=1),
|
||||||
speculative_config=SimpleNamespace(num_speculative_tokens=2),
|
speculative_config=SimpleNamespace(num_speculative_tokens=2),
|
||||||
@@ -203,7 +203,7 @@ def test_kda_recoverssm_startup_metadata_flow_without_model(monkeypatch):
|
|||||||
),
|
),
|
||||||
cache_config=SimpleNamespace(
|
cache_config=SimpleNamespace(
|
||||||
mamba_cache_mode="align",
|
mamba_cache_mode="align",
|
||||||
use_recoverssm=True,
|
use_kda_recoverssm=True,
|
||||||
prefix_match_unit=None,
|
prefix_match_unit=None,
|
||||||
),
|
),
|
||||||
parallel_config=SimpleNamespace(decode_context_parallel_size=1),
|
parallel_config=SimpleNamespace(decode_context_parallel_size=1),
|
||||||
|
|||||||
@@ -1,129 +0,0 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
||||||
"""Align-mode RecoverSSM state columns at recurrent block boundaries.
|
|
||||||
|
|
||||||
A speculative window whose accepted tokens end exactly on a recurrent block
|
|
||||||
boundary must keep its state in the block holding the last committed token.
|
|
||||||
The following block can still be unallocated, so selecting it would drop the
|
|
||||||
commit while the bookkeeping recorded the state as advanced.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
import torch
|
|
||||||
|
|
||||||
from vllm.models.kimi_k3.nvidia.ops.recoverssm import _prepare_commit_plan_kernel
|
|
||||||
from vllm.platforms import current_platform
|
|
||||||
from vllm.v1.attention.backends.utils import NULL_BLOCK_ID
|
|
||||||
from vllm.v1.worker.gpu.model_states.recoverssm import (
|
|
||||||
_postprocess_recoverssm_align_kernel,
|
|
||||||
)
|
|
||||||
|
|
||||||
pytestmark = pytest.mark.skipif(
|
|
||||||
not current_platform.is_cuda_alike(),
|
|
||||||
reason="The RecoverSSM kernels require a CUDA-alike device.",
|
|
||||||
)
|
|
||||||
|
|
||||||
BLOCK_SIZE = 2048
|
|
||||||
SPEC_QUERY_LEN = 4
|
|
||||||
BLOCKS = [100, 101, 102, 103, 104, 105]
|
|
||||||
|
|
||||||
# (computed before the step, committed tokens, allocated block columns,
|
|
||||||
# final column, boundary column or None)
|
|
||||||
CASES = [
|
|
||||||
# 8,188 + 4 ends exactly on the 8,192 boundary; column 4 is unallocated.
|
|
||||||
(8188, 4, 4, 3, 3),
|
|
||||||
# The window crosses the boundary: state moves on, checkpoint stays behind.
|
|
||||||
(8190, 4, 5, 4, 3),
|
|
||||||
# The window stays inside column 3.
|
|
||||||
(8180, 4, 4, 3, None),
|
|
||||||
# The first token after a boundary belongs to the new column.
|
|
||||||
(8192, 1, 5, 4, None),
|
|
||||||
# Single-token commit ending on the first boundary.
|
|
||||||
(2047, 1, 1, 0, 0),
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
"num_computed,commit_len,allocated,final_col,boundary_col", CASES
|
|
||||||
)
|
|
||||||
def test_commit_plan_keeps_boundary_state_in_last_computed_block(
|
|
||||||
num_computed, commit_len, allocated, final_col, boundary_col
|
|
||||||
):
|
|
||||||
device = current_platform.device_type
|
|
||||||
columns = [
|
|
||||||
block if col < allocated else NULL_BLOCK_ID for col, block in enumerate(BLOCKS)
|
|
||||||
]
|
|
||||||
block_table = torch.tensor([columns], dtype=torch.int32, device=device)
|
|
||||||
num_accepted = torch.tensor([commit_len], dtype=torch.int32, device=device)
|
|
||||||
state_indices = torch.tensor(
|
|
||||||
[BLOCKS[(num_computed - 1) // BLOCK_SIZE]], dtype=torch.int32, device=device
|
|
||||||
)
|
|
||||||
query_start_loc = torch.tensor(
|
|
||||||
[0, SPEC_QUERY_LEN], dtype=torch.int32, device=device
|
|
||||||
)
|
|
||||||
computed = torch.tensor([num_computed], dtype=torch.int32, device=device)
|
|
||||||
commit_lens, final_indices, boundary_indices, recovery_lens = (
|
|
||||||
torch.full((1,), -7, dtype=torch.int32, device=device) for _ in range(4)
|
|
||||||
)
|
|
||||||
|
|
||||||
_prepare_commit_plan_kernel[(1,)](
|
|
||||||
num_accepted,
|
|
||||||
None,
|
|
||||||
state_indices,
|
|
||||||
query_start_loc,
|
|
||||||
block_table,
|
|
||||||
computed,
|
|
||||||
commit_lens,
|
|
||||||
final_indices,
|
|
||||||
boundary_indices,
|
|
||||||
recovery_lens,
|
|
||||||
NULL_BLOCK_ID,
|
|
||||||
BLOCK_SIZE,
|
|
||||||
block_table.shape[1],
|
|
||||||
num_accepted.stride(0),
|
|
||||||
0,
|
|
||||||
state_indices.stride(0),
|
|
||||||
query_start_loc.stride(0),
|
|
||||||
block_table.stride(0),
|
|
||||||
block_table.stride(1),
|
|
||||||
computed.stride(0),
|
|
||||||
SPEC_QUERY_LEN=SPEC_QUERY_LEN,
|
|
||||||
num_warps=1,
|
|
||||||
)
|
|
||||||
|
|
||||||
assert commit_lens.item() == commit_len
|
|
||||||
assert final_indices.item() == BLOCKS[final_col]
|
|
||||||
expected_boundary = NULL_BLOCK_ID if boundary_col is None else BLOCKS[boundary_col]
|
|
||||||
assert boundary_indices.item() == expected_boundary
|
|
||||||
if boundary_col is not None:
|
|
||||||
next_boundary = (num_computed // BLOCK_SIZE + 1) * BLOCK_SIZE
|
|
||||||
assert recovery_lens.item() == next_boundary - num_computed
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
"num_computed,commit_len,allocated,final_col,boundary_col", CASES
|
|
||||||
)
|
|
||||||
def test_postprocess_records_the_committed_state_column(
|
|
||||||
num_computed, commit_len, allocated, final_col, boundary_col
|
|
||||||
):
|
|
||||||
device = current_platform.device_type
|
|
||||||
idx_mapping = torch.tensor([2], dtype=torch.int32, device=device)
|
|
||||||
num_sampled = torch.tensor([commit_len], dtype=torch.int32, device=device)
|
|
||||||
computed = torch.tensor([num_computed], dtype=torch.int32, device=device)
|
|
||||||
state_idx = torch.full((4,), -7, dtype=torch.int32, device=device)
|
|
||||||
num_accepted = torch.full((4,), -7, dtype=torch.int32, device=device)
|
|
||||||
|
|
||||||
_postprocess_recoverssm_align_kernel[(1,)](
|
|
||||||
idx_mapping,
|
|
||||||
num_sampled,
|
|
||||||
None,
|
|
||||||
computed,
|
|
||||||
state_idx,
|
|
||||||
num_accepted,
|
|
||||||
MAMBA_BLOCK_SIZE=BLOCK_SIZE,
|
|
||||||
BLOCK_TABLE_WIDTH=len(BLOCKS),
|
|
||||||
)
|
|
||||||
|
|
||||||
assert state_idx[2].item() == final_col
|
|
||||||
assert num_accepted[2].item() == 1
|
|
||||||
assert state_idx[[0, 1, 3]].tolist() == [-7, -7, -7]
|
|
||||||
@@ -39,6 +39,14 @@ RERANK_MODELS = [
|
|||||||
is_prefix_caching_supported=False,
|
is_prefix_caching_supported=False,
|
||||||
is_chunked_prefill_supported=False,
|
is_chunked_prefill_supported=False,
|
||||||
),
|
),
|
||||||
|
# Declares its score template in its Sentence Transformers config, so no
|
||||||
|
# chat template is passed.
|
||||||
|
RerankModelInfo(
|
||||||
|
"nvidia/llama-nemotron-rerank-vl-1b-v2",
|
||||||
|
architecture="LlamaNemotronVLForSequenceClassification",
|
||||||
|
mteb_score=0.33919,
|
||||||
|
mteb_tol=1e-2,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ Both variants share a SigLIP vision encoder with a bidirectional LLaMA backbone.
|
|||||||
|
|
||||||
from collections.abc import Sequence
|
from collections.abc import Sequence
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import pybase64 as base64
|
import pybase64 as base64
|
||||||
import pytest
|
import pytest
|
||||||
@@ -202,13 +201,6 @@ def test_models(
|
|||||||
|
|
||||||
RERANKER_MODELS = ["nvidia/llama-nemotron-rerank-vl-1b-v2"]
|
RERANKER_MODELS = ["nvidia/llama-nemotron-rerank-vl-1b-v2"]
|
||||||
|
|
||||||
# The tokenizer's built-in chat template is not suitable for the Score/Rerank
|
|
||||||
# APIs (it's inherited from the base LLM). We must use the provided override.
|
|
||||||
_RERANKER_SCORE_TEMPLATE = (
|
|
||||||
Path(__file__).parents[4]
|
|
||||||
/ "examples/pooling/score/template/nemotron-vl-rerank.jinja"
|
|
||||||
).read_text()
|
|
||||||
|
|
||||||
RERANKER_TEXT_QUERY = "How is AI improving the intelligence and capabilities of robots?"
|
RERANKER_TEXT_QUERY = "How is AI improving the intelligence and capabilities of robots?"
|
||||||
RERANKER_TEXT_DOCS = [
|
RERANKER_TEXT_DOCS = [
|
||||||
"AI enables robots to perceive, plan, and act autonomously.",
|
"AI enables robots to perceive, plan, and act autonomously.",
|
||||||
@@ -281,7 +273,11 @@ def _run_vllm_reranker(
|
|||||||
dtype: str,
|
dtype: str,
|
||||||
input_cases: Sequence[RerankerCase],
|
input_cases: Sequence[RerankerCase],
|
||||||
) -> list[list[float]]:
|
) -> list[list[float]]:
|
||||||
"""Run all vLLM reranker cases in one model lifecycle."""
|
"""Run all vLLM reranker cases in one model lifecycle.
|
||||||
|
|
||||||
|
The checkpoint declares its score template in its Sentence Transformers
|
||||||
|
config, so no chat template is passed.
|
||||||
|
"""
|
||||||
with vllm_runner(
|
with vllm_runner(
|
||||||
model,
|
model,
|
||||||
runner="pooling",
|
runner="pooling",
|
||||||
@@ -298,11 +294,7 @@ def _run_vllm_reranker(
|
|||||||
if not has_images:
|
if not has_images:
|
||||||
queries = [query] * len(docs)
|
queries = [query] * len(docs)
|
||||||
doc_texts = [doc_text for doc_text, _ in docs]
|
doc_texts = [doc_text for doc_text, _ in docs]
|
||||||
outputs = vllm_model.score(
|
outputs = vllm_model.score(queries, doc_texts)
|
||||||
queries,
|
|
||||||
doc_texts,
|
|
||||||
chat_template=_RERANKER_SCORE_TEMPLATE,
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
query_params = [
|
query_params = [
|
||||||
ScoreMultiModalParam(
|
ScoreMultiModalParam(
|
||||||
@@ -334,11 +326,7 @@ def _run_vllm_reranker(
|
|||||||
)
|
)
|
||||||
doc_params.append(ScoreMultiModalParam(content=content))
|
doc_params.append(ScoreMultiModalParam(content=content))
|
||||||
|
|
||||||
raw_outputs = vllm_model.llm.score(
|
raw_outputs = vllm_model.llm.score(query_params, doc_params)
|
||||||
query_params,
|
|
||||||
doc_params,
|
|
||||||
chat_template=_RERANKER_SCORE_TEMPLATE,
|
|
||||||
)
|
|
||||||
outputs = [output.outputs.score for output in raw_outputs]
|
outputs = [output.outputs.score for output in raw_outputs]
|
||||||
|
|
||||||
scores_per_case.append(outputs)
|
scores_per_case.append(outputs)
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||||
|
|
||||||
import logging
|
|
||||||
from collections.abc import Iterator
|
|
||||||
from contextlib import contextmanager
|
|
||||||
from importlib import import_module
|
from importlib import import_module
|
||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
@@ -18,12 +15,10 @@ from vllm.model_executor.models.config import (
|
|||||||
Qwen3_5ForConditionalGenerationConfig,
|
Qwen3_5ForConditionalGenerationConfig,
|
||||||
Qwen4ExpForConditionalGenerationConfig,
|
Qwen4ExpForConditionalGenerationConfig,
|
||||||
)
|
)
|
||||||
from vllm.models.qwen4_exp.common.mtp import make_mtp_hidden_buffer
|
|
||||||
from vllm.models.qwen4_exp.nvidia.model_state import Qwen4ExpModelState
|
from vllm.models.qwen4_exp.nvidia.model_state import Qwen4ExpModelState
|
||||||
from vllm.v1.worker.gpu.model_states.mamba_hybrid import MambaHybridModelState
|
from vllm.v1.worker.gpu.model_states.mamba_hybrid import MambaHybridModelState
|
||||||
|
|
||||||
from ...utils import spawn_new_process_for_each_test
|
from ...utils import spawn_new_process_for_each_test
|
||||||
from .test_ple import _make_file_gather_embedding
|
|
||||||
|
|
||||||
|
|
||||||
def _text_config(**kwargs) -> Qwen4ExpTextConfig:
|
def _text_config(**kwargs) -> Qwen4ExpTextConfig:
|
||||||
@@ -221,7 +216,6 @@ def test_qwen4_exp_model_state_prepares_ngram_context() -> None:
|
|||||||
model_state.ngram_context = torch.empty((8, 3), dtype=torch.int32)
|
model_state.ngram_context = torch.empty((8, 3), dtype=torch.int32)
|
||||||
model_state.ngram_context_offsets = torch.arange(-3, 0, dtype=torch.int64)
|
model_state.ngram_context_offsets = torch.arange(-3, 0, dtype=torch.int64)
|
||||||
model_state.ple_query_start_loc = torch.empty(9, dtype=torch.int32)
|
model_state.ple_query_start_loc = torch.empty(9, dtype=torch.int32)
|
||||||
model_state.file_gather_modules = []
|
|
||||||
|
|
||||||
input_batch = SimpleNamespace(
|
input_batch = SimpleNamespace(
|
||||||
num_reqs=2,
|
num_reqs=2,
|
||||||
@@ -271,39 +265,6 @@ def test_qwen4_exp_model_state_prepares_ngram_context() -> None:
|
|||||||
assert model_inputs["ngram_context"].data_ptr() == ngram_context.data_ptr()
|
assert model_inputs["ngram_context"].data_ptr() == ngram_context.data_ptr()
|
||||||
|
|
||||||
|
|
||||||
def test_qwen4_exp_model_state_stages_file_gather_rows(monkeypatch, tmp_path) -> None:
|
|
||||||
"""Rows are staged from the same PLE inputs the forward receives."""
|
|
||||||
module, table = _make_file_gather_embedding(monkeypatch, tmp_path, bind=True)
|
|
||||||
model_state = object.__new__(Qwen4ExpModelState)
|
|
||||||
model_state.uses_ngram_embedding = True
|
|
||||||
model_state.ngram_eos_token_id = 0
|
|
||||||
model_state.ngram_context = torch.empty((4, 1), dtype=torch.int32)
|
|
||||||
model_state.ngram_context_offsets = torch.arange(-1, 0, dtype=torch.int64)
|
|
||||||
model_state.ple_query_start_loc = torch.empty(5, dtype=torch.int32)
|
|
||||||
model_state.file_gather_modules = [module]
|
|
||||||
input_batch = SimpleNamespace(
|
|
||||||
num_reqs=2,
|
|
||||||
num_reqs_after_padding=2,
|
|
||||||
idx_mapping=torch.tensor([0, 1]),
|
|
||||||
query_start_loc=torch.tensor([0, 4, 6], dtype=torch.int32),
|
|
||||||
input_ids=torch.tensor([5, 9, 3, 7, 2, 11]),
|
|
||||||
)
|
|
||||||
req_states = SimpleNamespace(
|
|
||||||
num_computed_tokens=SimpleNamespace(gpu=torch.tensor([2, 1])),
|
|
||||||
all_token_ids=SimpleNamespace(gpu=torch.tensor([[1, 8, 6], [4, 3, 3]])),
|
|
||||||
)
|
|
||||||
|
|
||||||
with patch.object(MambaHybridModelState, "prepare_inputs", return_value={}):
|
|
||||||
model_inputs = model_state.prepare_inputs(input_batch, req_states)
|
|
||||||
|
|
||||||
ids = module.compute_ngram_ids(
|
|
||||||
input_batch.input_ids,
|
|
||||||
model_inputs["query_start_loc"],
|
|
||||||
model_inputs["ngram_context"],
|
|
||||||
)
|
|
||||||
assert torch.equal(module.ngram_embedding._staging[:6], table[ids])
|
|
||||||
|
|
||||||
|
|
||||||
def test_qwen4_exp_model_state_prepares_stable_dummy_ngram_inputs() -> None:
|
def test_qwen4_exp_model_state_prepares_stable_dummy_ngram_inputs() -> None:
|
||||||
model_state = object.__new__(Qwen4ExpModelState)
|
model_state = object.__new__(Qwen4ExpModelState)
|
||||||
model_state.uses_ngram_embedding = True
|
model_state.uses_ngram_embedding = True
|
||||||
@@ -326,107 +287,3 @@ def test_qwen4_exp_model_state_prepares_stable_dummy_ngram_inputs() -> None:
|
|||||||
)
|
)
|
||||||
assert second["query_start_loc"].data_ptr() == query_start_loc_ptr
|
assert second["query_start_loc"].data_ptr() == query_start_loc_ptr
|
||||||
assert second["ngram_context"].data_ptr() == ngram_context_ptr
|
assert second["ngram_context"].data_ptr() == ngram_context_ptr
|
||||||
|
|
||||||
|
|
||||||
@contextmanager
|
|
||||||
def _captured_transformers_warnings() -> Iterator[list[str]]:
|
|
||||||
"""Records what transformers logs, without relying on propagation.
|
|
||||||
|
|
||||||
transformers keeps its own logger hierarchy, and the rope validator reaches
|
|
||||||
it through ``warning_once``, so a root-level capture can miss the record
|
|
||||||
entirely.
|
|
||||||
"""
|
|
||||||
records: list[str] = []
|
|
||||||
|
|
||||||
class _Collect(logging.Handler):
|
|
||||||
def emit(self, record: logging.LogRecord) -> None:
|
|
||||||
records.append(record.getMessage())
|
|
||||||
|
|
||||||
handler = _Collect()
|
|
||||||
logger = logging.getLogger("transformers")
|
|
||||||
previous_level = logger.level
|
|
||||||
logger.addHandler(handler)
|
|
||||||
logger.setLevel(logging.WARNING)
|
|
||||||
try:
|
|
||||||
yield records
|
|
||||||
finally:
|
|
||||||
logger.removeHandler(handler)
|
|
||||||
logger.setLevel(previous_level)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("wrapped_config", [False, True])
|
|
||||||
def test_rope_validation_accepts_mrope_keys_and_still_warns_for_unknown_keys(
|
|
||||||
wrapped_config: bool,
|
|
||||||
) -> None:
|
|
||||||
"""M-RoPE is driven through two rope_parameters keys transformers does not
|
|
||||||
know for rope_type="default". Declaring them must not silence the
|
|
||||||
unrecognized-key warning for every other key."""
|
|
||||||
|
|
||||||
def build(rope_parameters: dict) -> None:
|
|
||||||
text_config = _text_config(
|
|
||||||
rope_parameters=dict(rope_parameters), rope_theta=10_000.0
|
|
||||||
)
|
|
||||||
if wrapped_config:
|
|
||||||
Qwen4ExpConfig(
|
|
||||||
architectures=["Qwen4ExpForConditionalGeneration"],
|
|
||||||
text_config=text_config.to_dict(),
|
|
||||||
)
|
|
||||||
|
|
||||||
with _captured_transformers_warnings() as records:
|
|
||||||
build(
|
|
||||||
{
|
|
||||||
"rope_type": "default",
|
|
||||||
"mrope_section": [16, 24, 24],
|
|
||||||
"mrope_interleaved": True,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
assert not [line for line in records if "Unrecognized keys" in line], records
|
|
||||||
|
|
||||||
# warning_once dedupes on the message, so each parametrization needs a key
|
|
||||||
# no earlier run has reported.
|
|
||||||
unknown_key = f"not_a_rope_key_{int(wrapped_config)}"
|
|
||||||
with _captured_transformers_warnings() as records:
|
|
||||||
build({"rope_type": "default", unknown_key: 1})
|
|
||||||
assert [line for line in records if unknown_key in line], records
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("is_last_rank", [True, False])
|
|
||||||
def test_mtp_hidden_buffer_is_allocated_on_the_configured_device(
|
|
||||||
is_last_rank: bool,
|
|
||||||
) -> None:
|
|
||||||
"""The drafter's hidden buffer belongs on the device the config names, not
|
|
||||||
on whichever device happens to be current."""
|
|
||||||
vllm_config = SimpleNamespace(
|
|
||||||
speculative_config=SimpleNamespace(method="mtp"),
|
|
||||||
scheduler_config=SimpleNamespace(max_num_batched_tokens=8),
|
|
||||||
model_config=SimpleNamespace(dtype=torch.bfloat16),
|
|
||||||
# "meta" is never the ambient default, so an implicit allocation lands
|
|
||||||
# somewhere else and this test sees it.
|
|
||||||
device_config=SimpleNamespace(device=torch.device("meta")),
|
|
||||||
)
|
|
||||||
config = SimpleNamespace(hc_count=2, hidden_size=4)
|
|
||||||
|
|
||||||
buffer = make_mtp_hidden_buffer(vllm_config, config, is_last_rank=is_last_rank)
|
|
||||||
|
|
||||||
if not is_last_rank:
|
|
||||||
assert buffer is None
|
|
||||||
return
|
|
||||||
assert buffer is not None
|
|
||||||
assert buffer.device.type == "meta"
|
|
||||||
assert buffer.shape == (8, 8)
|
|
||||||
assert buffer.dtype is torch.bfloat16
|
|
||||||
|
|
||||||
|
|
||||||
def test_mtp_hidden_buffer_is_absent_without_mtp_speculation() -> None:
|
|
||||||
vllm_config = SimpleNamespace(
|
|
||||||
speculative_config=SimpleNamespace(method="eagle"),
|
|
||||||
scheduler_config=SimpleNamespace(max_num_batched_tokens=8),
|
|
||||||
model_config=SimpleNamespace(dtype=torch.bfloat16),
|
|
||||||
device_config=SimpleNamespace(device=torch.device("meta")),
|
|
||||||
)
|
|
||||||
config = SimpleNamespace(hc_count=2, hidden_size=4)
|
|
||||||
|
|
||||||
assert make_mtp_hidden_buffer(vllm_config, config, is_last_rank=True) is None
|
|
||||||
|
|
||||||
vllm_config.speculative_config = None
|
|
||||||
assert make_mtp_hidden_buffer(vllm_config, config, is_last_rank=True) is None
|
|
||||||
|
|||||||
@@ -1,18 +1,14 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||||
|
|
||||||
import mmap
|
import logging
|
||||||
import os
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from functools import partial
|
|
||||||
from itertools import accumulate
|
from itertools import accumulate
|
||||||
from pathlib import Path
|
|
||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import torch
|
import torch
|
||||||
from safetensors import safe_open
|
from compressed_tensors.quantization import QuantizationArgs
|
||||||
from safetensors.torch import load, load_file, save_file
|
|
||||||
from torch import nn
|
from torch import nn
|
||||||
from torch.nn import functional as F
|
from torch.nn import functional as F
|
||||||
from transformers import Qwen4ExpTextConfig
|
from transformers import Qwen4ExpTextConfig
|
||||||
@@ -20,11 +16,14 @@ from transformers import Qwen4ExpTextConfig
|
|||||||
import vllm.model_executor.layers.vocab_parallel_embedding as embedding_module
|
import vllm.model_executor.layers.vocab_parallel_embedding as embedding_module
|
||||||
import vllm.model_executor.parameter as parameter_module
|
import vllm.model_executor.parameter as parameter_module
|
||||||
import vllm.models.qwen4_exp.common.ngram_embedding as ngram_embedding_module
|
import vllm.models.qwen4_exp.common.ngram_embedding as ngram_embedding_module
|
||||||
import vllm.models.qwen4_exp.nvidia.ngram_embedding as nvidia_ngram_embedding_module
|
|
||||||
from tests.v1.attention.utils import BatchSpec, create_common_attn_metadata
|
from tests.v1.attention.utils import BatchSpec, create_common_attn_metadata
|
||||||
from vllm.config import SpeculativeConfig, VllmConfig
|
from vllm.config import SpeculativeConfig, VllmConfig
|
||||||
from vllm.config.compilation import CUDAGraphMode
|
from vllm.config.compilation import CUDAGraphMode
|
||||||
from vllm.config.quantization import QuantizationConfigArgs
|
from vllm.config.quantization import QuantizationConfigArgs
|
||||||
|
from vllm.model_executor.layers.quantization.base_config import QuantizationConfig
|
||||||
|
from vllm.model_executor.layers.quantization.compressed_tensors.compressed_tensors import ( # noqa: E501
|
||||||
|
CompressedTensorsConfig,
|
||||||
|
)
|
||||||
from vllm.model_executor.layers.quantization.fp8 import Fp8Config
|
from vllm.model_executor.layers.quantization.fp8 import Fp8Config
|
||||||
from vllm.model_executor.layers.quantization.inc import INCConfig
|
from vllm.model_executor.layers.quantization.inc import INCConfig
|
||||||
from vllm.model_executor.layers.quantization.modelopt import (
|
from vllm.model_executor.layers.quantization.modelopt import (
|
||||||
@@ -39,14 +38,12 @@ from vllm.models.qwen4_exp.amd.ple_layer import (
|
|||||||
)
|
)
|
||||||
from vllm.models.qwen4_exp.common.ple import (
|
from vllm.models.qwen4_exp.common.ple import (
|
||||||
PLEShardOverlap,
|
PLEShardOverlap,
|
||||||
compute_ple_shard_overlap,
|
PLEVocabParallelEmbedding,
|
||||||
copy_ple_embedding_shard_,
|
|
||||||
)
|
)
|
||||||
from vllm.models.qwen4_exp.nvidia.ngram_embedding import (
|
from vllm.models.qwen4_exp.nvidia.ngram_embedding import (
|
||||||
Qwen4ExpNGramEmbedding,
|
Qwen4ExpNGramEmbedding,
|
||||||
Qwen4ExpPLEDeviceEmbedding,
|
Qwen4ExpPLEDeviceEmbedding,
|
||||||
Qwen4ExpPLEEmbeddingMethod,
|
Qwen4ExpPLEEmbeddingMethod,
|
||||||
Qwen4ExpPLEFileGatherEmbedding,
|
|
||||||
Qwen4ExpPLEFp8EmbeddingMethod,
|
Qwen4ExpPLEFp8EmbeddingMethod,
|
||||||
Qwen4ExpPLENvFp4EmbeddingMethod,
|
Qwen4ExpPLENvFp4EmbeddingMethod,
|
||||||
Qwen4ExpPLEPinnedHostEmbedding,
|
Qwen4ExpPLEPinnedHostEmbedding,
|
||||||
@@ -217,12 +214,23 @@ def _make_ngram_embedding_for_load_test() -> Qwen4ExpNGramEmbedding:
|
|||||||
return module
|
return module
|
||||||
|
|
||||||
|
|
||||||
|
def _make_test_ple_embedding(tp_start: int, tp_end: int) -> PLEVocabParallelEmbedding:
|
||||||
|
"""Create an embedding with only the state needed for shard loading."""
|
||||||
|
embedding = PLEVocabParallelEmbedding.__new__(PLEVocabParallelEmbedding)
|
||||||
|
nn.Module.__init__(embedding)
|
||||||
|
embedding.shard_indices = SimpleNamespace(
|
||||||
|
org_vocab_start_index=tp_start,
|
||||||
|
org_vocab_end_index=tp_end,
|
||||||
|
)
|
||||||
|
return embedding
|
||||||
|
|
||||||
|
|
||||||
def _set_test_embedding_weight_loader(embedding) -> None:
|
def _set_test_embedding_weight_loader(embedding) -> None:
|
||||||
embedding.weight.weight_loader = partial(
|
loader = _make_test_ple_embedding(
|
||||||
copy_ple_embedding_shard_,
|
|
||||||
tp_start=embedding.shard_indices.org_vocab_start_index,
|
tp_start=embedding.shard_indices.org_vocab_start_index,
|
||||||
tp_end=embedding.shard_indices.org_vocab_end_index,
|
tp_end=embedding.shard_indices.org_vocab_end_index,
|
||||||
)
|
)
|
||||||
|
embedding.weight.weight_loader = loader.weight_loader
|
||||||
|
|
||||||
|
|
||||||
def _make_fp8_ngram_embedding_for_load_test() -> Qwen4ExpNGramEmbedding:
|
def _make_fp8_ngram_embedding_for_load_test() -> Qwen4ExpNGramEmbedding:
|
||||||
@@ -251,19 +259,16 @@ def _make_fp8_ngram_embedding_for_load_test() -> Qwen4ExpNGramEmbedding:
|
|||||||
|
|
||||||
|
|
||||||
def test_ple_shard_overlap_and_copy() -> None:
|
def test_ple_shard_overlap_and_copy() -> None:
|
||||||
overlap = compute_ple_shard_overlap(
|
embedding = _make_test_ple_embedding(tp_start=4, tp_end=8)
|
||||||
checkpoint_start=2, checkpoint_rows=5, tp_start=4, tp_end=8
|
overlap = embedding._compute_shard_overlap(checkpoint_start=2, checkpoint_rows=5)
|
||||||
)
|
|
||||||
assert overlap == PLEShardOverlap(source_start=2, destination_start=0, row_count=3)
|
assert overlap == PLEShardOverlap(source_start=2, destination_start=0, row_count=3)
|
||||||
|
|
||||||
destination = torch.full((4, 2), -1.0)
|
destination = torch.full((4, 2), -1.0)
|
||||||
loaded = torch.arange(10, dtype=torch.float64).reshape(5, 2)
|
loaded = torch.arange(10, dtype=torch.float64).reshape(5, 2)
|
||||||
copied = copy_ple_embedding_shard_(
|
copied = embedding._copy_embedding_shard_(
|
||||||
destination,
|
destination,
|
||||||
loaded,
|
loaded,
|
||||||
checkpoint_start=2,
|
checkpoint_start=2,
|
||||||
tp_start=4,
|
|
||||||
tp_end=8,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
assert copied == 3
|
assert copied == 3
|
||||||
@@ -272,13 +277,12 @@ def test_ple_shard_overlap_and_copy() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_ple_shard_copy_is_a_noop_without_overlap() -> None:
|
def test_ple_shard_copy_is_a_noop_without_overlap() -> None:
|
||||||
|
embedding = _make_test_ple_embedding(tp_start=4, tp_end=8)
|
||||||
destination = torch.ones(4, 2)
|
destination = torch.ones(4, 2)
|
||||||
copied = copy_ple_embedding_shard_(
|
copied = embedding._copy_embedding_shard_(
|
||||||
destination,
|
destination,
|
||||||
torch.zeros(2, 2),
|
torch.zeros(2, 2),
|
||||||
checkpoint_start=10,
|
checkpoint_start=10,
|
||||||
tp_start=4,
|
|
||||||
tp_end=8,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
assert copied == 0
|
assert copied == 0
|
||||||
@@ -711,17 +715,44 @@ def test_ple_fp8_embedding_respects_checkpoint_shard_exclusions() -> None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_ple_embedding_rejects_unsupported_quantization_configs() -> None:
|
@pytest.mark.parametrize(
|
||||||
|
"quant_config",
|
||||||
|
[
|
||||||
|
pytest.param(ModelOptNvFp4Config(exclude_modules=[]), id="modelopt-nvfp4"),
|
||||||
|
pytest.param(
|
||||||
|
OnlineQuantizationConfig(QuantizationConfigArgs(linear="fp8_per_tensor")),
|
||||||
|
id="online-fp8",
|
||||||
|
),
|
||||||
|
pytest.param(
|
||||||
|
CompressedTensorsConfig(
|
||||||
|
target_scheme_map={
|
||||||
|
"re:.*ngram_embedding": {
|
||||||
|
"weights": QuantizationArgs(num_bits=8, type="int"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ignore=[],
|
||||||
|
quant_format="int-quantized",
|
||||||
|
),
|
||||||
|
id="compressed-tensors",
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
def test_ple_embedding_falls_back_for_unsupported_quantization_configs(
|
||||||
|
quant_config: QuantizationConfig,
|
||||||
|
caplog: pytest.LogCaptureFixture,
|
||||||
|
monkeypatch: pytest.MonkeyPatch,
|
||||||
|
) -> None:
|
||||||
|
"""Warn when global quantization falls back to an unquantized PLE table."""
|
||||||
prefix = "model.layers.1.ple.ple_embedding.ngram_embedding"
|
prefix = "model.layers.1.ple.ple_embedding.ngram_embedding"
|
||||||
nvfp4_config = ModelOptNvFp4Config(exclude_modules=[])
|
test_logger = logging.getLogger("test.ple_fallback")
|
||||||
with pytest.raises(NotImplementedError, match="ModelOptNvFp4Config"):
|
monkeypatch.setattr(ngram_embedding_module, "logger", test_logger)
|
||||||
Qwen4ExpPLEEmbeddingMethod.from_quant_config(nvfp4_config, prefix)
|
caplog.set_level(logging.WARNING, logger=test_logger.name)
|
||||||
|
assert isinstance(
|
||||||
online_fp8_config = OnlineQuantizationConfig(
|
Qwen4ExpPLEEmbeddingMethod.from_quant_config(quant_config, prefix),
|
||||||
QuantizationConfigArgs(linear="fp8_per_tensor")
|
Qwen4ExpPLEUnquantizedEmbeddingMethod,
|
||||||
)
|
)
|
||||||
with pytest.raises(NotImplementedError, match="OnlineQuantizationConfig"):
|
assert caplog.records[0].levelno == logging.WARNING
|
||||||
Qwen4ExpPLEEmbeddingMethod.from_quant_config(online_fp8_config, prefix)
|
assert "Falling back to unquantized PLE" in caplog.text
|
||||||
|
|
||||||
|
|
||||||
def test_ple_embedding_respects_modelopt_exclusion() -> None:
|
def test_ple_embedding_respects_modelopt_exclusion() -> None:
|
||||||
@@ -748,8 +779,10 @@ def test_ple_embedding_respects_inc_layer_config() -> None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
quant_config.extra_config = None
|
quant_config.extra_config = None
|
||||||
with pytest.raises(NotImplementedError, match="INCConfig"):
|
assert isinstance(
|
||||||
Qwen4ExpPLEEmbeddingMethod.from_quant_config(quant_config, prefix)
|
Qwen4ExpPLEEmbeddingMethod.from_quant_config(quant_config, prefix),
|
||||||
|
Qwen4ExpPLEUnquantizedEmbeddingMethod,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_ple_embedding_is_unquantized_under_quark() -> None:
|
def test_ple_embedding_is_unquantized_under_quark() -> None:
|
||||||
@@ -933,12 +966,10 @@ def test_ple_pinned_embedding_loads_on_cpu_and_looks_up_through_uva(
|
|||||||
loaded_weight = (
|
loaded_weight = (
|
||||||
torch.arange(12, dtype=torch.float32).reshape(4, 3).to(storage_dtype)
|
torch.arange(12, dtype=torch.float32).reshape(4, 3).to(storage_dtype)
|
||||||
)
|
)
|
||||||
copied = copy_ple_embedding_shard_(
|
copied = embedding._copy_embedding_shard_(
|
||||||
embedding.weight,
|
embedding.weight,
|
||||||
loaded_weight,
|
loaded_weight,
|
||||||
checkpoint_start=0,
|
checkpoint_start=0,
|
||||||
tp_start=0,
|
|
||||||
tp_end=4,
|
|
||||||
)
|
)
|
||||||
input_ids = torch.tensor([[3, 0], [1, 2]], device="cuda:0")
|
input_ids = torch.tensor([[3, 0], [1, 2]], device="cuda:0")
|
||||||
output = embedding._lookup(input_ids)
|
output = embedding._lookup(input_ids)
|
||||||
@@ -995,12 +1026,10 @@ def test_pinned_embedding_start_prefetch_allocates_lazily(
|
|||||||
|
|
||||||
loaded_weight = torch.arange(12, dtype=torch.float32).reshape(4, 3)
|
loaded_weight = torch.arange(12, dtype=torch.float32).reshape(4, 3)
|
||||||
loaded_weight = loaded_weight.to(torch.bfloat16)
|
loaded_weight = loaded_weight.to(torch.bfloat16)
|
||||||
copy_ple_embedding_shard_(
|
embedding._copy_embedding_shard_(
|
||||||
embedding.weight,
|
embedding.weight,
|
||||||
loaded_weight,
|
loaded_weight,
|
||||||
checkpoint_start=0,
|
checkpoint_start=0,
|
||||||
tp_start=0,
|
|
||||||
tp_end=4,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
ngram_ids = torch.tensor([[3, 0], [1, 2]], device="cuda:0")
|
ngram_ids = torch.tensor([[3, 0], [1, 2]], device="cuda:0")
|
||||||
@@ -1019,8 +1048,18 @@ def test_pinned_embedding_start_prefetch_allocates_lazily(
|
|||||||
torch.testing.assert_close(output, expected, rtol=0, atol=0)
|
torch.testing.assert_close(output, expected, rtol=0, atol=0)
|
||||||
|
|
||||||
|
|
||||||
def test_ple_fp8_embedding_supports_mixed_precision_config() -> None:
|
@pytest.mark.parametrize(
|
||||||
|
"exclude_pattern",
|
||||||
|
[
|
||||||
|
"model.language_model.layers.1.ple.ple_embedding.ngram_embedding",
|
||||||
|
"*.ngram_embedding",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
def test_ple_fp8_embedding_supports_mixed_precision_config(
|
||||||
|
exclude_pattern: str,
|
||||||
|
) -> None:
|
||||||
prefix = "model.language_model.layers.1.ple.ple_embedding.ngram_embedding"
|
prefix = "model.language_model.layers.1.ple.ple_embedding.ngram_embedding"
|
||||||
|
nvfp4_prefix = "model.language_model.layers.2.ple.ple_embedding.ngram_embedding"
|
||||||
quant_config = ModelOptMixedPrecisionConfig.from_config(
|
quant_config = ModelOptMixedPrecisionConfig.from_config(
|
||||||
{
|
{
|
||||||
"quantization": {
|
"quantization": {
|
||||||
@@ -1029,6 +1068,7 @@ def test_ple_fp8_embedding_supports_mixed_precision_config() -> None:
|
|||||||
"group_size": 16,
|
"group_size": 16,
|
||||||
"quantized_layers": {
|
"quantized_layers": {
|
||||||
prefix: {"quant_algo": "FP8"},
|
prefix: {"quant_algo": "FP8"},
|
||||||
|
nvfp4_prefix: {"quant_algo": "NVFP4"},
|
||||||
"model.language_model.layers.2.moe.gate_proj": {
|
"model.language_model.layers.2.moe.gate_proj": {
|
||||||
"quant_algo": "MXFP8"
|
"quant_algo": "MXFP8"
|
||||||
},
|
},
|
||||||
@@ -1041,357 +1081,29 @@ def test_ple_fp8_embedding_supports_mixed_precision_config() -> None:
|
|||||||
Qwen4ExpPLEEmbeddingMethod.from_quant_config(quant_config, prefix),
|
Qwen4ExpPLEEmbeddingMethod.from_quant_config(quant_config, prefix),
|
||||||
Qwen4ExpPLEFp8EmbeddingMethod,
|
Qwen4ExpPLEFp8EmbeddingMethod,
|
||||||
)
|
)
|
||||||
# A quant_algo the PLE table cannot load must not fall back to unquantized.
|
assert isinstance(
|
||||||
|
Qwen4ExpPLEEmbeddingMethod.from_quant_config(
|
||||||
|
quant_config,
|
||||||
|
"model.language_model.layers.3.ple.ple_embedding.ngram_embedding",
|
||||||
|
),
|
||||||
|
Qwen4ExpPLEUnquantizedEmbeddingMethod,
|
||||||
|
)
|
||||||
|
assert isinstance(
|
||||||
|
Qwen4ExpPLEEmbeddingMethod.from_quant_config(quant_config, nvfp4_prefix),
|
||||||
|
Qwen4ExpPLENvFp4EmbeddingMethod,
|
||||||
|
)
|
||||||
|
# An explicitly unsupported PLE format must not fall back to unquantized.
|
||||||
with pytest.raises(ValueError, match="Unsupported quant_algo 'MXFP8'"):
|
with pytest.raises(ValueError, match="Unsupported quant_algo 'MXFP8'"):
|
||||||
Qwen4ExpPLEEmbeddingMethod.from_quant_config(
|
Qwen4ExpPLEEmbeddingMethod.from_quant_config(
|
||||||
quant_config,
|
quant_config,
|
||||||
"model.language_model.layers.2.moe.gate_proj",
|
"model.language_model.layers.2.moe.gate_proj",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
quant_config.exclude_modules = [exclude_pattern]
|
||||||
def _patch_ple_construction(
|
assert isinstance(
|
||||||
monkeypatch: pytest.MonkeyPatch,
|
Qwen4ExpPLEEmbeddingMethod.from_quant_config(quant_config, prefix),
|
||||||
*,
|
Qwen4ExpPLEUnquantizedEmbeddingMethod,
|
||||||
engram_config: SimpleNamespace | None = None,
|
|
||||||
load_format: str = "auto",
|
|
||||||
) -> None:
|
|
||||||
_mock_etp_group(monkeypatch)
|
|
||||||
for module in (embedding_module, parameter_module):
|
|
||||||
monkeypatch.setattr(module, "get_tensor_model_parallel_rank", lambda: 0)
|
|
||||||
monkeypatch.setattr(module, "get_tensor_model_parallel_world_size", lambda: 1)
|
|
||||||
vllm_config = SimpleNamespace(
|
|
||||||
load_config=SimpleNamespace(load_format=load_format),
|
|
||||||
engram_config=engram_config,
|
|
||||||
)
|
)
|
||||||
monkeypatch.setattr(
|
|
||||||
nvidia_ngram_embedding_module, "get_current_vllm_config", lambda: vllm_config
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def _make_file_gather_embedding(
|
|
||||||
monkeypatch: pytest.MonkeyPatch,
|
|
||||||
tmp_path: Path,
|
|
||||||
*,
|
|
||||||
fp8: bool = False,
|
|
||||||
load_format: str = "auto",
|
|
||||||
bind: bool = False,
|
|
||||||
) -> tuple[Qwen4ExpNGramEmbedding, torch.Tensor]:
|
|
||||||
"""Build a two-head, 12-token host-file-gather embedding and its saved table.
|
|
||||||
|
|
||||||
The 21-row table is saved to ``tmp_path / "model.safetensors"`` as four
|
|
||||||
checkpoint shards of stride 6, so the last shard holds 3 rows.
|
|
||||||
"""
|
|
||||||
_patch_ple_construction(monkeypatch, load_format=load_format)
|
|
||||||
method = (
|
|
||||||
Qwen4ExpPLEFp8EmbeddingMethod()
|
|
||||||
if fp8
|
|
||||||
else Qwen4ExpPLEUnquantizedEmbeddingMethod()
|
|
||||||
)
|
|
||||||
module = Qwen4ExpNGramEmbedding.__new__(Qwen4ExpNGramEmbedding)
|
|
||||||
nn.Module.__init__(module)
|
|
||||||
module.use_sequence_parallel = False
|
|
||||||
module.split_ngram_parts = 4
|
|
||||||
module.eos_token_id = 0
|
|
||||||
module.ngram_size = 2
|
|
||||||
module.heads_per_ngram = 2
|
|
||||||
module.register_buffer("layer_multipliers", torch.tensor([3, 5]))
|
|
||||||
module.register_buffer("ngram_heads_vocab_sizes", torch.tensor([13, 7]))
|
|
||||||
module.register_buffer("ngram_heads_offsets", torch.tensor([0, 13]))
|
|
||||||
module.ngram_embedding = Qwen4ExpPLEFileGatherEmbedding(
|
|
||||||
21,
|
|
||||||
2,
|
|
||||||
params_dtype=torch.bfloat16,
|
|
||||||
padding_size=1,
|
|
||||||
prefix="test.ple_embedding",
|
|
||||||
embedding_method=method,
|
|
||||||
num_ngram_heads=2,
|
|
||||||
max_total_tokens=12,
|
|
||||||
)
|
|
||||||
dtype = torch.float8_e4m3fn if fp8 else torch.bfloat16
|
|
||||||
table = torch.arange(42, dtype=torch.float32).reshape(21, 2).to(dtype)
|
|
||||||
checkpoint = {
|
|
||||||
f"ngram_embedding.shard_{index}.weight": shard.clone()
|
|
||||||
for index, shard in enumerate(table.split(6))
|
|
||||||
}
|
|
||||||
if fp8:
|
|
||||||
checkpoint["ngram_embedding.weight_scale"] = torch.tensor([0.25]).bfloat16()
|
|
||||||
save_file(checkpoint, tmp_path / "model.safetensors")
|
|
||||||
if bind:
|
|
||||||
_load_file_shards(module, tmp_path / "model.safetensors")
|
|
||||||
module.ngram_embedding.bind_file_shards()
|
|
||||||
return module, table
|
|
||||||
|
|
||||||
|
|
||||||
def _load_file_shards(module: Qwen4ExpNGramEmbedding, path: Path) -> set[str]:
|
|
||||||
"""Load ``path`` through ``load_weights`` as the lazy safetensors iterator does."""
|
|
||||||
with safe_open(path, framework="pt") as checkpoint:
|
|
||||||
return module.load_weights(
|
|
||||||
(name, checkpoint.get_tensor(name))
|
|
||||||
for name in checkpoint.keys() # noqa: SIM118
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def _dev_zero_shards() -> list[tuple[str, torch.Tensor]]:
|
|
||||||
"""Return shards in a ``/dev/zero`` mapping, which is how pinned memory maps."""
|
|
||||||
with open("/dev/zero", "r+b") as dev_zero:
|
|
||||||
mapping = mmap.mmap(dev_zero.fileno(), mmap.PAGESIZE)
|
|
||||||
table = torch.frombuffer(mapping, dtype=torch.uint8)[:84].view(torch.bfloat16)
|
|
||||||
return [
|
|
||||||
(f"ngram_embedding.shard_{index}.weight", shard)
|
|
||||||
for index, shard in enumerate(table.reshape(21, 2).split(6))
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
("engram_config", "backend", "rows"),
|
|
||||||
[
|
|
||||||
(
|
|
||||||
SimpleNamespace(host_file_gather=True, cpu_offload=True),
|
|
||||||
Qwen4ExpPLEFileGatherEmbedding,
|
|
||||||
0,
|
|
||||||
),
|
|
||||||
(
|
|
||||||
SimpleNamespace(host_file_gather=False, cpu_offload=False),
|
|
||||||
Qwen4ExpPLEDeviceEmbedding,
|
|
||||||
24,
|
|
||||||
),
|
|
||||||
(None, Qwen4ExpPLEDeviceEmbedding, 24),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
def test_ngram_embedding_selects_backend_from_engram_config(
|
|
||||||
monkeypatch, engram_config, backend, rows
|
|
||||||
) -> None:
|
|
||||||
"""File gather wins with no rows; ``cpu_offload=False`` keeps rows on device."""
|
|
||||||
_patch_ple_construction(monkeypatch, engram_config=engram_config)
|
|
||||||
config = SimpleNamespace(
|
|
||||||
ngram_size=2,
|
|
||||||
heads_per_ngram=2,
|
|
||||||
eos_token_id=0,
|
|
||||||
vocab_size=64,
|
|
||||||
ngram_vocab_size_base=8,
|
|
||||||
make_ngram_vocab_size_divisible_by=1,
|
|
||||||
)
|
|
||||||
|
|
||||||
module = Qwen4ExpNGramEmbedding(config, 4, 0, 4, data_parallel_rank=0, prefix="t")
|
|
||||||
|
|
||||||
assert tuple(module.ngram_embedding.weight.shape) == (rows, 2)
|
|
||||||
assert isinstance(module.ngram_embedding, backend)
|
|
||||||
|
|
||||||
|
|
||||||
def test_ngram_embedding_default_cpu_offload_selects_pinned_backend(
|
|
||||||
monkeypatch,
|
|
||||||
) -> None:
|
|
||||||
"""Default ``cpu_offload=True`` selects pinned storage and requires UVA."""
|
|
||||||
_patch_ple_construction(
|
|
||||||
monkeypatch,
|
|
||||||
engram_config=SimpleNamespace(host_file_gather=False, cpu_offload=True),
|
|
||||||
)
|
|
||||||
monkeypatch.setattr(ngram_embedding_module, "is_uva_available", lambda: False)
|
|
||||||
config = SimpleNamespace(
|
|
||||||
ngram_size=2,
|
|
||||||
heads_per_ngram=2,
|
|
||||||
eos_token_id=0,
|
|
||||||
vocab_size=64,
|
|
||||||
ngram_vocab_size_base=8,
|
|
||||||
make_ngram_vocab_size_divisible_by=1,
|
|
||||||
)
|
|
||||||
|
|
||||||
with pytest.raises(RuntimeError, match="CPU offload requires UVA"):
|
|
||||||
Qwen4ExpNGramEmbedding(config, 4, 0, 4, data_parallel_rank=0, prefix="t")
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
("read_shards", "error"),
|
|
||||||
[
|
|
||||||
pytest.param(
|
|
||||||
lambda path: [("ngram_embedding.shard_0.weight", torch.zeros(6, 2))],
|
|
||||||
"dtype torch.float32 must match the embedding dtype torch.bfloat16",
|
|
||||||
id="wrong_dtype",
|
|
||||||
),
|
|
||||||
pytest.param(
|
|
||||||
lambda path: [*load_file(path).items()] * 2,
|
|
||||||
"Duplicate PLE embedding shard 0",
|
|
||||||
id="duplicate_shard",
|
|
||||||
),
|
|
||||||
pytest.param(
|
|
||||||
lambda path: [s for s in load_file(path).items() if "_2." not in s[0]],
|
|
||||||
"PLE shards cover 15 of 21 rows",
|
|
||||||
id="missing_shard",
|
|
||||||
),
|
|
||||||
pytest.param(lambda path: [], "PLE shards cover 0 of 21 rows", id="no_shards"),
|
|
||||||
pytest.param(
|
|
||||||
lambda path: [(n, t.clone()) for n, t in load_file(path).items()],
|
|
||||||
"not a file-backed view",
|
|
||||||
id="anonymous",
|
|
||||||
),
|
|
||||||
pytest.param(
|
|
||||||
lambda path: load(path.read_bytes()).items(),
|
|
||||||
"not a file-backed view",
|
|
||||||
id="heap",
|
|
||||||
),
|
|
||||||
pytest.param(
|
|
||||||
lambda path: _dev_zero_shards(), "not a file-backed view", id="dev_zero"
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
def test_file_gather_rejects_shards_that_cannot_serve_every_row_from_a_file(
|
|
||||||
monkeypatch, tmp_path, read_shards, error
|
|
||||||
) -> None:
|
|
||||||
"""A real load must fail instead of serving zeros or a copied table."""
|
|
||||||
module, _ = _make_file_gather_embedding(monkeypatch, tmp_path)
|
|
||||||
|
|
||||||
with pytest.raises(ValueError, match=error):
|
|
||||||
module.load_weights(read_shards(tmp_path / "model.safetensors"))
|
|
||||||
module.ngram_embedding.bind_file_shards()
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("fp8", [False, True])
|
|
||||||
def test_file_gather_binds_zero_copy_shards_through_loader_hook(
|
|
||||||
monkeypatch, tmp_path, fp8
|
|
||||||
) -> None:
|
|
||||||
"""Fails if safetensors stops returning zero-copy views of the file."""
|
|
||||||
module, table = _make_file_gather_embedding(monkeypatch, tmp_path, fp8=fp8)
|
|
||||||
embedding = module.ngram_embedding
|
|
||||||
|
|
||||||
loaded = _load_file_shards(module, tmp_path / "model.safetensors")
|
|
||||||
embedding.quant_method.process_weights_after_loading(embedding)
|
|
||||||
embedding.quant_method.process_weights_after_loading(embedding)
|
|
||||||
|
|
||||||
assert loaded == {"ngram_embedding.weight"} | (
|
|
||||||
{"ngram_embedding.weight_scale"} if fp8 else set()
|
|
||||||
)
|
|
||||||
assert embedding._bound
|
|
||||||
stored = torch.cat([embedding._shards[index] for index in range(4)])
|
|
||||||
assert torch.equal(stored, table.view(torch.uint8))
|
|
||||||
|
|
||||||
|
|
||||||
def test_file_gather_binds_shards_opened_through_a_symlink(
|
|
||||||
monkeypatch, tmp_path
|
|
||||||
) -> None:
|
|
||||||
"""HF cache snapshots link to suffix-less blobs, which is the mapped path."""
|
|
||||||
module, _ = _make_file_gather_embedding(monkeypatch, tmp_path)
|
|
||||||
blob = (tmp_path / "model.safetensors").rename(tmp_path / "blob")
|
|
||||||
snapshot = tmp_path / "snapshot.safetensors"
|
|
||||||
snapshot.symlink_to(blob)
|
|
||||||
_load_file_shards(module, snapshot)
|
|
||||||
|
|
||||||
module.ngram_embedding.bind_file_shards()
|
|
||||||
|
|
||||||
assert module.ngram_embedding._bound
|
|
||||||
|
|
||||||
|
|
||||||
def test_file_gather_rejects_reload_and_stays_poisoned(monkeypatch, tmp_path) -> None:
|
|
||||||
module, table = _make_file_gather_embedding(monkeypatch, tmp_path, bind=True)
|
|
||||||
|
|
||||||
with pytest.raises(RuntimeError, match="does not support weight reload"):
|
|
||||||
module.load_weights([("ngram_embedding.shard_0.weight", table[:6])])
|
|
||||||
with pytest.raises(RuntimeError, match="unbound or was reloaded"):
|
|
||||||
module.ngram_embedding.stage_rows(1)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
("bad_id", "error"),
|
|
||||||
[(21, IndexError), (24, IndexError), (-1, RuntimeError)],
|
|
||||||
ids=["past_last_shard_rows", "past_last_shard", "negative"],
|
|
||||||
)
|
|
||||||
def test_file_gather_out_of_range_id_keeps_previous_staged_rows(
|
|
||||||
monkeypatch, tmp_path, bad_id, error
|
|
||||||
) -> None:
|
|
||||||
"""Out-of-range ids fail before the H2D copy, so no wrong row is served."""
|
|
||||||
module, table = _make_file_gather_embedding(monkeypatch, tmp_path, bind=True)
|
|
||||||
embedding = module.ngram_embedding
|
|
||||||
ids = torch.tensor(
|
|
||||||
[
|
|
||||||
[20, 0],
|
|
||||||
[19, 1],
|
|
||||||
[18, 2],
|
|
||||||
[17, 3],
|
|
||||||
[16, 4],
|
|
||||||
[15, 5],
|
|
||||||
[14, 6],
|
|
||||||
[13, 7],
|
|
||||||
[12, 8],
|
|
||||||
[11, 9],
|
|
||||||
[10, 10],
|
|
||||||
]
|
|
||||||
)
|
|
||||||
embedding._host_ids[:11] = ids
|
|
||||||
embedding.stage_rows(11)
|
|
||||||
embedding._host_ids[5, 1] = bad_id
|
|
||||||
|
|
||||||
with pytest.raises(error):
|
|
||||||
embedding.stage_rows(11)
|
|
||||||
|
|
||||||
assert torch.equal(embedding._staging[:11], table[ids])
|
|
||||||
|
|
||||||
|
|
||||||
def test_file_gather_reads_ahead_the_coalesced_pages_of_staged_rows(
|
|
||||||
monkeypatch, tmp_path
|
|
||||||
) -> None:
|
|
||||||
"""Rows start 34 bytes before page 2 of a file mapped from page 1.
|
|
||||||
|
|
||||||
Rows 0-7 are in page 1, row 8 straddles pages 1 and 2, and the rows of shard 1
|
|
||||||
arrive unsorted.
|
|
||||||
"""
|
|
||||||
module, table = _make_file_gather_embedding(monkeypatch, tmp_path)
|
|
||||||
embedding, page = module.ngram_embedding, mmap.PAGESIZE
|
|
||||||
start = 2 * page - 34
|
|
||||||
path = tmp_path / "table.bin"
|
|
||||||
path.write_bytes(bytes(start) + table.view(torch.uint8).numpy().tobytes())
|
|
||||||
with open(path, "rb") as file:
|
|
||||||
mapping = mmap.mmap(file.fileno(), 0, offset=page, access=mmap.ACCESS_COPY)
|
|
||||||
rows = torch.frombuffer(mapping, dtype=torch.uint8)[start - page :]
|
|
||||||
module.load_weights(
|
|
||||||
(f"ngram_embedding.shard_{index}.weight", shard)
|
|
||||||
for index, shard in enumerate(rows.view(table.dtype).reshape(21, 2).split(6))
|
|
||||||
)
|
|
||||||
embedding.bind_file_shards()
|
|
||||||
calls = []
|
|
||||||
monkeypatch.setattr(
|
|
||||||
nvidia_ngram_embedding_module.os,
|
|
||||||
"posix_fadvise",
|
|
||||||
lambda fd, *args: calls.append((os.fstat(fd).st_ino, *args)),
|
|
||||||
)
|
|
||||||
ids = torch.tensor([[0, 1], [8, 7]])
|
|
||||||
embedding._host_ids[:2] = ids
|
|
||||||
|
|
||||||
embedding.stage_rows(2)
|
|
||||||
|
|
||||||
inode, willneed = path.stat().st_ino, os.POSIX_FADV_WILLNEED
|
|
||||||
assert calls == [(inode, page, page, willneed), (inode, page, 2 * page, willneed)]
|
|
||||||
assert torch.equal(embedding._staging[:2], table[ids])
|
|
||||||
|
|
||||||
|
|
||||||
def test_file_gather_dummy_load_stages_zeros(monkeypatch, tmp_path) -> None:
|
|
||||||
module, _ = _make_file_gather_embedding(monkeypatch, tmp_path, load_format="dummy")
|
|
||||||
embedding = module.ngram_embedding
|
|
||||||
embedding.quant_method.process_weights_after_loading(embedding)
|
|
||||||
embedding._host_rows.view(torch.uint8).fill_(0xFF)
|
|
||||||
embedding._staging.view(torch.uint8).fill_(0xFF)
|
|
||||||
|
|
||||||
embedding.stage_rows(4)
|
|
||||||
|
|
||||||
staged = embedding._staging.view(torch.uint8)
|
|
||||||
assert torch.all(staged[:4] == 0)
|
|
||||||
assert torch.all(staged[4:] == 0xFF)
|
|
||||||
|
|
||||||
|
|
||||||
def test_file_gather_forward_reads_staging_without_host_work(
|
|
||||||
monkeypatch, tmp_path
|
|
||||||
) -> None:
|
|
||||||
"""The forward must be a fixed-address read so FULL CUDA graphs replay it."""
|
|
||||||
module, _ = _make_file_gather_embedding(monkeypatch, tmp_path)
|
|
||||||
staging = module.ngram_embedding._staging
|
|
||||||
staging.view(torch.uint8).fill_(0xFF)
|
|
||||||
step = (torch.arange(6), torch.tensor([0, 6]), torch.tensor([[1]]))
|
|
||||||
hidden_states = torch.zeros(6, 8, dtype=torch.bfloat16)
|
|
||||||
|
|
||||||
assert module.start_prefetch(*step) is None
|
|
||||||
output = module(hidden_states, *step)
|
|
||||||
|
|
||||||
assert torch.all(staging.view(torch.uint8) == 0xFF)
|
|
||||||
assert output.data_ptr() == staging.data_ptr()
|
|
||||||
assert output.shape == (6, 4)
|
|
||||||
|
|
||||||
|
|
||||||
def test_dilated_ple_spec_state_rolls_back_before_next_forward() -> None:
|
def test_dilated_ple_spec_state_rolls_back_before_next_forward() -> None:
|
||||||
|
|||||||
@@ -506,67 +506,6 @@ def test_qsa_compressed_metadata_keeps_dummy_slots_inert() -> None:
|
|||||||
|
|
||||||
|
|
||||||
@requires_qsa_kernels
|
@requires_qsa_kernels
|
||||||
@requires_qsa_kernels
|
|
||||||
@pytest.mark.parametrize("layout", ["plain", "compressed", "circular"])
|
|
||||||
def test_qsa_draft_decode_metadata_update_matches_rebuild(layout: str) -> None:
|
|
||||||
"""A fused draft step's in-place update equals a fresh build at seq_lens + 1."""
|
|
||||||
device = torch.device("cuda")
|
|
||||||
compress_ratio = 4 if layout != "plain" else 1
|
|
||||||
|
|
||||||
def make_builder() -> QSAMetadataBuilder:
|
|
||||||
builder = QSAMetadataBuilder.__new__(QSAMetadataBuilder)
|
|
||||||
builder.compress_ratio = compress_ratio
|
|
||||||
builder.reorder_batch_threshold = 1
|
|
||||||
builder.is_circular_buffer = layout == "circular"
|
|
||||||
builder.kv_cache_spec = SimpleNamespace(block_size=4)
|
|
||||||
builder.storage_block_size = 16 if layout == "compressed" else 4
|
|
||||||
builder.token_to_req_buffer = torch.empty(8, dtype=torch.int32, device=device)
|
|
||||||
builder.slot_mapping_buffer = torch.empty(8, dtype=torch.int64, device=device)
|
|
||||||
builder.logical_positions_buffer = torch.empty(
|
|
||||||
8, dtype=torch.int64, device=device
|
|
||||||
)
|
|
||||||
builder.visible_blocks_buffer = torch.empty(8, dtype=torch.int32, device=device)
|
|
||||||
builder.request_capacity = 8
|
|
||||||
builder.k_work_metadata_buffer = torch.empty(
|
|
||||||
8 if layout == "compressed" else 0, 2, dtype=torch.int32, device=device
|
|
||||||
)
|
|
||||||
return builder
|
|
||||||
|
|
||||||
query_start_loc = torch.tensor([0, 1, 2, 3], dtype=torch.int32, device=device)
|
|
||||||
token_to_req = torch.tensor([0, 1, 2], dtype=torch.int32, device=device)
|
|
||||||
|
|
||||||
def make_common(seq_lens: torch.Tensor) -> SimpleNamespace:
|
|
||||||
return SimpleNamespace(
|
|
||||||
num_actual_tokens=3,
|
|
||||||
num_reqs=3,
|
|
||||||
max_query_len=1,
|
|
||||||
max_seq_len=int(seq_lens.max()),
|
|
||||||
query_start_loc=query_start_loc,
|
|
||||||
query_start_loc_cpu=query_start_loc.cpu(),
|
|
||||||
seq_lens=seq_lens,
|
|
||||||
slot_mapping=torch.tensor([5, 9, 20], dtype=torch.int64, device=device),
|
|
||||||
block_table_tensor=torch.tensor(
|
|
||||||
[[3, 1], [0, 4], [2, 5]], dtype=torch.int32, device=device
|
|
||||||
),
|
|
||||||
token_to_req_indices=lambda buffer: buffer.copy_(token_to_req),
|
|
||||||
)
|
|
||||||
|
|
||||||
# 7 -> 8 crosses a compression boundary, so visible_blocks must change.
|
|
||||||
seq_lens = torch.tensor([7, 11, 16], dtype=torch.int32, device=device)
|
|
||||||
builder = make_builder()
|
|
||||||
metadata = builder.build(0, make_common(seq_lens))
|
|
||||||
positions_before = metadata.logical_positions.clone()
|
|
||||||
|
|
||||||
seq_lens.add_(1)
|
|
||||||
builder.update_draft_decode_metadata(metadata)
|
|
||||||
expected = make_builder().build(0, make_common(seq_lens.clone()))
|
|
||||||
|
|
||||||
assert not torch.equal(metadata.logical_positions, positions_before)
|
|
||||||
for name in ("token_to_req", "logical_positions", "visible_blocks", "slot_mapping"):
|
|
||||||
torch.testing.assert_close(getattr(metadata, name), getattr(expected, name))
|
|
||||||
torch.testing.assert_close(metadata.k_work_metadata, expected.k_work_metadata)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("default_vllm_config")
|
@pytest.mark.usefixtures("default_vllm_config")
|
||||||
def test_qsa_unfused_cache_update_ignores_padded_qk() -> None:
|
def test_qsa_unfused_cache_update_ignores_padded_qk() -> None:
|
||||||
"""Padded projected Q/K rows must not affect either side cache."""
|
"""Padded projected Q/K rows must not affect either side cache."""
|
||||||
|
|||||||
@@ -1,280 +0,0 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
"""Tests for the runtime refusal-direction projection."""
|
|
||||||
|
|
||||||
import json
|
|
||||||
import math
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
import torch
|
|
||||||
|
|
||||||
from vllm import envs
|
|
||||||
from vllm.model_executor.models import abliteration
|
|
||||||
|
|
||||||
HIDDEN = 8
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
|
||||||
def clear_direction_cache():
|
|
||||||
abliteration._read.cache_clear()
|
|
||||||
abliteration.clear_logs()
|
|
||||||
yield
|
|
||||||
abliteration._read.cache_clear()
|
|
||||||
abliteration.clear_logs()
|
|
||||||
|
|
||||||
|
|
||||||
def write_direction(tmp_path, name="r.json", size=HIDDEN):
|
|
||||||
direction = [math.sin(i) for i in range(size)]
|
|
||||||
path = tmp_path / name
|
|
||||||
path.write_text(json.dumps({"hidden_size": size, "refusal_direction": direction}))
|
|
||||||
return str(path)
|
|
||||||
|
|
||||||
|
|
||||||
def registered(module, size=HIDDEN, dtype=torch.float32):
|
|
||||||
abliteration.register(module, size, dtype)
|
|
||||||
return module
|
|
||||||
|
|
||||||
|
|
||||||
def test_off_is_a_noop_and_still_registers(tmp_path, monkeypatch):
|
|
||||||
"""With the switch off the buffer exists as zeros and x is unchanged."""
|
|
||||||
monkeypatch.delenv("VLLM_ABLITERATION", raising=False)
|
|
||||||
monkeypatch.delenv("QWEN38_ABLITERATION", raising=False)
|
|
||||||
module = registered(torch.nn.Module())
|
|
||||||
assert module._abliteration_on is False
|
|
||||||
assert torch.count_nonzero(module._abliteration_r) == 0
|
|
||||||
|
|
||||||
x = torch.randn(3, HIDDEN)
|
|
||||||
expected = x.clone()
|
|
||||||
assert abliteration.project_(module, x) is x
|
|
||||||
abliteration.project_(module, x)
|
|
||||||
assert torch.equal(x, expected)
|
|
||||||
|
|
||||||
|
|
||||||
def test_projection_drops_the_component(tmp_path, monkeypatch):
|
|
||||||
"""After projection the tensor keeps no component along the direction."""
|
|
||||||
monkeypatch.setenv("VLLM_ABLITERATION", write_direction(tmp_path))
|
|
||||||
module = registered(torch.nn.Module())
|
|
||||||
assert module._abliteration_on is True
|
|
||||||
|
|
||||||
r = module._abliteration_r
|
|
||||||
x = torch.randn(4, HIDDEN)
|
|
||||||
abliteration.project_(module, x)
|
|
||||||
assert torch.allclose(x @ r, torch.zeros(4), atol=1e-5)
|
|
||||||
assert not torch.allclose(x, torch.zeros_like(x))
|
|
||||||
|
|
||||||
# Projecting an already projected tensor changes nothing.
|
|
||||||
projected = x.clone()
|
|
||||||
abliteration.project_(module, x)
|
|
||||||
assert torch.allclose(x, projected, atol=1e-6)
|
|
||||||
|
|
||||||
|
|
||||||
def test_registered_direction_is_unit(tmp_path, monkeypatch):
|
|
||||||
monkeypatch.setenv("VLLM_ABLITERATION", write_direction(tmp_path))
|
|
||||||
module = registered(torch.nn.Module())
|
|
||||||
assert torch.allclose(module._abliteration_r.norm(), torch.tensor(1.0), atol=1e-6)
|
|
||||||
|
|
||||||
|
|
||||||
def test_non_contiguous_input_is_projected(tmp_path, monkeypatch):
|
|
||||||
monkeypatch.setenv("VLLM_ABLITERATION", write_direction(tmp_path))
|
|
||||||
module = registered(torch.nn.Module())
|
|
||||||
x = torch.randn(4, HIDDEN * 2)[:, ::2]
|
|
||||||
assert not x.is_contiguous()
|
|
||||||
abliteration.project_(module, x)
|
|
||||||
assert torch.allclose(x @ module._abliteration_r, torch.zeros(4), atol=1e-5)
|
|
||||||
|
|
||||||
|
|
||||||
def test_width_mismatch_is_skipped(tmp_path, monkeypatch):
|
|
||||||
"""A tensor without the full hidden dim must not be projected."""
|
|
||||||
monkeypatch.setenv("VLLM_ABLITERATION", write_direction(tmp_path))
|
|
||||||
module = registered(torch.nn.Module())
|
|
||||||
x = torch.randn(2, HIDDEN // 2)
|
|
||||||
before = x.clone()
|
|
||||||
abliteration.project_(module, x)
|
|
||||||
assert torch.equal(x, before)
|
|
||||||
|
|
||||||
|
|
||||||
def test_hidden_size_mismatch_raises(tmp_path, monkeypatch):
|
|
||||||
"""A direction for another model fails at boot, not silently."""
|
|
||||||
monkeypatch.setenv("VLLM_ABLITERATION", write_direction(tmp_path, size=HIDDEN))
|
|
||||||
with pytest.raises(ValueError, match="holds 8 values"):
|
|
||||||
registered(torch.nn.Module(), size=HIDDEN + 1)
|
|
||||||
|
|
||||||
|
|
||||||
def test_first_projection_logs_that_it_is_active(tmp_path, monkeypatch, caplog):
|
|
||||||
"""The boot log proves the switch is live, not just loaded."""
|
|
||||||
import logging
|
|
||||||
|
|
||||||
monkeypatch.setenv("VLLM_ABLITERATION", write_direction(tmp_path))
|
|
||||||
module = registered(torch.nn.Linear(HIDDEN, HIDDEN))
|
|
||||||
with caplog.at_level(
|
|
||||||
logging.INFO, logger="vllm.model_executor.models.abliteration"
|
|
||||||
):
|
|
||||||
abliteration.project_(module, torch.randn(2, HIDDEN))
|
|
||||||
assert "active, projected a 8-wide tensor" in caplog.text
|
|
||||||
|
|
||||||
|
|
||||||
def test_flash_next_direction_is_rejected_by_the_27b_model(tmp_path, monkeypatch):
|
|
||||||
"""Flash-Next stores 2560 values; the dense 27B stream is 5120 wide."""
|
|
||||||
path = write_direction(tmp_path, name="flash_next.json", size=2560)
|
|
||||||
monkeypatch.setenv("VLLM_ABLITERATION", path)
|
|
||||||
with pytest.raises(
|
|
||||||
ValueError, match="holds 2560 values; the model's hidden size is 5120"
|
|
||||||
):
|
|
||||||
registered(torch.nn.Module(), size=5120)
|
|
||||||
|
|
||||||
|
|
||||||
def test_half_width_activation_is_skipped(tmp_path, monkeypatch):
|
|
||||||
"""A 2560-wide tensor cannot be projected by the 5120 direction."""
|
|
||||||
monkeypatch.setenv("VLLM_ABLITERATION", write_direction(tmp_path, size=5120))
|
|
||||||
module = registered(torch.nn.Module(), size=5120)
|
|
||||||
x = torch.randn(4, 2560)
|
|
||||||
before = x.clone()
|
|
||||||
abliteration.project_(module, x)
|
|
||||||
assert torch.equal(x, before)
|
|
||||||
|
|
||||||
|
|
||||||
def test_zero_direction_raises(tmp_path, monkeypatch):
|
|
||||||
path = tmp_path / "zero.json"
|
|
||||||
path.write_text(json.dumps({"refusal_direction": [0.0] * HIDDEN}))
|
|
||||||
monkeypatch.setenv("VLLM_ABLITERATION", str(path))
|
|
||||||
with pytest.raises(ValueError, match="zero or non-finite"):
|
|
||||||
abliteration.load_direction(HIDDEN)
|
|
||||||
|
|
||||||
|
|
||||||
def test_bare_name_resolves_in_builtin_dir(tmp_path, monkeypatch):
|
|
||||||
path = write_direction(tmp_path, name="Uncensored.json")
|
|
||||||
monkeypatch.setattr(abliteration, "BUILTIN_DIRS", (str(tmp_path),))
|
|
||||||
monkeypatch.setenv("VLLM_ABLITERATION", "Uncensored")
|
|
||||||
assert abliteration.direction_path() == path
|
|
||||||
|
|
||||||
|
|
||||||
def test_missing_direction_file_raises(tmp_path, monkeypatch):
|
|
||||||
monkeypatch.setattr(abliteration, "BUILTIN_DIRS", (str(tmp_path / "nope"),))
|
|
||||||
monkeypatch.setenv("VLLM_ABLITERATION", "Uncensored")
|
|
||||||
with pytest.raises(FileNotFoundError):
|
|
||||||
abliteration.load_direction(HIDDEN)
|
|
||||||
|
|
||||||
|
|
||||||
def test_meta_device_turns_projection_off(tmp_path, monkeypatch):
|
|
||||||
"""A meta-initialized module cannot keep the direction, so it stays off."""
|
|
||||||
monkeypatch.setenv("VLLM_ABLITERATION", write_direction(tmp_path))
|
|
||||||
module = torch.nn.Module()
|
|
||||||
with torch.device("meta"):
|
|
||||||
abliteration.register(module, HIDDEN, torch.float32)
|
|
||||||
assert module._abliteration_r.device.type == "meta"
|
|
||||||
assert module._abliteration_on is False
|
|
||||||
|
|
||||||
|
|
||||||
def test_legacy_env_name_is_accepted(tmp_path, monkeypatch):
|
|
||||||
"""QWEN38_ABLITERATION still works, as existing deployments set it."""
|
|
||||||
path = write_direction(tmp_path)
|
|
||||||
monkeypatch.delenv("VLLM_ABLITERATION", raising=False)
|
|
||||||
monkeypatch.setenv("QWEN38_ABLITERATION", path)
|
|
||||||
assert path == envs.VLLM_ABLITERATION
|
|
||||||
assert abliteration.direction_path() == path
|
|
||||||
|
|
||||||
|
|
||||||
def test_compile_projects_without_a_graph_break(tmp_path, monkeypatch):
|
|
||||||
"""The projection stays traceable, so it does not split the compiled model."""
|
|
||||||
monkeypatch.setenv("VLLM_ABLITERATION", write_direction(tmp_path))
|
|
||||||
|
|
||||||
class Project(torch.nn.Module):
|
|
||||||
def __init__(self):
|
|
||||||
super().__init__()
|
|
||||||
abliteration.register(self, HIDDEN, torch.float32)
|
|
||||||
|
|
||||||
def forward(self, x):
|
|
||||||
return abliteration.project_(self, x)
|
|
||||||
|
|
||||||
module = Project().eval()
|
|
||||||
x = torch.randn(16, HIDDEN)
|
|
||||||
expected = abliteration.project_(module, x.clone())
|
|
||||||
got = torch.compile(module, fullgraph=True)(x.clone())
|
|
||||||
assert torch.allclose(got, expected, atol=1e-6)
|
|
||||||
|
|
||||||
|
|
||||||
def qwen3_5_config(dense: bool):
|
|
||||||
"""A two-layer Qwen3.5 config, one full-attention and one linear layer."""
|
|
||||||
if dense:
|
|
||||||
from transformers import Qwen3_5TextConfig as config_cls
|
|
||||||
|
|
||||||
extra = {"intermediate_size": 256, "hidden_act": "silu"}
|
|
||||||
else:
|
|
||||||
from transformers import Qwen3_5MoeTextConfig as config_cls
|
|
||||||
|
|
||||||
extra = {
|
|
||||||
"moe_intermediate_size": 32,
|
|
||||||
"shared_expert_intermediate_size": 32,
|
|
||||||
"num_experts": 2,
|
|
||||||
"num_experts_per_tok": 1,
|
|
||||||
"n_group": 1,
|
|
||||||
"topk_group": 1,
|
|
||||||
"norm_topk_prob": False,
|
|
||||||
"decoder_sparse_step": 1,
|
|
||||||
"mlp_only_layers": [],
|
|
||||||
}
|
|
||||||
return config_cls(
|
|
||||||
vocab_size=64,
|
|
||||||
hidden_size=HIDDEN,
|
|
||||||
num_hidden_layers=2,
|
|
||||||
num_attention_heads=4,
|
|
||||||
num_key_value_heads=2,
|
|
||||||
head_dim=32,
|
|
||||||
rms_norm_eps=1e-6,
|
|
||||||
layer_types=["full_attention", "linear_attention"],
|
|
||||||
linear_key_head_dim=32,
|
|
||||||
linear_value_head_dim=32,
|
|
||||||
linear_num_key_heads=2,
|
|
||||||
linear_num_value_heads=2,
|
|
||||||
num_nextn_predict_layers=1,
|
|
||||||
**extra,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("dense", [True, False])
|
|
||||||
def test_qwen3_5_model_projects_embeddings(tmp_path, monkeypatch, dense, dist_init):
|
|
||||||
"""A real Qwen3.5 model registers the direction and drops it from embeddings."""
|
|
||||||
from types import SimpleNamespace
|
|
||||||
|
|
||||||
from vllm.config import VllmConfig, set_current_vllm_config
|
|
||||||
from vllm.model_executor.models.qwen3_5 import Qwen3_5Model
|
|
||||||
|
|
||||||
config = qwen3_5_config(dense)
|
|
||||||
path = write_direction(tmp_path, size=HIDDEN)
|
|
||||||
monkeypatch.setenv("VLLM_ABLITERATION", path)
|
|
||||||
|
|
||||||
vllm_config = VllmConfig()
|
|
||||||
vllm_config.model_config = SimpleNamespace(
|
|
||||||
hf_config=config,
|
|
||||||
hf_text_config=config,
|
|
||||||
dtype=torch.bfloat16,
|
|
||||||
max_model_len=128,
|
|
||||||
is_diffusion=False,
|
|
||||||
head_dtype=None,
|
|
||||||
is_mm_prefix_lm=False,
|
|
||||||
multimodal_config=None,
|
|
||||||
quantization_config=None,
|
|
||||||
runner_type="generate",
|
|
||||||
is_moe=not dense,
|
|
||||||
logits_processors=None,
|
|
||||||
rswa_window=None,
|
|
||||||
)
|
|
||||||
vllm_config.quant_config = None
|
|
||||||
|
|
||||||
with set_current_vllm_config(vllm_config):
|
|
||||||
model = Qwen3_5Model(vllm_config=vllm_config)
|
|
||||||
with torch.no_grad():
|
|
||||||
for param in model.parameters():
|
|
||||||
param.data.normal_(0, 0.02)
|
|
||||||
|
|
||||||
assert model._abliteration_on is True
|
|
||||||
for layer in model.layers:
|
|
||||||
assert layer._abliteration_on is True
|
|
||||||
|
|
||||||
r = model._abliteration_r.float()
|
|
||||||
# The buffer carries the model dtype, so bf16 rounding keeps it near unit norm.
|
|
||||||
assert torch.allclose(r.norm(), torch.tensor(1.0), atol=2e-2)
|
|
||||||
|
|
||||||
embeddings = model.embed_input_ids(torch.arange(6)).float()
|
|
||||||
residual = float((embeddings @ r).abs().max())
|
|
||||||
scale = float(embeddings.abs().max())
|
|
||||||
assert residual < 1e-2 * scale
|
|
||||||
@@ -165,7 +165,7 @@ def test_replay_graph_matches_eager(monkeypatch, moe_backend, ids_dtype):
|
|||||||
# Mocking it true would capture into the cuMem pool, which breaks on ROCm.
|
# Mocking it true would capture into the cuMem pool, which breaks on ROCm.
|
||||||
cfg.use_cumem_cudagraph_pool = False
|
cfg.use_cumem_cudagraph_pool = False
|
||||||
cfg.scheduler_config = MagicMock(max_num_seqs=2, max_num_batched_tokens=64)
|
cfg.scheduler_config = MagicMock(max_num_seqs=2, max_num_batched_tokens=64)
|
||||||
cfg.cache_config.use_recoverssm = False
|
cfg.cache_config.use_kda_recoverssm = False
|
||||||
cfg.model_config.hf_config = MagicMock(hc_mult=HC, hidden_size=HIDDEN)
|
cfg.model_config.hf_config = MagicMock(hc_mult=HC, hidden_size=HIDDEN)
|
||||||
cfg.model_config.dtype = torch.float32
|
cfg.model_config.dtype = torch.float32
|
||||||
cfg.kernel_config.moe_backend = moe_backend
|
cfg.kernel_config.moe_backend = moe_backend
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ from vllm.models.deepseek_v4.amd.mega_moe import (
|
|||||||
)
|
)
|
||||||
from vllm.models.deepseek_v4.amd.model import DeepseekV4MoE
|
from vllm.models.deepseek_v4.amd.model import DeepseekV4MoE
|
||||||
from vllm.platforms import current_platform
|
from vllm.platforms import current_platform
|
||||||
|
from vllm.utils.torch_utils import aux_stream
|
||||||
|
|
||||||
HIDDEN = 64
|
HIDDEN = 64
|
||||||
INTER = 64
|
INTER = 64
|
||||||
@@ -156,7 +157,10 @@ def test_shared_expert_route_appended(monkeypatch):
|
|||||||
@pytest.mark.skipif(not current_platform.is_rocm(), reason="Requires ROCm")
|
@pytest.mark.skipif(not current_platform.is_rocm(), reason="Requires ROCm")
|
||||||
@pytest.mark.parametrize("hash_routing", [False, True])
|
@pytest.mark.parametrize("hash_routing", [False, True])
|
||||||
@pytest.mark.parametrize("num_tokens", [1, 37])
|
@pytest.mark.parametrize("num_tokens", [1, 37])
|
||||||
def test_mega_moe_routing_matches_reference(monkeypatch, hash_routing, num_tokens):
|
@pytest.mark.parametrize("shared_stream", [False, True])
|
||||||
|
def test_mega_moe_routing_matches_reference(
|
||||||
|
monkeypatch, hash_routing, num_tokens, shared_stream
|
||||||
|
):
|
||||||
num_experts, top_k, vocab = 16, 4, 64
|
num_experts, top_k, vocab = 16, 4, 64
|
||||||
scaling = 2.5
|
scaling = 2.5
|
||||||
device = "cuda"
|
device = "cuda"
|
||||||
@@ -195,6 +199,10 @@ def test_mega_moe_routing_matches_reference(monkeypatch, hash_routing, num_token
|
|||||||
moe.gate = Gate()
|
moe.gate = Gate()
|
||||||
moe.experts = experts
|
moe.experts = experts
|
||||||
moe.shared_experts = lambda x: 3 * x
|
moe.shared_experts = lambda x: 3 * x
|
||||||
|
moe.shared_experts_stream = aux_stream() if shared_stream else None
|
||||||
|
moe.shared_experts_events = (
|
||||||
|
(torch.cuda.Event(), torch.cuda.Event()) if shared_stream else None
|
||||||
|
)
|
||||||
moe.scoring_func = "sqrtsoftplus"
|
moe.scoring_func = "sqrtsoftplus"
|
||||||
moe.n_activated_experts = top_k
|
moe.n_activated_experts = top_k
|
||||||
moe.renormalize = True
|
moe.renormalize = True
|
||||||
|
|||||||
@@ -49,7 +49,9 @@ from vllm.transformers_utils.processor import get_video_processor_cls_name_from_
|
|||||||
|
|
||||||
from .utils import (
|
from .utils import (
|
||||||
create_edit_list_trimmed_video,
|
create_edit_list_trimmed_video,
|
||||||
|
create_live_webm_video,
|
||||||
create_long_gop_video,
|
create_long_gop_video,
|
||||||
|
create_raw_h264_video,
|
||||||
create_video_from_image,
|
create_video_from_image,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1261,8 +1263,8 @@ def test_qwen3_vl_unknown_source_fps_matches_hf(
|
|||||||
the metadata carries the fps HF assumes, which the frame timestamps use."""
|
the metadata carries the fps HF assumes, which the frame timestamps use."""
|
||||||
get_video_metadata = OpenCVVideoBackendMixin.get_video_metadata
|
get_video_metadata = OpenCVVideoBackendMixin.get_video_metadata
|
||||||
|
|
||||||
def unknown_fps(cap) -> VideoSourceMetadata:
|
def unknown_fps(data) -> VideoSourceMetadata:
|
||||||
return get_video_metadata(cap)._replace(original_fps=0.0, duration=0.0)
|
return get_video_metadata(data)._replace(original_fps=0.0, duration=0.0)
|
||||||
|
|
||||||
monkeypatch.setattr(
|
monkeypatch.setattr(
|
||||||
OpenCVVideoBackendMixin, "get_video_metadata", staticmethod(unknown_fps)
|
OpenCVVideoBackendMixin, "get_video_metadata", staticmethod(unknown_fps)
|
||||||
@@ -1476,6 +1478,36 @@ def test_video_backend_handles_edit_list_trimmed_video(
|
|||||||
assert qwen_frames.shape[0] >= 4
|
assert qwen_frames.shape[0] >= 4
|
||||||
|
|
||||||
|
|
||||||
|
def test_opencv_demux_counts_frames_when_video_header_lacks_metadata(
|
||||||
|
monkeypatch: pytest.MonkeyPatch,
|
||||||
|
):
|
||||||
|
"""Streamed WebM and raw H.264 carry no frame count/duration in their
|
||||||
|
headers, so OpenCV reports a bogus negative ``CAP_PROP_FRAME_COUNT``.
|
||||||
|
The loader must count the frames via a demux-only pass, without
|
||||||
|
decoding.
|
||||||
|
"""
|
||||||
|
with monkeypatch.context() as m:
|
||||||
|
m.setenv("VLLM_VIDEO_LOADER_BACKEND", "opencv")
|
||||||
|
loader = VIDEO_LOADER_REGISTRY.load("opencv")
|
||||||
|
|
||||||
|
webm_data = create_live_webm_video(num_frames=20, fps=10)
|
||||||
|
frames, metadata = loader.load_bytes(webm_data, backend="opencv")
|
||||||
|
assert frames.shape[0] == 20
|
||||||
|
assert metadata["total_num_frames"] == 20
|
||||||
|
assert metadata["duration"] == pytest.approx(2.0)
|
||||||
|
|
||||||
|
h264_data = create_raw_h264_video(num_frames=20, fps=25)
|
||||||
|
frames, metadata = loader.load_bytes(h264_data, backend="opencv")
|
||||||
|
assert frames.shape[0] == 20
|
||||||
|
assert metadata["total_num_frames"] == 20
|
||||||
|
assert metadata["duration"] == pytest.approx(0.8)
|
||||||
|
|
||||||
|
# The Qwen samplers used to raise on the bogus negative frame count.
|
||||||
|
qwen_frames, qwen_metadata = Qwen2VLVideoBackend.load_bytes(webm_data)
|
||||||
|
assert qwen_metadata["total_num_frames"] == 20
|
||||||
|
assert qwen_frames.shape[0] >= 4
|
||||||
|
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
# Frame Recovery Tests
|
# Frame Recovery Tests
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||||
|
|
||||||
|
import io
|
||||||
|
|
||||||
import cv2
|
import cv2
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import numpy.typing as npt
|
import numpy.typing as npt
|
||||||
@@ -77,8 +79,6 @@ def create_long_gop_video(
|
|||||||
The marker lets a test recover which frame the decoder actually returned,
|
The marker lets a test recover which frame the decoder actually returned,
|
||||||
independent of any metadata label.
|
independent of any metadata label.
|
||||||
"""
|
"""
|
||||||
import io
|
|
||||||
|
|
||||||
import av
|
import av
|
||||||
|
|
||||||
buf = io.BytesIO()
|
buf = io.BytesIO()
|
||||||
@@ -103,6 +103,63 @@ def create_long_gop_video(
|
|||||||
return buf.getvalue()
|
return buf.getvalue()
|
||||||
|
|
||||||
|
|
||||||
|
def create_live_webm_video(
|
||||||
|
num_frames: int = 20,
|
||||||
|
fps: int = 10,
|
||||||
|
width: int = 64,
|
||||||
|
height: int = 64,
|
||||||
|
) -> bytes:
|
||||||
|
"""Encode a WebM stream without container duration or frame-count metadata.
|
||||||
|
|
||||||
|
The ``live`` muxing option mimics writing to a pipe: the Segment size is
|
||||||
|
unknown and no Duration or Cues elements are written, so decoder backends
|
||||||
|
cannot learn the frame count from the header.
|
||||||
|
"""
|
||||||
|
import av
|
||||||
|
|
||||||
|
buf = io.BytesIO()
|
||||||
|
with av.open(buf, mode="w", format="webm", options={"live": "1"}) as container:
|
||||||
|
stream = container.add_stream("libvpx", rate=fps)
|
||||||
|
stream.width = width
|
||||||
|
stream.height = height
|
||||||
|
stream.pix_fmt = "yuv420p"
|
||||||
|
for i in range(num_frames):
|
||||||
|
img = np.zeros((height, width, 3), dtype=np.uint8)
|
||||||
|
img[:, :, 1] = i % 256
|
||||||
|
frame = av.VideoFrame.from_ndarray(img, format="rgb24")
|
||||||
|
for packet in stream.encode(frame):
|
||||||
|
container.mux(packet)
|
||||||
|
for packet in stream.encode():
|
||||||
|
container.mux(packet)
|
||||||
|
return buf.getvalue()
|
||||||
|
|
||||||
|
|
||||||
|
def create_raw_h264_video(
|
||||||
|
num_frames: int = 20,
|
||||||
|
fps: int = 25,
|
||||||
|
width: int = 64,
|
||||||
|
height: int = 64,
|
||||||
|
) -> bytes:
|
||||||
|
"""Encode a raw H.264 Annex B elementary stream (no container metadata)."""
|
||||||
|
import av
|
||||||
|
|
||||||
|
buf = io.BytesIO()
|
||||||
|
with av.open(buf, mode="w", format="h264") as container:
|
||||||
|
stream = container.add_stream("h264", rate=fps)
|
||||||
|
stream.width = width
|
||||||
|
stream.height = height
|
||||||
|
stream.pix_fmt = "yuv420p"
|
||||||
|
for i in range(num_frames):
|
||||||
|
img = np.zeros((height, width, 3), dtype=np.uint8)
|
||||||
|
img[:, :, 1] = i % 256
|
||||||
|
frame = av.VideoFrame.from_ndarray(img, format="rgb24")
|
||||||
|
for packet in stream.encode(frame):
|
||||||
|
container.mux(packet)
|
||||||
|
for packet in stream.encode():
|
||||||
|
container.mux(packet)
|
||||||
|
return buf.getvalue()
|
||||||
|
|
||||||
|
|
||||||
def create_edit_list_trimmed_video(
|
def create_edit_list_trimmed_video(
|
||||||
num_frames: int = 90,
|
num_frames: int = 90,
|
||||||
trim_start_frame: int = 60,
|
trim_start_frame: int = 60,
|
||||||
@@ -117,8 +174,6 @@ def create_edit_list_trimmed_video(
|
|||||||
trailing frames are presentable — the shape produced by lossless trims
|
trailing frames are presentable — the shape produced by lossless trims
|
||||||
(e.g. ``ffmpeg -ss ... -c copy``). Returns (video_bytes, visible_frames).
|
(e.g. ``ffmpeg -ss ... -c copy``). Returns (video_bytes, visible_frames).
|
||||||
"""
|
"""
|
||||||
import io
|
|
||||||
|
|
||||||
import av
|
import av
|
||||||
|
|
||||||
src = create_long_gop_video(num_frames=num_frames, fps=fps)
|
src = create_long_gop_video(num_frames=num_frames, fps=fps)
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ def test_beam_search_abort_returns_partial_outputs_and_continues_other_prompts(
|
|||||||
|
|
||||||
llm = LLM.__new__(LLM)
|
llm = LLM.__new__(LLM)
|
||||||
llm.llm_engine = Mock()
|
llm.llm_engine = Mock()
|
||||||
|
llm.llm_engine.input_processor.generation_config_fields = {}
|
||||||
tokenizer = SimpleNamespace(
|
tokenizer = SimpleNamespace(
|
||||||
eos_token_id=0,
|
eos_token_id=0,
|
||||||
decode=lambda tokens, skip_special_tokens=False: " ".join(
|
decode=lambda tokens, skip_special_tokens=False: " ".join(
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ class _VllmConfig:
|
|||||||
|
|
||||||
class _InputProcessor:
|
class _InputProcessor:
|
||||||
vllm_config = _VllmConfig()
|
vllm_config = _VllmConfig()
|
||||||
|
generation_config_fields: dict[str, Any] = {}
|
||||||
|
|
||||||
def resolve_watermarking(self, params):
|
def resolve_watermarking(self, params):
|
||||||
return self.vllm_config._check_supports_watermarking(params)
|
return self.vllm_config._check_supports_watermarking(params)
|
||||||
@@ -128,7 +129,7 @@ class _OfflineServing(BeamSearchOfflineMixin):
|
|||||||
self,
|
self,
|
||||||
instances_batch: list[BeamSearchInstance],
|
instances_batch: list[BeamSearchInstance],
|
||||||
base_sampling_params: SamplingParams,
|
base_sampling_params: SamplingParams,
|
||||||
eos_token_id: int | None,
|
eos_token_ids: set[int],
|
||||||
ignore_eos: bool,
|
ignore_eos: bool,
|
||||||
beam_width: int,
|
beam_width: int,
|
||||||
sort_beams_key: Callable[..., Any],
|
sort_beams_key: Callable[..., Any],
|
||||||
@@ -140,6 +141,74 @@ class _OfflineServing(BeamSearchOfflineMixin):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
@pytest.mark.parametrize("offline", [False, True])
|
||||||
|
@pytest.mark.parametrize("config_eos", [None, 11, [0, 11]])
|
||||||
|
@pytest.mark.parametrize("ignore_eos", [False, True])
|
||||||
|
async def test_beam_search_respects_generation_config_eos(
|
||||||
|
monkeypatch, offline: bool, config_eos: int | list[int] | None, ignore_eos: bool
|
||||||
|
) -> None:
|
||||||
|
"""Model-specific end-of-turn tokens must finish beams like tokenizer EOS."""
|
||||||
|
monkeypatch.setattr(
|
||||||
|
_InputProcessor, "generation_config_fields", {"eos_token_id": config_eos}
|
||||||
|
)
|
||||||
|
prompt: TokensInput = {
|
||||||
|
"type": "token",
|
||||||
|
"prompt_token_ids": [1],
|
||||||
|
}
|
||||||
|
params = BeamSearchParams(
|
||||||
|
beam_width=1,
|
||||||
|
max_tokens=3,
|
||||||
|
ignore_eos=ignore_eos,
|
||||||
|
include_stop_str_in_output=True,
|
||||||
|
watermarking=False,
|
||||||
|
)
|
||||||
|
result = await anext(
|
||||||
|
_EngineClient().generate(prompt, SamplingParams(watermarking=False))
|
||||||
|
)
|
||||||
|
result.outputs[0].logprobs = [{11: Logprob(-0.1)}]
|
||||||
|
should_stop = config_eos is not None and not ignore_eos
|
||||||
|
expected_tokens = [11] if should_stop else [11, 11, 11]
|
||||||
|
engine_params: list[SamplingParams] = []
|
||||||
|
|
||||||
|
if offline:
|
||||||
|
offline_serving = _OfflineServing()
|
||||||
|
monkeypatch.setattr(
|
||||||
|
_OfflineServing,
|
||||||
|
"_beam_search_step",
|
||||||
|
BeamSearchOfflineMixin._beam_search_step,
|
||||||
|
)
|
||||||
|
|
||||||
|
def render_and_run_requests(*, params, **kwargs):
|
||||||
|
engine_params.extend(params)
|
||||||
|
return [result]
|
||||||
|
|
||||||
|
monkeypatch.setattr(
|
||||||
|
offline_serving, "_render_and_run_requests", render_and_run_requests
|
||||||
|
)
|
||||||
|
beam = offline_serving.beam_search(cast(list, [prompt]), params)[0].sequences[0]
|
||||||
|
assert beam.tokens == [1, *expected_tokens]
|
||||||
|
else:
|
||||||
|
|
||||||
|
async def generate(engine_prompt, sampling_params, *args, **kwargs):
|
||||||
|
engine_params.append(sampling_params)
|
||||||
|
yield result
|
||||||
|
|
||||||
|
online_serving = _AsyncServing()
|
||||||
|
monkeypatch.setattr(online_serving.engine_client, "generate", generate)
|
||||||
|
output = (
|
||||||
|
await anext(online_serving.beam_search(prompt, "request", params))
|
||||||
|
).outputs[0]
|
||||||
|
assert output.token_ids == expected_tokens
|
||||||
|
assert output.finish_reason == ("stop" if should_stop else "length")
|
||||||
|
assert output.stop_reason == (11 if should_stop else None)
|
||||||
|
|
||||||
|
# The engine validates stop_token_ids against the vocab before it applies
|
||||||
|
# the generation config, so the config EOS ids must not be copied into them.
|
||||||
|
assert engine_params
|
||||||
|
assert all(not p.stop_token_ids for p in engine_params)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_beam_search_handles_extra_logprob_candidates() -> None:
|
async def test_beam_search_handles_extra_logprob_candidates() -> None:
|
||||||
prompt: TokensInput = {
|
prompt: TokensInput = {
|
||||||
|
|||||||
+4
-41
@@ -243,7 +243,7 @@ def test_kda_recoverssm_derivation_is_revalidated():
|
|||||||
config = SimpleNamespace(
|
config = SimpleNamespace(
|
||||||
cache_config=SimpleNamespace(
|
cache_config=SimpleNamespace(
|
||||||
use_replayssm=True,
|
use_replayssm=True,
|
||||||
use_recoverssm=False,
|
use_kda_recoverssm=False,
|
||||||
mamba_cache_mode="none",
|
mamba_cache_mode="none",
|
||||||
replayssm_buffer_len=16,
|
replayssm_buffer_len=16,
|
||||||
),
|
),
|
||||||
@@ -263,7 +263,7 @@ def test_kda_recoverssm_derivation_is_revalidated():
|
|||||||
|
|
||||||
VllmConfig.validate_mamba_cached_kernel(config)
|
VllmConfig.validate_mamba_cached_kernel(config)
|
||||||
assert config.cache_config.use_replayssm
|
assert config.cache_config.use_replayssm
|
||||||
assert config.cache_config.use_recoverssm
|
assert config.cache_config.use_kda_recoverssm
|
||||||
|
|
||||||
config.cache_config.mamba_cache_mode = "align"
|
config.cache_config.mamba_cache_mode = "align"
|
||||||
VllmConfig.validate_mamba_cached_kernel(config)
|
VllmConfig.validate_mamba_cached_kernel(config)
|
||||||
@@ -276,7 +276,7 @@ def test_kda_recoverssm_derivation_is_revalidated():
|
|||||||
config.model_config.architecture = "NemotronHForCausalLM"
|
config.model_config.architecture = "NemotronHForCausalLM"
|
||||||
config.mamba_config.backend = MambaBackendEnum.FLASHINFER
|
config.mamba_config.backend = MambaBackendEnum.FLASHINFER
|
||||||
VllmConfig.validate_mamba_cached_kernel(config)
|
VllmConfig.validate_mamba_cached_kernel(config)
|
||||||
assert not config.cache_config.use_recoverssm
|
assert not config.cache_config.use_kda_recoverssm
|
||||||
|
|
||||||
config.model_config.architecture = "KimiLinearForCausalLM"
|
config.model_config.architecture = "KimiLinearForCausalLM"
|
||||||
config.parallel_config.pipeline_parallel_size = 2
|
config.parallel_config.pipeline_parallel_size = 2
|
||||||
@@ -1590,9 +1590,7 @@ def test_engram_tensor_parallel_size(dp_size: int, across_dp: bool, expected: in
|
|||||||
assert config.get_parallel_size(parallel) == expected
|
assert config.get_parallel_size(parallel) == expected
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize("option", ["embedding_across_dp", "dp_shared_memory"])
|
||||||
"option", ["embedding_across_dp", "dp_shared_memory", "host_file_gather"]
|
|
||||||
)
|
|
||||||
def test_engram_rejects_elastic_cross_dp(option):
|
def test_engram_rejects_elastic_cross_dp(option):
|
||||||
parallel = ParallelConfig(
|
parallel = ParallelConfig(
|
||||||
tensor_parallel_size=4,
|
tensor_parallel_size=4,
|
||||||
@@ -1816,47 +1814,12 @@ def test_engram_draft_config_validates_target(monkeypatch, target_has_ple, expli
|
|||||||
assert config.engram_config.cpu_offload is True
|
assert config.engram_config.cpu_offload is True
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
("architecture", "layer_field", "rocm", "expect_error"),
|
|
||||||
[
|
|
||||||
pytest.param(
|
|
||||||
"DeepseekV41ForCausalLM", "engram_layer_ids", False, True, id="deepseek"
|
|
||||||
),
|
|
||||||
pytest.param(
|
|
||||||
"Qwen4ExpForCausalLM", "ple_layer_ids", True, True, id="qwen4exp_rocm"
|
|
||||||
),
|
|
||||||
pytest.param(
|
|
||||||
"Qwen4ExpForCausalLM", "ple_layer_ids", False, False, id="qwen4exp_cuda"
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
def test_engram_host_file_gather_requires_cuda_qwen4exp(
|
|
||||||
monkeypatch, architecture, layer_field, rocm, expect_error
|
|
||||||
):
|
|
||||||
monkeypatch.setattr(current_platform, "is_cuda_alike", lambda: True)
|
|
||||||
monkeypatch.setattr(current_platform, "is_rocm", lambda: rocm)
|
|
||||||
model = cast(
|
|
||||||
ModelConfig,
|
|
||||||
SimpleNamespace(
|
|
||||||
architecture=architecture,
|
|
||||||
hf_text_config=SimpleNamespace(**{layer_field: [1]}),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
config = EngramConfig(host_file_gather=True)
|
|
||||||
if expect_error:
|
|
||||||
with pytest.raises(ValueError, match="host_file_gather"):
|
|
||||||
config.verify_model_config(model)
|
|
||||||
else:
|
|
||||||
config.verify_model_config(model)
|
|
||||||
|
|
||||||
|
|
||||||
def test_engram_hash_tracks_execution_options():
|
def test_engram_hash_tracks_execution_options():
|
||||||
configs = [
|
configs = [
|
||||||
EngramConfig(cpu_offload=True),
|
EngramConfig(cpu_offload=True),
|
||||||
EngramConfig(cpu_offload=False),
|
EngramConfig(cpu_offload=False),
|
||||||
EngramConfig(cpu_offload=True, embedding_across_dp=True),
|
EngramConfig(cpu_offload=True, embedding_across_dp=True),
|
||||||
EngramConfig(cpu_offload=True, dp_shared_memory=True),
|
EngramConfig(cpu_offload=True, dp_shared_memory=True),
|
||||||
EngramConfig(host_file_gather=True),
|
|
||||||
]
|
]
|
||||||
assert len({config.compute_hash() for config in configs}) == len(configs)
|
assert len({config.compute_hash() for config in configs}) == len(configs)
|
||||||
|
|
||||||
|
|||||||
@@ -1014,77 +1014,6 @@ def test_predictor_matches_allocator_blocks_calculation_with_admission_cap():
|
|||||||
total_computed = num_tokens
|
total_computed = num_tokens
|
||||||
|
|
||||||
|
|
||||||
def test_mamba_honors_drop_eagle_block():
|
|
||||||
"""MambaManager must drop the EAGLE lookahead block, like FullAttentionManager.
|
|
||||||
|
|
||||||
EAGLE/MTP requires the final matched block of a cache hit be dropped and
|
|
||||||
recomputed: it can hold state written over draft positions that verification
|
|
||||||
later rejects. FullAttentionManager pops it. Before this fix MambaManager
|
|
||||||
accepted `drop_eagle_block` and ignored it, so its hit came back one block
|
|
||||||
longer, and the retained block's recurrent-state snapshot -- taken over the
|
|
||||||
unverified positions -- stayed hash-reachable for every later request sharing
|
|
||||||
the prefix (#43559).
|
|
||||||
|
|
||||||
block_size == alignment_tokens here, so the alignment loop is a no-op in both
|
|
||||||
managers and the eagle drop is the only behavior under test.
|
|
||||||
"""
|
|
||||||
block_size = 16
|
|
||||||
num_blocks = 5
|
|
||||||
full_gid, mamba_gid = 0, 1
|
|
||||||
|
|
||||||
block_pool = BlockPool(
|
|
||||||
num_gpu_blocks=64, enable_caching=True, hash_block_size=block_size
|
|
||||||
)
|
|
||||||
block_hashes = [BlockHash(f"blk{i:04d}".encode()) for i in range(num_blocks)]
|
|
||||||
|
|
||||||
# Cache the same prefix chain under both groups, each on real blocks.
|
|
||||||
for gid in (full_gid, mamba_gid):
|
|
||||||
for i, (block_hash, block) in enumerate(
|
|
||||||
zip(block_hashes, block_pool.get_new_blocks(num_blocks))
|
|
||||||
):
|
|
||||||
block_pool._insert_block_hash(
|
|
||||||
make_block_hash_with_group_id(block_hash, gid),
|
|
||||||
block,
|
|
||||||
num_tokens=(i + 1) * block_size,
|
|
||||||
)
|
|
||||||
|
|
||||||
full_spec = FullAttentionSpec(
|
|
||||||
block_size=block_size, num_kv_heads=1, head_size=1, dtype=torch.float16
|
|
||||||
)
|
|
||||||
mamba_spec = MambaSpec(
|
|
||||||
block_size=block_size,
|
|
||||||
shapes=((1,),),
|
|
||||||
dtypes=(torch.float16,),
|
|
||||||
mamba_cache_mode="align",
|
|
||||||
)
|
|
||||||
|
|
||||||
def hit_blocks(manager, gid, spec, drop_eagle_block):
|
|
||||||
return len(
|
|
||||||
manager.find_longest_cache_hit(
|
|
||||||
block_hashes=block_hashes,
|
|
||||||
max_length=num_blocks * block_size,
|
|
||||||
kv_cache_group_ids=[gid],
|
|
||||||
block_pool=block_pool,
|
|
||||||
kv_cache_spec=spec,
|
|
||||||
drop_eagle_block=drop_eagle_block,
|
|
||||||
alignment_tokens=block_size,
|
|
||||||
)[0][0]
|
|
||||||
)
|
|
||||||
|
|
||||||
# Control: with no eagle drop, both groups see the whole cached prefix.
|
|
||||||
assert hit_blocks(FullAttentionManager, full_gid, full_spec, False) == num_blocks
|
|
||||||
assert hit_blocks(MambaManager, mamba_gid, mamba_spec, False) == num_blocks
|
|
||||||
|
|
||||||
# With the eagle drop requested, both must give up the final block.
|
|
||||||
full_hit = hit_blocks(FullAttentionManager, full_gid, full_spec, True)
|
|
||||||
mamba_hit = hit_blocks(MambaManager, mamba_gid, mamba_spec, True)
|
|
||||||
assert full_hit == num_blocks - 1
|
|
||||||
assert mamba_hit == full_hit, (
|
|
||||||
f"MambaManager ignored drop_eagle_block: full-attention dropped the "
|
|
||||||
f"lookahead block (hit={full_hit}), mamba kept it (hit={mamba_hit})"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def test_pop_blocks_for_free_trims_null_head():
|
def test_pop_blocks_for_free_trims_null_head():
|
||||||
block_size = 2
|
block_size = 2
|
||||||
spec = SlidingWindowSpec(
|
spec = SlidingWindowSpec(
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ def _create_decode_vllm_config(
|
|||||||
num_speculative_tokens: int = 0,
|
num_speculative_tokens: int = 0,
|
||||||
dynamic_spec_schedule: list[tuple[int, int, int]] | None = None,
|
dynamic_spec_schedule: list[tuple[int, int, int]] | None = None,
|
||||||
max_num_seqs: int = 8,
|
max_num_seqs: int = 8,
|
||||||
use_recoverssm: bool = False,
|
use_kda_recoverssm: bool = False,
|
||||||
) -> MagicMock:
|
) -> MagicMock:
|
||||||
compilation_config = CompilationConfig(
|
compilation_config = CompilationConfig(
|
||||||
cudagraph_mode=CUDAGraphMode.FULL_AND_PIECEWISE,
|
cudagraph_mode=CUDAGraphMode.FULL_AND_PIECEWISE,
|
||||||
@@ -331,7 +331,7 @@ def _create_decode_vllm_config(
|
|||||||
max_num_seqs=max_num_seqs
|
max_num_seqs=max_num_seqs
|
||||||
)
|
)
|
||||||
vllm_config.parallel_config = ParallelConfig()
|
vllm_config.parallel_config = ParallelConfig()
|
||||||
vllm_config.cache_config = SimpleNamespace(use_recoverssm=use_recoverssm)
|
vllm_config.cache_config = SimpleNamespace(use_kda_recoverssm=use_kda_recoverssm)
|
||||||
vllm_config.num_speculative_tokens = num_speculative_tokens
|
vllm_config.num_speculative_tokens = num_speculative_tokens
|
||||||
if dynamic_spec_schedule is None:
|
if dynamic_spec_schedule is None:
|
||||||
vllm_config.speculative_config = None
|
vllm_config.speculative_config = None
|
||||||
@@ -350,7 +350,7 @@ def _make_spec_decode_manager(
|
|||||||
num_speculative_tokens: int = 0,
|
num_speculative_tokens: int = 0,
|
||||||
dynamic_spec_schedule: list[tuple[int, int, int]] | None = None,
|
dynamic_spec_schedule: list[tuple[int, int, int]] | None = None,
|
||||||
max_num_seqs: int = 8,
|
max_num_seqs: int = 8,
|
||||||
use_recoverssm: bool = False,
|
use_kda_recoverssm: bool = False,
|
||||||
varlen_decode: bool = False,
|
varlen_decode: bool = False,
|
||||||
) -> gpu_cudagraph_utils.CudaGraphManager:
|
) -> gpu_cudagraph_utils.CudaGraphManager:
|
||||||
monkeypatch.setattr(
|
monkeypatch.setattr(
|
||||||
@@ -369,7 +369,7 @@ def _make_spec_decode_manager(
|
|||||||
num_speculative_tokens=num_speculative_tokens,
|
num_speculative_tokens=num_speculative_tokens,
|
||||||
dynamic_spec_schedule=dynamic_spec_schedule,
|
dynamic_spec_schedule=dynamic_spec_schedule,
|
||||||
max_num_seqs=max_num_seqs,
|
max_num_seqs=max_num_seqs,
|
||||||
use_recoverssm=use_recoverssm,
|
use_kda_recoverssm=use_kda_recoverssm,
|
||||||
),
|
),
|
||||||
device=torch.device("cpu"),
|
device=torch.device("cpu"),
|
||||||
cudagraph_mode=CUDAGraphMode.FULL_AND_PIECEWISE,
|
cudagraph_mode=CUDAGraphMode.FULL_AND_PIECEWISE,
|
||||||
|
|||||||
@@ -1021,102 +1021,6 @@ def _run_mamba_prefix_cache_mrv1(
|
|||||||
cleanup_dist_env_and_memory()
|
cleanup_dist_env_and_memory()
|
||||||
|
|
||||||
|
|
||||||
def _run_mamba_eagle_block_reuse(
|
|
||||||
monkeypatch: pytest.MonkeyPatch, async_scheduling: bool
|
|
||||||
):
|
|
||||||
"""Recreate the #43559 failure conditions: a request finishing right after a
|
|
||||||
block boundary it crossed with every draft rejected, then a second request
|
|
||||||
whose cache hit lands on that final (eagle) block.
|
|
||||||
|
|
||||||
Request A ends a few tokens past the 2nd aligned boundary; with
|
|
||||||
num_accepted_tokens=1 every boundary crossing happens with rejected drafts
|
|
||||||
in flight, and A finishes before any later step could repair its cached
|
|
||||||
snapshot. Request B shares the prefix: pre-fix MambaManager returns the
|
|
||||||
boundary block as part of the hit (B resumes on the possibly-poisoned
|
|
||||||
snapshot), post-fix the hit stops one block earlier and B recomputes it.
|
|
||||||
|
|
||||||
Assertions, all deterministic:
|
|
||||||
1. B's num_cached_tokens == BLOCK_SIZE (the eagle block was dropped).
|
|
||||||
2. A's cached snapshot at the boundary matches the no-spec reference.
|
|
||||||
3. B's state at its next boundary matches the reference -- corruption
|
|
||||||
resumed from the reused block would surface here (the user-visible
|
|
||||||
failure, at state level).
|
|
||||||
"""
|
|
||||||
global async_scheduling_mode
|
|
||||||
async_scheduling_mode = async_scheduling
|
|
||||||
run_ref_mamba_state_in_subprocess()
|
|
||||||
apply_patch(monkeypatch)
|
|
||||||
full_prompt = datasets.load_dataset("heheda/a_long_article")["train"][0]["text"]
|
|
||||||
|
|
||||||
engine = LLM(
|
|
||||||
model=MODEL,
|
|
||||||
load_format="dummy",
|
|
||||||
enable_prefix_caching=True,
|
|
||||||
block_size=BLOCK_SIZE,
|
|
||||||
mamba_cache_mode="align",
|
|
||||||
speculative_config={
|
|
||||||
"method": "qwen3_next_mtp",
|
|
||||||
"num_speculative_tokens": num_speculative_tokens,
|
|
||||||
},
|
|
||||||
max_num_batched_tokens=3072,
|
|
||||||
hf_overrides={"num_hidden_layers": NUM_HIDDEN_LAYERS},
|
|
||||||
async_scheduling=async_scheduling,
|
|
||||||
seed=42,
|
|
||||||
)
|
|
||||||
global prompt_token_ids
|
|
||||||
prompt_token_ids = engine.get_tokenizer().encode(full_prompt)
|
|
||||||
global num_accepted_tokens
|
|
||||||
num_accepted_tokens = 1
|
|
||||||
global cur_step_action_idx, step_actions
|
|
||||||
cur_step_action_idx = 0
|
|
||||||
step_actions = []
|
|
||||||
|
|
||||||
boundary = BLOCK_SIZE * 2
|
|
||||||
# A decodes across BOTH boundaries (align mode only snapshots state at
|
|
||||||
# decode/chunk crossings, and B needs a fallback state block once the
|
|
||||||
# eagle block is dropped), rejecting 3 drafts every step, and finishes
|
|
||||||
# a few tokens past the second boundary -- no later step can repair the
|
|
||||||
# cached snapshot.
|
|
||||||
engine.generate(
|
|
||||||
[TokensPrompt(prompt_token_ids=prompt_token_ids[: BLOCK_SIZE - 2])],
|
|
||||||
SamplingParams(temperature=0.0, max_tokens=BLOCK_SIZE + 10),
|
|
||||||
)
|
|
||||||
a_boundary_state = mamba_kv_cache_dict.get(boundary)
|
|
||||||
assert a_boundary_state is not None, "A never cached the boundary block"
|
|
||||||
mamba_kv_cache_dict.clear()
|
|
||||||
|
|
||||||
# B: prefix through the boundary, prompt ending shy of the next one so a
|
|
||||||
# few decode steps cross it and its state gets captured for comparison.
|
|
||||||
next_boundary = BLOCK_SIZE * 3
|
|
||||||
(out_b,) = engine.generate(
|
|
||||||
[TokensPrompt(prompt_token_ids=prompt_token_ids[: next_boundary - 10])],
|
|
||||||
SamplingParams(temperature=0.0, max_tokens=15),
|
|
||||||
)
|
|
||||||
assert out_b.num_cached_tokens == BLOCK_SIZE, (
|
|
||||||
f"cache hit must drop the eagle block: expected {BLOCK_SIZE} cached "
|
|
||||||
f"tokens, got {out_b.num_cached_tokens}"
|
|
||||||
)
|
|
||||||
|
|
||||||
mamba_state_ref = torch.load("mamba_kv_cache_dict_ref.pth")
|
|
||||||
check_mamba_state_equal(mamba_state_ref, {boundary: a_boundary_state}, [boundary])
|
|
||||||
check_mamba_state_equal(mamba_state_ref, mamba_kv_cache_dict, [next_boundary])
|
|
||||||
|
|
||||||
mamba_kv_cache_dict.clear()
|
|
||||||
del engine
|
|
||||||
torch.accelerator.empty_cache()
|
|
||||||
cleanup_dist_env_and_memory()
|
|
||||||
|
|
||||||
|
|
||||||
@create_new_process_for_each_test("spawn")
|
|
||||||
def test_mamba_eagle_block_reuse_mrv1(monkeypatch: pytest.MonkeyPatch):
|
|
||||||
_run_mamba_eagle_block_reuse(monkeypatch, async_scheduling=False)
|
|
||||||
|
|
||||||
|
|
||||||
@create_new_process_for_each_test("spawn")
|
|
||||||
def test_mamba_eagle_block_reuse_mrv1_async(monkeypatch: pytest.MonkeyPatch):
|
|
||||||
_run_mamba_eagle_block_reuse(monkeypatch, async_scheduling=True)
|
|
||||||
|
|
||||||
|
|
||||||
@create_new_process_for_each_test("spawn")
|
@create_new_process_for_each_test("spawn")
|
||||||
def test_mamba_prefix_cache_mrv1(monkeypatch: pytest.MonkeyPatch):
|
def test_mamba_prefix_cache_mrv1(monkeypatch: pytest.MonkeyPatch):
|
||||||
_run_mamba_prefix_cache_mrv1(monkeypatch, async_scheduling=False)
|
_run_mamba_prefix_cache_mrv1(monkeypatch, async_scheduling=False)
|
||||||
|
|||||||
@@ -1,78 +0,0 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
||||||
|
|
||||||
"""Dense-MTP-head detection for pack-quantized checkpoints (#58807).
|
|
||||||
|
|
||||||
The whole fix hinges on reading the checkpoint's actual tensor names, so the
|
|
||||||
tests pin the naming contract: dense means plain `mtp.*.weight` keys with no
|
|
||||||
quantization artifact suffix anywhere under `mtp.`.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import json
|
|
||||||
from types import SimpleNamespace
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from vllm.model_executor.models.qwen3_5_mtp import (
|
|
||||||
_checkpoint_ships_dense_mtp,
|
|
||||||
_mtp_weight_names,
|
|
||||||
)
|
|
||||||
|
|
||||||
pytestmark = pytest.mark.cpu_test
|
|
||||||
|
|
||||||
|
|
||||||
def _model_config_with_index(monkeypatch, names):
|
|
||||||
monkeypatch.setattr(
|
|
||||||
"vllm.model_executor.models.qwen3_5_mtp._mtp_weight_names",
|
|
||||||
lambda _config: names,
|
|
||||||
)
|
|
||||||
return SimpleNamespace()
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
"names,expected",
|
|
||||||
[
|
|
||||||
# The reporter's checkpoint: every mtp.* tensor dense.
|
|
||||||
(["mtp.fc.weight", "mtp.layers.0.mlp.down_proj.weight"], True),
|
|
||||||
# Biases are dense too and must not count as artifacts.
|
|
||||||
(["mtp.fc.weight", "mtp.fc.bias"], True),
|
|
||||||
# A properly pack-quantized MTP head keeps the target quantization.
|
|
||||||
(["mtp.fc.weight_packed", "mtp.fc.weight_scale"], False),
|
|
||||||
# Channel-wise quantized MTP head: dense name plus scale companion.
|
|
||||||
(["mtp.fc.weight", "mtp.fc.weight_scale"], False),
|
|
||||||
# No MTP head in the checkpoint at all.
|
|
||||||
(["model.layers.0.self_attn.q_proj.weight"], False),
|
|
||||||
# Layout unknown (no index): keep current behavior.
|
|
||||||
(None, False),
|
|
||||||
([], False),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
def test_dense_mtp_detection(monkeypatch, names, expected):
|
|
||||||
config = _model_config_with_index(monkeypatch, names)
|
|
||||||
assert _checkpoint_ships_dense_mtp(config) is expected
|
|
||||||
|
|
||||||
|
|
||||||
def test_weight_names_read_from_local_index(tmp_path, monkeypatch):
|
|
||||||
index = {
|
|
||||||
"weight_map": {
|
|
||||||
"model.layers.0.self_attn.q_proj.weight_packed": "model-00001.safetensors",
|
|
||||||
"mtp.fc.weight": "model-mtp-bf16.safetensors",
|
|
||||||
"mtp.layers.0.mlp.down_proj.weight": "model-mtp-bf16.safetensors",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
(tmp_path / "model.safetensors.index.json").write_text(json.dumps(index))
|
|
||||||
config = SimpleNamespace(model=str(tmp_path), revision=None)
|
|
||||||
|
|
||||||
names = _mtp_weight_names(config)
|
|
||||||
|
|
||||||
assert names == ["mtp.fc.weight", "mtp.layers.0.mlp.down_proj.weight"]
|
|
||||||
|
|
||||||
|
|
||||||
def test_weight_names_none_without_index(tmp_path, monkeypatch):
|
|
||||||
monkeypatch.setattr(
|
|
||||||
"vllm.model_executor.models.qwen3_5_mtp.huggingface_hub.hf_hub_download",
|
|
||||||
lambda *args, **kwargs: (_ for _ in ()).throw(FileNotFoundError()),
|
|
||||||
)
|
|
||||||
config = SimpleNamespace(model=str(tmp_path), revision=None)
|
|
||||||
|
|
||||||
assert _mtp_weight_names(config) is None
|
|
||||||
@@ -59,6 +59,7 @@ CHECK_IMPORTS = {
|
|||||||
"vllm/distributed/device_communicators/shm_tensor_arena.py",
|
"vllm/distributed/device_communicators/shm_tensor_arena.py",
|
||||||
"vllm/distributed/weight_transfer/ipc_engine.py",
|
"vllm/distributed/weight_transfer/ipc_engine.py",
|
||||||
"vllm/distributed/weight_transfer/clients.py",
|
"vllm/distributed/weight_transfer/clients.py",
|
||||||
|
"examples/rl/rlhf_http_ipc_no_vllm.py",
|
||||||
"vllm/model_executor/model_loader/weight_cache/protocol.py",
|
"vllm/model_executor/model_loader/weight_cache/protocol.py",
|
||||||
"tests/distributed/test_shm_broadcast.py",
|
"tests/distributed/test_shm_broadcast.py",
|
||||||
"tests/distributed/test_weight_transfer.py",
|
"tests/distributed/test_weight_transfer.py",
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ class CacheConfig:
|
|||||||
prefix caching yet. Mamba2 speculative decode requires FlashInfer. With
|
prefix caching yet. Mamba2 speculative decode requires FlashInfer. With
|
||||||
prefix caching, flushes are most efficient when mamba_block_size is a
|
prefix caching, flushes are most efficient when mamba_block_size is a
|
||||||
multiple of replayssm_buffer_len, but this is not required."""
|
multiple of replayssm_buffer_len, but this is not required."""
|
||||||
use_recoverssm: bool = field(default=False, init=False)
|
use_kda_recoverssm: bool = field(default=False, init=False)
|
||||||
"""Whether Kimi-K3 KDA uses RecoverSSM speculative decode."""
|
"""Whether Kimi-K3 KDA uses RecoverSSM speculative decode."""
|
||||||
|
|
||||||
# Will be set after profiling.
|
# Will be set after profiling.
|
||||||
|
|||||||
@@ -1428,15 +1428,10 @@ class CompilationConfig:
|
|||||||
f"with {min_cg_attn_backend} backend (support: "
|
f"with {min_cg_attn_backend} backend (support: "
|
||||||
f"{min_cg_support})"
|
f"{min_cg_support})"
|
||||||
)
|
)
|
||||||
if (
|
if self.mode == CompilationMode.VLLM_COMPILE and (
|
||||||
self.mode == CompilationMode.VLLM_COMPILE
|
self.splitting_ops_contain_attention()
|
||||||
and (
|
or self.use_inductor_graph_partition
|
||||||
self.splitting_ops_contain_attention()
|
):
|
||||||
or self.use_inductor_graph_partition
|
|
||||||
)
|
|
||||||
) or envs.VLLM_USE_BREAKABLE_CUDAGRAPH:
|
|
||||||
# Breakable CUDA graphs break at the attention kernels at runtime,
|
|
||||||
# with or without torch.compile.
|
|
||||||
msg += (
|
msg += (
|
||||||
"; setting cudagraph_mode=PIECEWISE because "
|
"; setting cudagraph_mode=PIECEWISE because "
|
||||||
"attention is compiled piecewise"
|
"attention is compiled piecewise"
|
||||||
|
|||||||
@@ -37,11 +37,6 @@ class EngramConfig:
|
|||||||
cpu_offload: bool = True
|
cpu_offload: bool = True
|
||||||
"""Store embedding weights in pinned CPU memory for UVA lookup."""
|
"""Store embedding weights in pinned CPU memory for UVA lookup."""
|
||||||
|
|
||||||
host_file_gather: bool = False
|
|
||||||
"""Serve Qwen4Exp PLE rows by gathering them on the CPU from the loader's
|
|
||||||
file-backed checkpoint views and staging them on the device each step,
|
|
||||||
instead of allocating the table; takes precedence over `cpu_offload`."""
|
|
||||||
|
|
||||||
embedding_across_dp: bool = False
|
embedding_across_dp: bool = False
|
||||||
"""Shard embeddings across TP and all DP ranks when enabled.
|
"""Shard embeddings across TP and all DP ranks when enabled.
|
||||||
Otherwise, each DP rank has a separate TP-sharded embedding replica."""
|
Otherwise, each DP rank has a separate TP-sharded embedding replica."""
|
||||||
@@ -71,8 +66,6 @@ class EngramConfig:
|
|||||||
|
|
||||||
def verify_model_config(self, model_config: "ModelConfig | None") -> None:
|
def verify_model_config(self, model_config: "ModelConfig | None") -> None:
|
||||||
"""Reject Engram configuration for models without n-gram embeddings."""
|
"""Reject Engram configuration for models without n-gram embeddings."""
|
||||||
from vllm.platforms import current_platform
|
|
||||||
|
|
||||||
field = (
|
field = (
|
||||||
_NGRAM_LAYER_FIELDS.get(model_config.architecture)
|
_NGRAM_LAYER_FIELDS.get(model_config.architecture)
|
||||||
if model_config is not None
|
if model_config is not None
|
||||||
@@ -87,10 +80,6 @@ class EngramConfig:
|
|||||||
"EngramConfig requires a model with supported Engram "
|
"EngramConfig requires a model with supported Engram "
|
||||||
"embeddings and non-empty n-gram layer ids."
|
"embeddings and non-empty n-gram layer ids."
|
||||||
)
|
)
|
||||||
if self.host_file_gather and (
|
|
||||||
field != "ple_layer_ids" or current_platform.is_rocm()
|
|
||||||
):
|
|
||||||
raise ValueError("host_file_gather requires a Qwen4Exp model on CUDA")
|
|
||||||
|
|
||||||
def resolve_dp_shared_memory(self, parallel_config: "ParallelConfig") -> None:
|
def resolve_dp_shared_memory(self, parallel_config: "ParallelConfig") -> None:
|
||||||
"""Share host tables by default wherever the configuration permits."""
|
"""Share host tables by default wherever the configuration permits."""
|
||||||
@@ -117,8 +106,6 @@ class EngramConfig:
|
|||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Engram embedding_across_dp is not supported with elastic EP yet."
|
"Engram embedding_across_dp is not supported with elastic EP yet."
|
||||||
)
|
)
|
||||||
if self.host_file_gather and parallel_config.enable_elastic_ep:
|
|
||||||
raise ValueError("host_file_gather is not supported with elastic EP.")
|
|
||||||
|
|
||||||
def get_parallel_size(self, parallel_config: "ParallelConfig") -> int:
|
def get_parallel_size(self, parallel_config: "ParallelConfig") -> int:
|
||||||
"""Derive the embedding group size from the parallel configuration."""
|
"""Derive the embedding group size from the parallel configuration."""
|
||||||
|
|||||||
+3
-27
@@ -73,19 +73,6 @@ class PrefetchOffloadConfig:
|
|||||||
parameters of each offloaded layer are offloaded.
|
parameters of each offloaded layer are offloaded.
|
||||||
Uses segment matching: "w13_weight" matches "mlp.experts.w13_weight"
|
Uses segment matching: "w13_weight" matches "mlp.experts.w13_weight"
|
||||||
but not "mlp.experts.w13_weight_scale".
|
but not "mlp.experts.w13_weight_scale".
|
||||||
Applies to decoder layers only; `offload_towers` offloads the full
|
|
||||||
tower regardless of this set.
|
|
||||||
"""
|
|
||||||
|
|
||||||
offload_towers: bool = False
|
|
||||||
"""Offload multimodal tower weights (vision/audio encoders) to pinned
|
|
||||||
host memory, and bulk-copy them to the GPU during each encoder forward.
|
|
||||||
Towers hold no VRAM between image encodes. Unlike UVA zero-copy, weights
|
|
||||||
are streamed with whole-tensor H2D copies instead of being re-read tile
|
|
||||||
by tile inside the GEMM inner loops, so encode cost stays near the
|
|
||||||
resident-tower baseline.
|
|
||||||
Works together with, or instead of, layer prefetch:
|
|
||||||
`offload_group_size` may be 0 when only towers are offloaded.
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@@ -96,8 +83,7 @@ class OffloadConfig:
|
|||||||
offload_backend: OffloadBackend = "auto"
|
offload_backend: OffloadBackend = "auto"
|
||||||
"""The backend for weight offloading. Options:
|
"""The backend for weight offloading. Options:
|
||||||
- "auto": Selects based on which sub-config has non-default values
|
- "auto": Selects based on which sub-config has non-default values
|
||||||
(prefetch if offload_group_size > 0 or offload_towers, uva if
|
(prefetch if offload_group_size > 0, uva if cpu_offload_gb > 0).
|
||||||
cpu_offload_gb > 0).
|
|
||||||
- "uva": UVA (Unified Virtual Addressing) zero-copy offloading.
|
- "uva": UVA (Unified Virtual Addressing) zero-copy offloading.
|
||||||
- "prefetch": Async prefetch with group-based layer offloading.
|
- "prefetch": Async prefetch with group-based layer offloading.
|
||||||
"""
|
"""
|
||||||
@@ -111,15 +97,7 @@ class OffloadConfig:
|
|||||||
@model_validator(mode="after")
|
@model_validator(mode="after")
|
||||||
def validate_offload_config(self) -> "OffloadConfig":
|
def validate_offload_config(self) -> "OffloadConfig":
|
||||||
"""Validate offload configuration constraints."""
|
"""Validate offload configuration constraints."""
|
||||||
layer_offload = self.prefetch.offload_group_size > 0
|
if self.offload_backend == "prefetch" or self.prefetch.offload_group_size > 0:
|
||||||
if self.offload_backend == "prefetch" and not (
|
|
||||||
layer_offload or self.prefetch.offload_towers
|
|
||||||
):
|
|
||||||
raise ValueError(
|
|
||||||
"offload_backend='prefetch' requires offload_group_size > 0"
|
|
||||||
" or offload_towers=True"
|
|
||||||
)
|
|
||||||
if layer_offload:
|
|
||||||
if self.prefetch.offload_num_in_group > self.prefetch.offload_group_size:
|
if self.prefetch.offload_num_in_group > self.prefetch.offload_group_size:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"offload_num_in_group ({self.prefetch.offload_num_in_group})"
|
f"offload_num_in_group ({self.prefetch.offload_num_in_group})"
|
||||||
@@ -136,9 +114,7 @@ class OffloadConfig:
|
|||||||
|
|
||||||
# Warn if both backends have non-default values
|
# Warn if both backends have non-default values
|
||||||
uva_active = self.uva.cpu_offload_gb > 0
|
uva_active = self.uva.cpu_offload_gb > 0
|
||||||
prefetch_active = (
|
prefetch_active = self.prefetch.offload_group_size > 0
|
||||||
self.prefetch.offload_group_size > 0 or self.prefetch.offload_towers
|
|
||||||
)
|
|
||||||
if self.offload_backend == "uva" and prefetch_active:
|
if self.offload_backend == "uva" and prefetch_active:
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
"Prefetch offload fields are set but offload_backend='uva'. "
|
"Prefetch offload fields are set but offload_backend='uva'. "
|
||||||
|
|||||||
+6
-35
@@ -71,13 +71,6 @@ else:
|
|||||||
|
|
||||||
logger = init_logger(__name__)
|
logger = init_logger(__name__)
|
||||||
|
|
||||||
# Architectures whose GDN (and PLE) layers run RecoverSSM under --use-replayssm.
|
|
||||||
_QWEN4EXP_RECOVERSSM_ARCHS = (
|
|
||||||
"Qwen4ExpForCausalLM",
|
|
||||||
"Qwen4ExpForConditionalGeneration",
|
|
||||||
"Qwen4ExpMTP",
|
|
||||||
)
|
|
||||||
|
|
||||||
DEFAULT_BREAKABLE_CUDAGRAPH_ARCHITECTURES = frozenset(
|
DEFAULT_BREAKABLE_CUDAGRAPH_ARCHITECTURES = frozenset(
|
||||||
{
|
{
|
||||||
"AliceAIForCausalLM",
|
"AliceAIForCausalLM",
|
||||||
@@ -3419,8 +3412,9 @@ class VllmConfig:
|
|||||||
@model_validator(mode="after")
|
@model_validator(mode="after")
|
||||||
def validate_mamba_cached_kernel(self) -> "VllmConfig":
|
def validate_mamba_cached_kernel(self) -> "VllmConfig":
|
||||||
if not self.cache_config.use_replayssm:
|
if not self.cache_config.use_replayssm:
|
||||||
self.cache_config.use_recoverssm = False
|
self.cache_config.use_kda_recoverssm = False
|
||||||
return self
|
return self
|
||||||
|
|
||||||
kda_architectures = (
|
kda_architectures = (
|
||||||
"KimiLinearForCausalLM",
|
"KimiLinearForCausalLM",
|
||||||
"KimiK3ForConditionalGeneration",
|
"KimiK3ForConditionalGeneration",
|
||||||
@@ -3429,15 +3423,11 @@ class VllmConfig:
|
|||||||
self.model_config is not None
|
self.model_config is not None
|
||||||
and self.model_config.architecture in kda_architectures
|
and self.model_config.architecture in kda_architectures
|
||||||
)
|
)
|
||||||
is_qwen4exp_recoverssm_model = (
|
self.cache_config.use_kda_recoverssm = (
|
||||||
self.model_config is not None
|
self.num_speculative_tokens > 0 and is_kda_model
|
||||||
and self.model_config.architecture in _QWEN4EXP_RECOVERSSM_ARCHS
|
|
||||||
)
|
|
||||||
self.cache_config.use_recoverssm = self.num_speculative_tokens > 0 and (
|
|
||||||
is_kda_model or is_qwen4exp_recoverssm_model
|
|
||||||
)
|
)
|
||||||
use_mamba_replayssm_spec = (
|
use_mamba_replayssm_spec = (
|
||||||
self.num_speculative_tokens > 0 and not self.cache_config.use_recoverssm
|
self.num_speculative_tokens > 0 and not self.cache_config.use_kda_recoverssm
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.model_config is not None and not self.model_config.supports_replayssm:
|
if self.model_config is not None and not self.model_config.supports_replayssm:
|
||||||
@@ -3445,17 +3435,6 @@ class VllmConfig:
|
|||||||
"--use-replayssm is not supported for architecture "
|
"--use-replayssm is not supported for architecture "
|
||||||
f"{self.model_config.architecture!r}"
|
f"{self.model_config.architecture!r}"
|
||||||
)
|
)
|
||||||
if (
|
|
||||||
self.model_config is not None
|
|
||||||
and self.model_config.architecture in _QWEN4EXP_RECOVERSSM_ARCHS
|
|
||||||
and not self.cache_config.use_recoverssm
|
|
||||||
):
|
|
||||||
# Qwen4Exp's GDN and PLE layers have no plain ReplaySSM path; with them the
|
|
||||||
# flag selects RecoverSSM, which needs speculative decoding.
|
|
||||||
raise ValueError(
|
|
||||||
"--use-replayssm on Qwen4Exp selects GDN RecoverSSM and requires "
|
|
||||||
"speculative decoding (num_speculative_tokens > 0)"
|
|
||||||
)
|
|
||||||
if (
|
if (
|
||||||
self.mamba_config.backend == MambaBackendEnum.FLASHINFER
|
self.mamba_config.backend == MambaBackendEnum.FLASHINFER
|
||||||
and self.cache_config.replayssm_buffer_len > 16
|
and self.cache_config.replayssm_buffer_len > 16
|
||||||
@@ -3463,15 +3442,7 @@ class VllmConfig:
|
|||||||
raise ValueError(
|
raise ValueError(
|
||||||
"FlashInfer ReplaySSM requires --replayssm-buffer-len <= 16"
|
"FlashInfer ReplaySSM requires --replayssm-buffer-len <= 16"
|
||||||
)
|
)
|
||||||
if self.cache_config.use_recoverssm:
|
if self.cache_config.use_kda_recoverssm:
|
||||||
if self.model_config is not None and self.model_config.architecture not in (
|
|
||||||
"KimiLinearForCausalLM",
|
|
||||||
"KimiK3ForConditionalGeneration",
|
|
||||||
*_QWEN4EXP_RECOVERSSM_ARCHS,
|
|
||||||
):
|
|
||||||
raise ValueError(
|
|
||||||
"RecoverSSM is only supported for Kimi-K3 KDA and Qwen4Exp GDN"
|
|
||||||
)
|
|
||||||
if self.mamba_config.enable_stochastic_rounding:
|
if self.mamba_config.enable_stochastic_rounding:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"RecoverSSM supports bfloat16/float32 "
|
"RecoverSSM supports bfloat16/float32 "
|
||||||
|
|||||||
@@ -604,7 +604,6 @@ class EngineArgs:
|
|||||||
offload_num_in_group: int = PrefetchOffloadConfig.offload_num_in_group
|
offload_num_in_group: int = PrefetchOffloadConfig.offload_num_in_group
|
||||||
offload_prefetch_step: int = PrefetchOffloadConfig.offload_prefetch_step
|
offload_prefetch_step: int = PrefetchOffloadConfig.offload_prefetch_step
|
||||||
offload_params: set[str] = get_field(PrefetchOffloadConfig, "offload_params")
|
offload_params: set[str] = get_field(PrefetchOffloadConfig, "offload_params")
|
||||||
offload_towers: bool = PrefetchOffloadConfig.offload_towers
|
|
||||||
gpu_memory_utilization: float = CacheConfig.gpu_memory_utilization
|
gpu_memory_utilization: float = CacheConfig.gpu_memory_utilization
|
||||||
kv_cache_memory_bytes: int | None = CacheConfig.kv_cache_memory_bytes
|
kv_cache_memory_bytes: int | None = CacheConfig.kv_cache_memory_bytes
|
||||||
max_num_batched_tokens: int | None = None
|
max_num_batched_tokens: int | None = None
|
||||||
@@ -1471,9 +1470,6 @@ class EngineArgs:
|
|||||||
offload_group.add_argument(
|
offload_group.add_argument(
|
||||||
"--offload-params", **prefetch_kwargs["offload_params"]
|
"--offload-params", **prefetch_kwargs["offload_params"]
|
||||||
)
|
)
|
||||||
offload_group.add_argument(
|
|
||||||
"--offload-towers", **prefetch_kwargs["offload_towers"]
|
|
||||||
)
|
|
||||||
|
|
||||||
# Multimodal related configs
|
# Multimodal related configs
|
||||||
multimodal_kwargs = get_kwargs(MultiModalConfig)
|
multimodal_kwargs = get_kwargs(MultiModalConfig)
|
||||||
@@ -2843,7 +2839,6 @@ class EngineArgs:
|
|||||||
offload_num_in_group=self.offload_num_in_group,
|
offload_num_in_group=self.offload_num_in_group,
|
||||||
offload_prefetch_step=self.offload_prefetch_step,
|
offload_prefetch_step=self.offload_prefetch_step,
|
||||||
offload_params=self.offload_params,
|
offload_params=self.offload_params,
|
||||||
offload_towers=self.offload_towers,
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ from .utils import (
|
|||||||
BeamSearchOutput,
|
BeamSearchOutput,
|
||||||
BeamSearchSequence,
|
BeamSearchSequence,
|
||||||
create_sort_beams_key_function,
|
create_sort_beams_key_function,
|
||||||
|
get_beam_search_eos_token_ids,
|
||||||
)
|
)
|
||||||
|
|
||||||
logger = init_logger(__name__)
|
logger = init_logger(__name__)
|
||||||
@@ -86,8 +87,6 @@ class BeamSearchOfflineMixin(OfflineInferenceMixin):
|
|||||||
self.llm_engine.input_processor.resolve_watermarking(params)
|
self.llm_engine.input_processor.resolve_watermarking(params)
|
||||||
|
|
||||||
tokenizer = self.renderer.get_tokenizer()
|
tokenizer = self.renderer.get_tokenizer()
|
||||||
eos_token_id = tokenizer.eos_token_id
|
|
||||||
sort_beams_key = create_sort_beams_key_function(eos_token_id, length_penalty)
|
|
||||||
|
|
||||||
engine_inputs = self._preprocess_cmpl(prompts)
|
engine_inputs = self._preprocess_cmpl(prompts)
|
||||||
lora_requests = self._lora_request_to_seq(lora_request, len(engine_inputs))
|
lora_requests = self._lora_request_to_seq(lora_request, len(engine_inputs))
|
||||||
@@ -129,6 +128,11 @@ class BeamSearchOfflineMixin(OfflineInferenceMixin):
|
|||||||
params.structured_outputs, tokenizer
|
params.structured_outputs, tokenizer
|
||||||
)
|
)
|
||||||
|
|
||||||
|
eos_token_ids = get_beam_search_eos_token_ids(
|
||||||
|
self.llm_engine.input_processor.generation_config_fields,
|
||||||
|
tokenizer.eos_token_id,
|
||||||
|
)
|
||||||
|
sort_beams_key = create_sort_beams_key_function(eos_token_ids, length_penalty)
|
||||||
instances: list[BeamSearchInstance] = []
|
instances: list[BeamSearchInstance] = []
|
||||||
|
|
||||||
for lora_req, prompt in zip(lora_requests, engine_inputs):
|
for lora_req, prompt in zip(lora_requests, engine_inputs):
|
||||||
@@ -169,7 +173,7 @@ class BeamSearchOfflineMixin(OfflineInferenceMixin):
|
|||||||
should_stop = self._beam_search_step(
|
should_stop = self._beam_search_step(
|
||||||
instances_batch=instances_batch,
|
instances_batch=instances_batch,
|
||||||
base_sampling_params=base_sampling_params,
|
base_sampling_params=base_sampling_params,
|
||||||
eos_token_id=eos_token_id,
|
eos_token_ids=eos_token_ids,
|
||||||
ignore_eos=ignore_eos,
|
ignore_eos=ignore_eos,
|
||||||
beam_width=beam_width,
|
beam_width=beam_width,
|
||||||
sort_beams_key=sort_beams_key,
|
sort_beams_key=sort_beams_key,
|
||||||
@@ -204,7 +208,7 @@ class BeamSearchOfflineMixin(OfflineInferenceMixin):
|
|||||||
self,
|
self,
|
||||||
instances_batch: list[BeamSearchInstance],
|
instances_batch: list[BeamSearchInstance],
|
||||||
base_sampling_params: SamplingParams,
|
base_sampling_params: SamplingParams,
|
||||||
eos_token_id: int | None,
|
eos_token_ids: set[int],
|
||||||
ignore_eos: bool,
|
ignore_eos: bool,
|
||||||
beam_width: int,
|
beam_width: int,
|
||||||
sort_beams_key: Callable,
|
sort_beams_key: Callable,
|
||||||
@@ -350,7 +354,7 @@ class BeamSearchOfflineMixin(OfflineInferenceMixin):
|
|||||||
cum_logprob=current_beam.cum_logprob + logprob_obj.logprob,
|
cum_logprob=current_beam.cum_logprob + logprob_obj.logprob,
|
||||||
)
|
)
|
||||||
|
|
||||||
if token_id == eos_token_id and not ignore_eos:
|
if token_id in eos_token_ids and not ignore_eos:
|
||||||
instance.completed.append(new_beam)
|
instance.completed.append(new_beam)
|
||||||
else:
|
else:
|
||||||
instance_new_beams.append(new_beam)
|
instance_new_beams.append(new_beam)
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ from vllm.utils.async_utils import collect_from_async_generator
|
|||||||
from .utils import (
|
from .utils import (
|
||||||
BeamSearchSequence,
|
BeamSearchSequence,
|
||||||
create_sort_beams_key_function,
|
create_sort_beams_key_function,
|
||||||
|
get_beam_search_eos_token_ids,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -47,8 +48,6 @@ class BeamSearchOnlineMixin(ABC):
|
|||||||
self.engine_client.input_processor.resolve_watermarking(params)
|
self.engine_client.input_processor.resolve_watermarking(params)
|
||||||
|
|
||||||
tokenizer = self.renderer.get_tokenizer()
|
tokenizer = self.renderer.get_tokenizer()
|
||||||
eos_token_id = tokenizer.eos_token_id
|
|
||||||
sort_beams_key = create_sort_beams_key_function(eos_token_id, length_penalty)
|
|
||||||
|
|
||||||
if prompt["type"] == "embeds":
|
if prompt["type"] == "embeds":
|
||||||
raise NotImplementedError("Embedding prompt not supported for beam search")
|
raise NotImplementedError("Embedding prompt not supported for beam search")
|
||||||
@@ -74,6 +73,11 @@ class BeamSearchOnlineMixin(ABC):
|
|||||||
sampling_params, self.engine_client.input_processor.vllm_config
|
sampling_params, self.engine_client.input_processor.vllm_config
|
||||||
)
|
)
|
||||||
allowed = set(params.allowed_token_ids) if params.allowed_token_ids else None
|
allowed = set(params.allowed_token_ids) if params.allowed_token_ids else None
|
||||||
|
eos_token_ids = get_beam_search_eos_token_ids(
|
||||||
|
self.engine_client.input_processor.generation_config_fields,
|
||||||
|
tokenizer.eos_token_id,
|
||||||
|
)
|
||||||
|
sort_beams_key = create_sort_beams_key_function(eos_token_ids, length_penalty)
|
||||||
all_beams = [
|
all_beams = [
|
||||||
BeamSearchSequence(
|
BeamSearchSequence(
|
||||||
orig_prompt=prompt,
|
orig_prompt=prompt,
|
||||||
@@ -159,17 +163,17 @@ class BeamSearchOnlineMixin(ABC):
|
|||||||
candidate_logprob = (
|
candidate_logprob = (
|
||||||
current_beam.cum_logprob + logprob_obj.logprob
|
current_beam.cum_logprob + logprob_obj.logprob
|
||||||
)
|
)
|
||||||
if token_id == eos_token_id and not ignore_eos:
|
if token_id in eos_token_ids and not ignore_eos:
|
||||||
completed.append(
|
completed.append(
|
||||||
BeamSearchSequence(
|
BeamSearchSequence(
|
||||||
orig_prompt=prompt,
|
orig_prompt=prompt,
|
||||||
tokens=current_beam.tokens + [eos_token_id]
|
tokens=current_beam.tokens + [token_id]
|
||||||
if include_stop_str_in_output
|
if include_stop_str_in_output
|
||||||
else current_beam.tokens,
|
else current_beam.tokens,
|
||||||
logprobs=current_beam.logprobs + [logprobs],
|
logprobs=current_beam.logprobs + [logprobs],
|
||||||
cum_logprob=candidate_logprob,
|
cum_logprob=candidate_logprob,
|
||||||
finish_reason="stop",
|
finish_reason="stop",
|
||||||
stop_reason=eos_token_id,
|
stop_reason=token_id,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
@@ -219,7 +223,7 @@ class BeamSearchOnlineMixin(ABC):
|
|||||||
best_beams = sorted_completed[:beam_width]
|
best_beams = sorted_completed[:beam_width]
|
||||||
|
|
||||||
for beam in best_beams:
|
for beam in best_beams:
|
||||||
if beam.tokens[-1] == eos_token_id and not ignore_eos:
|
if beam.tokens[-1] in eos_token_ids and not ignore_eos:
|
||||||
# Skip the eos token in the text.
|
# Skip the eos token in the text.
|
||||||
tokens = beam.tokens[tokenized_length:-1]
|
tokens = beam.tokens[tokenized_length:-1]
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
from vllm.inputs import (
|
from vllm.inputs import (
|
||||||
DecoderOnlyEngineInput,
|
DecoderOnlyEngineInput,
|
||||||
@@ -13,6 +14,7 @@ from vllm.inputs import (
|
|||||||
)
|
)
|
||||||
from vllm.logprobs import Logprob
|
from vllm.logprobs import Logprob
|
||||||
from vllm.lora.request import LoRARequest
|
from vllm.lora.request import LoRARequest
|
||||||
|
from vllm.sampling_params import SamplingParams
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@@ -137,7 +139,7 @@ class BeamSearchInstance:
|
|||||||
def get_beam_search_score(
|
def get_beam_search_score(
|
||||||
tokens: list[int],
|
tokens: list[int],
|
||||||
cumulative_logprob: float,
|
cumulative_logprob: float,
|
||||||
eos_token_id: int,
|
eos_token_ids: set[int],
|
||||||
length_penalty: float = 1.0,
|
length_penalty: float = 1.0,
|
||||||
) -> float:
|
) -> float:
|
||||||
"""Calculate the beam search score with length penalty.
|
"""Calculate the beam search score with length penalty.
|
||||||
@@ -147,17 +149,31 @@ def get_beam_search_score(
|
|||||||
https://github.com/huggingface/transformers/blob/ccb92be23def445f2afdea94c31286f84b89eb5b/src/transformers/generation/beam_search.py#L938
|
https://github.com/huggingface/transformers/blob/ccb92be23def445f2afdea94c31286f84b89eb5b/src/transformers/generation/beam_search.py#L938
|
||||||
"""
|
"""
|
||||||
seq_len = len(tokens)
|
seq_len = len(tokens)
|
||||||
if tokens[-1] == eos_token_id:
|
if tokens[-1] in eos_token_ids:
|
||||||
seq_len -= 1
|
seq_len -= 1
|
||||||
|
|
||||||
# An aborted beam may contain only an EOS prompt token.
|
# An aborted beam may contain only an EOS prompt token.
|
||||||
return cumulative_logprob / (max(seq_len, 1) ** length_penalty)
|
return cumulative_logprob / (max(seq_len, 1) ** length_penalty)
|
||||||
|
|
||||||
|
|
||||||
def create_sort_beams_key_function(eos_token_id: int, length_penalty: float):
|
def create_sort_beams_key_function(eos_token_ids: set[int], length_penalty: float):
|
||||||
def sort_beams_key(x: BeamSearchSequence) -> float:
|
def sort_beams_key(x: BeamSearchSequence) -> float:
|
||||||
return get_beam_search_score(
|
return get_beam_search_score(
|
||||||
x.tokens, x.cum_logprob, eos_token_id, length_penalty
|
x.tokens, x.cum_logprob, eos_token_ids, length_penalty
|
||||||
)
|
)
|
||||||
|
|
||||||
return sort_beams_key
|
return sort_beams_key
|
||||||
|
|
||||||
|
|
||||||
|
def get_beam_search_eos_token_ids(
|
||||||
|
generation_config: dict[str, Any], eos_token_id: int | None
|
||||||
|
) -> set[int]:
|
||||||
|
"""Return the token ids that end generation: the tokenizer EOS plus the
|
||||||
|
generation config's ``eos_token_id``.
|
||||||
|
|
||||||
|
This uses a separate SamplingParams so the params sent to the engine keep
|
||||||
|
their own ``stop_token_ids`` and are validated as before.
|
||||||
|
"""
|
||||||
|
params = SamplingParams()
|
||||||
|
params.update_from_generation_config(generation_config, eos_token_id)
|
||||||
|
return params.all_stop_token_ids
|
||||||
|
|||||||
@@ -9,14 +9,17 @@ import torch.nn.functional as F
|
|||||||
from vllm import PoolingParams, PoolingRequestOutput, TokensPrompt
|
from vllm import PoolingParams, PoolingRequestOutput, TokensPrompt
|
||||||
from vllm.exceptions import ChatTemplateResolutionError
|
from vllm.exceptions import ChatTemplateResolutionError
|
||||||
from vllm.logger import init_logger
|
from vllm.logger import init_logger
|
||||||
from vllm.renderers import TokenizeParams
|
from vllm.renderers import TokenizeParams, merge_kwargs
|
||||||
from vllm.renderers.hf import safe_apply_chat_template
|
from vllm.renderers.hf import resolve_chat_template, safe_apply_chat_template
|
||||||
from vllm.renderers.inputs.preprocess import (
|
from vllm.renderers.inputs.preprocess import (
|
||||||
extract_target_prompt,
|
extract_target_prompt,
|
||||||
parse_model_prompt,
|
parse_model_prompt,
|
||||||
prompt_to_seq,
|
prompt_to_seq,
|
||||||
)
|
)
|
||||||
from vllm.tasks import PoolingTask
|
from vllm.tasks import PoolingTask
|
||||||
|
from vllm.transformers_utils.config import (
|
||||||
|
get_sentence_transformers_chat_template_kwargs,
|
||||||
|
)
|
||||||
from vllm.utils.mistral import is_mistral_tokenizer
|
from vllm.utils.mistral import is_mistral_tokenizer
|
||||||
|
|
||||||
from ..base.io_processor import PoolingIOProcessor
|
from ..base.io_processor import PoolingIOProcessor
|
||||||
@@ -457,9 +460,22 @@ class CrossEncoderIOProcessor(ScoringIOProcessor):
|
|||||||
self.model = model if self.supports_score_template else None
|
self.model = model if self.supports_score_template else None
|
||||||
self.use_sep_token = self.model_config.use_sep_token
|
self.use_sep_token = self.model_config.use_sep_token
|
||||||
|
|
||||||
|
self.saved_chat_template: str | None = None
|
||||||
|
self.saved_chat_template_kwargs: dict[str, Any] = {}
|
||||||
|
if not self.supports_score_template:
|
||||||
|
try:
|
||||||
|
self.saved_chat_template, self.saved_chat_template_kwargs = (
|
||||||
|
self._get_saved_chat_template()
|
||||||
|
)
|
||||||
|
except ValueError:
|
||||||
|
# An explicit chat template takes precedence anyway.
|
||||||
|
if self.chat_template is None:
|
||||||
|
raise
|
||||||
|
|
||||||
if (
|
if (
|
||||||
getattr(self.model_config.hf_config, "is_original_qwen3_reranker", False)
|
getattr(self.model_config.hf_config, "is_original_qwen3_reranker", False)
|
||||||
and self.chat_template is None
|
and self.chat_template is None
|
||||||
|
and self.saved_chat_template is None
|
||||||
):
|
):
|
||||||
suggested_template = (
|
suggested_template = (
|
||||||
"examples/pooling/score/template/qwen3_vl_reranker.jinja"
|
"examples/pooling/score/template/qwen3_vl_reranker.jinja"
|
||||||
@@ -475,6 +491,41 @@ class CrossEncoderIOProcessor(ScoringIOProcessor):
|
|||||||
suggested_template,
|
suggested_template,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def _get_saved_chat_template(self) -> tuple[str | None, dict[str, Any]]:
|
||||||
|
"""Get the chat template and kwargs declared by the Sentence
|
||||||
|
Transformers config, if any."""
|
||||||
|
saved_kwargs = get_sentence_transformers_chat_template_kwargs(
|
||||||
|
self.model_config.model, self.model_config.revision
|
||||||
|
)
|
||||||
|
if saved_kwargs is None:
|
||||||
|
return None, {}
|
||||||
|
|
||||||
|
saved_kwargs = dict(saved_kwargs)
|
||||||
|
name = saved_kwargs.pop("chat_template", None)
|
||||||
|
if name == "default":
|
||||||
|
name = None
|
||||||
|
template = resolve_chat_template(
|
||||||
|
self.tokenizer,
|
||||||
|
chat_template=name,
|
||||||
|
tools=None,
|
||||||
|
model_config=self.model_config,
|
||||||
|
)
|
||||||
|
# Hugging Face returns an unknown template name unchanged.
|
||||||
|
if template is None or template == name:
|
||||||
|
raise ValueError(
|
||||||
|
"The Sentence Transformers config declares message inputs, but "
|
||||||
|
f"the checkpoint has no {name or 'default'!r} chat template."
|
||||||
|
)
|
||||||
|
|
||||||
|
if self.chat_template is None:
|
||||||
|
logger.info_once(
|
||||||
|
"Scoring with the %r chat template declared by the Sentence "
|
||||||
|
"Transformers config. Its suffix is not restored after "
|
||||||
|
"truncation; use max_tokens_per_doc to truncate documents.",
|
||||||
|
name or "default",
|
||||||
|
)
|
||||||
|
return template, saved_kwargs
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# online APIs
|
# online APIs
|
||||||
|
|
||||||
@@ -648,6 +699,12 @@ class CrossEncoderIOProcessor(ScoringIOProcessor):
|
|||||||
model_config = self.model_config
|
model_config = self.model_config
|
||||||
tokenizer = self.tokenizer
|
tokenizer = self.tokenizer
|
||||||
|
|
||||||
|
if chat_template is None and self.saved_chat_template is not None:
|
||||||
|
chat_template = self.saved_chat_template
|
||||||
|
chat_template_kwargs = merge_kwargs(
|
||||||
|
self.saved_chat_template_kwargs, chat_template_kwargs
|
||||||
|
)
|
||||||
|
|
||||||
prompt_1, prompt_2, mm_data, mm_uuids = parse_score_data(
|
prompt_1, prompt_2, mm_data, mm_uuids = parse_score_data(
|
||||||
data_1,
|
data_1,
|
||||||
data_2,
|
data_2,
|
||||||
@@ -703,7 +760,8 @@ class CrossEncoderIOProcessor(ScoringIOProcessor):
|
|||||||
prompt_inputs = tokenizer(text=full_prompt, **local_kwargs)
|
prompt_inputs = tokenizer(text=full_prompt, **local_kwargs)
|
||||||
return full_prompt, prompt_inputs
|
return full_prompt, prompt_inputs
|
||||||
|
|
||||||
# FIXME: For now, we only apply a template when one is explicitly provided.
|
# FIXME: For now, we only apply a template when one is explicitly provided,
|
||||||
|
# either directly or by the Sentence Transformers config.
|
||||||
# We cannot rely on the tokenizer's chat template because many models
|
# We cannot rely on the tokenizer's chat template because many models
|
||||||
# inherit junk templates from their base LLM, which breaks both the models
|
# inherit junk templates from their base LLM, which breaks both the models
|
||||||
# and the tests that use them.
|
# and the tests that use them.
|
||||||
|
|||||||
@@ -226,7 +226,6 @@ if TYPE_CHECKING:
|
|||||||
VLLM_REGEX_COMPILATION_TIMEOUT_S: int = 5
|
VLLM_REGEX_COMPILATION_TIMEOUT_S: int = 5
|
||||||
VLLM_MSGPACK_ZERO_COPY_THRESHOLD: int = 256
|
VLLM_MSGPACK_ZERO_COPY_THRESHOLD: int = 256
|
||||||
VLLM_ALLOW_INSECURE_SERIALIZATION: bool = False
|
VLLM_ALLOW_INSECURE_SERIALIZATION: bool = False
|
||||||
VLLM_ABLITERATION: str = ""
|
|
||||||
VLLM_DISABLE_REQUEST_ID_RANDOMIZATION: bool = False
|
VLLM_DISABLE_REQUEST_ID_RANDOMIZATION: bool = False
|
||||||
VLLM_NIXL_SIDE_CHANNEL_HOST: str = "localhost"
|
VLLM_NIXL_SIDE_CHANNEL_HOST: str = "localhost"
|
||||||
VLLM_NIXL_SIDE_CHANNEL_PORT: int = 5600
|
VLLM_NIXL_SIDE_CHANNEL_PORT: int = 5600
|
||||||
@@ -1190,15 +1189,6 @@ environment_variables: dict[str, Callable[[], Any]] = {
|
|||||||
os.environ.get("VLLM_ALLOW_RUNTIME_LORA_UPDATING", "0").strip().lower()
|
os.environ.get("VLLM_ALLOW_RUNTIME_LORA_UPDATING", "0").strip().lower()
|
||||||
in ("1", "true")
|
in ("1", "true")
|
||||||
),
|
),
|
||||||
# Path to a refusal direction (a JSON file with a "refusal_direction" list,
|
|
||||||
# or a safetensors file with that tensor) projected out of every
|
|
||||||
# residual-stream write of the served model, or a bare name resolved under
|
|
||||||
# /opt/qwen38/abliteration and /data/abliteration. Empty or "0" is off. See
|
|
||||||
# vllm/model_executor/models/abliteration.py. QWEN38_ABLITERATION is the
|
|
||||||
# older name some deployments still set.
|
|
||||||
"VLLM_ABLITERATION": lambda: (
|
|
||||||
os.getenv("VLLM_ABLITERATION") or os.getenv("QWEN38_ABLITERATION", "")
|
|
||||||
),
|
|
||||||
# We assume drivers can report p2p status correctly.
|
# We assume drivers can report p2p status correctly.
|
||||||
# If the program hangs when using custom allreduce,
|
# If the program hangs when using custom allreduce,
|
||||||
# potantially caused by a bug in the driver (535 series),
|
# potantially caused by a bug in the driver (535 series),
|
||||||
|
|||||||
@@ -81,11 +81,11 @@ class MambaBase(AttentionLayerBase):
|
|||||||
mamba_type=self.mamba_type,
|
mamba_type=self.mamba_type,
|
||||||
tp_replicated=self.is_kv_cache_tp_replicated,
|
tp_replicated=self.is_kv_cache_tp_replicated,
|
||||||
mamba_cache_mode=vllm_config.cache_config.mamba_cache_mode,
|
mamba_cache_mode=vllm_config.cache_config.mamba_cache_mode,
|
||||||
# RecoverSSM verifies the whole window off one checkpoint, so it
|
# ReplaySSM verifies the whole window off one checkpoint, so it
|
||||||
# never writes the baseline's per-draft-token state slots.
|
# never writes the baseline's per-draft-token state slots.
|
||||||
num_speculative_blocks=(
|
num_speculative_blocks=(
|
||||||
0
|
0
|
||||||
if vllm_config.cache_config.use_recoverssm
|
if vllm_config.cache_config.use_replayssm
|
||||||
else vllm_config.num_speculative_tokens
|
else vllm_config.num_speculative_tokens
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -512,15 +512,10 @@ class ChunkGatedDeltaRule(CustomOp):
|
|||||||
|
|
||||||
@PluggableLayer.register("qwen_gated_delta_net_attention")
|
@PluggableLayer.register("qwen_gated_delta_net_attention")
|
||||||
class QwenGatedDeltaNetAttention(GatedDeltaNetAttention):
|
class QwenGatedDeltaNetAttention(GatedDeltaNetAttention):
|
||||||
def _uses_gdn_recoverssm(self) -> bool:
|
def get_state_shape(
|
||||||
"""One predicate for the replay state's shape, dtype and the attention
|
self,
|
||||||
backend."""
|
) -> tuple[tuple[int, ...], tuple[int, ...], tuple[int, ...], tuple[int, ...]]:
|
||||||
from vllm.model_executor.layers.mamba.recoverssm_utils import uses_recoverssm
|
return MambaStateShapeCalculator.gated_delta_net_state_shape(
|
||||||
|
|
||||||
return uses_recoverssm(self.cache_config, self.num_spec)
|
|
||||||
|
|
||||||
def get_state_shape(self) -> tuple[tuple[int, ...], ...]:
|
|
||||||
shapes = MambaStateShapeCalculator.gated_delta_net_state_shape(
|
|
||||||
self.tp_size,
|
self.tp_size,
|
||||||
self.num_k_heads,
|
self.num_k_heads,
|
||||||
self.num_v_heads,
|
self.num_v_heads,
|
||||||
@@ -529,32 +524,6 @@ class QwenGatedDeltaNetAttention(GatedDeltaNetAttention):
|
|||||||
self.conv_kernel_size,
|
self.conv_kernel_size,
|
||||||
self.num_spec,
|
self.num_spec,
|
||||||
)
|
)
|
||||||
if self._uses_gdn_recoverssm():
|
|
||||||
# per-token replay record [HV, spec_query_len, V + K + 1] fp32
|
|
||||||
shapes = (
|
|
||||||
*shapes,
|
|
||||||
(
|
|
||||||
self.num_v_heads // self.tp_size,
|
|
||||||
self.num_spec + 1,
|
|
||||||
self.head_v_dim + self.head_k_dim + 1,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
return shapes
|
|
||||||
|
|
||||||
def get_state_dtype(self) -> tuple[torch.dtype, ...]:
|
|
||||||
dtypes = super().get_state_dtype()
|
|
||||||
if self._uses_gdn_recoverssm():
|
|
||||||
dtypes = (*dtypes, torch.float32)
|
|
||||||
return dtypes
|
|
||||||
|
|
||||||
def get_attn_backend(self):
|
|
||||||
if self._uses_gdn_recoverssm():
|
|
||||||
from vllm.v1.attention.backends.gdn_recoverssm import (
|
|
||||||
GDNRecoverSSMAttentionBackend,
|
|
||||||
)
|
|
||||||
|
|
||||||
return GDNRecoverSSMAttentionBackend
|
|
||||||
return super().get_attn_backend()
|
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@@ -722,17 +691,6 @@ class QwenGatedDeltaNetAttention(GatedDeltaNetAttention):
|
|||||||
self.enable_fused_gdn_spec_decode = (
|
self.enable_fused_gdn_spec_decode = (
|
||||||
self.gdn_decode_kernel == "cuda" and self.speculative_config is not None
|
self.gdn_decode_kernel == "cuda" and self.speculative_config is not None
|
||||||
)
|
)
|
||||||
# RecoverSSM verify replaces the per-draft snapshot path (Triton decode
|
|
||||||
# only)
|
|
||||||
self.use_gdn_recoverssm = self._uses_gdn_recoverssm()
|
|
||||||
if self.use_gdn_recoverssm:
|
|
||||||
self.gdn_decode_kernel = "triton"
|
|
||||||
self.enable_fused_gdn_spec_decode = False
|
|
||||||
self.enable_packed_recurrent_decode = False
|
|
||||||
logger.info_once(
|
|
||||||
"GDN RecoverSSM speculative verify active (spec_query_len %d)",
|
|
||||||
self.num_spec + 1,
|
|
||||||
)
|
|
||||||
if self.speculative_config is not None:
|
if self.speculative_config is not None:
|
||||||
logger.info_once("GDN spec decode kernel: %s", self.gdn_decode_kernel)
|
logger.info_once("GDN spec decode kernel: %s", self.gdn_decode_kernel)
|
||||||
|
|
||||||
@@ -784,7 +742,7 @@ class QwenGatedDeltaNetAttention(GatedDeltaNetAttention):
|
|||||||
def _fused_gdn_decode_unsupported_reason(
|
def _fused_gdn_decode_unsupported_reason(
|
||||||
self, vllm_config: VllmConfig
|
self, vllm_config: VllmConfig
|
||||||
) -> str | None:
|
) -> str | None:
|
||||||
conv_state_dtype, recurrent_state_dtype = self.get_state_dtype()[:2]
|
conv_state_dtype, recurrent_state_dtype = self.get_state_dtype()
|
||||||
if (
|
if (
|
||||||
self.gqa_interleaved_layout
|
self.gqa_interleaved_layout
|
||||||
or self.head_k_dim != 128
|
or self.head_k_dim != 128
|
||||||
@@ -1044,25 +1002,6 @@ class QwenGatedDeltaNetAttention(GatedDeltaNetAttention):
|
|||||||
|
|
||||||
return mixed_qkv_out, z_out, b_out, a_out
|
return mixed_qkv_out, z_out, b_out, a_out
|
||||||
|
|
||||||
def _recoverssm_verify_qkv(self, mixed_qkv):
|
|
||||||
"""Q/K/V for the RecoverSSM verify.
|
|
||||||
|
|
||||||
The verify kernel reads token-strided heads, so for a 2-D [tokens, q|k|v] conv
|
|
||||||
output with a contiguous last dimension it gets views instead of copies. Any
|
|
||||||
other layout falls back to the contiguous copies of rearrange_mixed_qkv().
|
|
||||||
Returns (query, key, value, is_view)."""
|
|
||||||
if mixed_qkv.ndim != 2 or mixed_qkv.stride(-1) != 1:
|
|
||||||
return (*self.rearrange_mixed_qkv(mixed_qkv), False)
|
|
||||||
q_dim = self.key_dim // self.tp_size
|
|
||||||
v_dim = self.value_dim // self.tp_size
|
|
||||||
num_tokens = mixed_qkv.shape[0]
|
|
||||||
query = mixed_qkv[:, :q_dim].view(1, num_tokens, -1, self.head_k_dim)
|
|
||||||
key = mixed_qkv[:, q_dim : 2 * q_dim].view(1, num_tokens, -1, self.head_k_dim)
|
|
||||||
value = mixed_qkv[:, 2 * q_dim : 2 * q_dim + v_dim].view(
|
|
||||||
1, num_tokens, -1, self.head_v_dim
|
|
||||||
)
|
|
||||||
return query, key, value, True
|
|
||||||
|
|
||||||
def rearrange_mixed_qkv(self, mixed_qkv):
|
def rearrange_mixed_qkv(self, mixed_qkv):
|
||||||
"""Split packed qkv into contiguous (1, seq, heads, dim) tensors.
|
"""Split packed qkv into contiguous (1, seq, heads, dim) tensors.
|
||||||
|
|
||||||
@@ -1351,7 +1290,7 @@ class QwenGatedDeltaNetAttention(GatedDeltaNetAttention):
|
|||||||
dtype = qkv_or_qkvz.dtype
|
dtype = qkv_or_qkvz.dtype
|
||||||
num_k_heads = self.num_k_heads // self.tp_size
|
num_k_heads = self.num_k_heads // self.tp_size
|
||||||
num_v_heads = self.num_v_heads // self.tp_size
|
num_v_heads = self.num_v_heads // self.tp_size
|
||||||
state_dtype = self.get_state_dtype()[1] # 3 dtypes with the replay record
|
_, state_dtype = self.get_state_dtype()
|
||||||
|
|
||||||
# All kernels use BT = chunk_size, so a single pass with T = chunk_size
|
# All kernels use BT = chunk_size, so a single pass with T = chunk_size
|
||||||
# is sufficient to populate every autotuner cache. Mirror the real
|
# is sufficient to populate every autotuner cache. Mirror the real
|
||||||
@@ -1663,11 +1602,7 @@ class QwenGatedDeltaNetAttention(GatedDeltaNetAttention):
|
|||||||
],
|
],
|
||||||
num_accepted_tokens=num_accepted_tokens,
|
num_accepted_tokens=num_accepted_tokens,
|
||||||
query_start_loc=spec_query_start_loc,
|
query_start_loc=spec_query_start_loc,
|
||||||
max_query_len=(
|
max_query_len=spec_state_indices_tensor.size(-1),
|
||||||
self.num_spec + 1
|
|
||||||
if getattr(self, "use_gdn_recoverssm", False)
|
|
||||||
else spec_state_indices_tensor.size(-1)
|
|
||||||
),
|
|
||||||
validate_data=False,
|
validate_data=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1705,17 +1640,7 @@ class QwenGatedDeltaNetAttention(GatedDeltaNetAttention):
|
|||||||
else:
|
else:
|
||||||
mixed_qkv_non_spec = None
|
mixed_qkv_non_spec = None
|
||||||
|
|
||||||
if (
|
query_spec, key_spec, value_spec = self.rearrange_mixed_qkv(mixed_qkv_spec)
|
||||||
spec_sequence_masks is not None
|
|
||||||
and mixed_qkv_spec is not None
|
|
||||||
and self.use_gdn_recoverssm
|
|
||||||
):
|
|
||||||
query_spec, key_spec, value_spec, verify_views = (
|
|
||||||
self._recoverssm_verify_qkv(mixed_qkv_spec)
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
verify_views = False
|
|
||||||
query_spec, key_spec, value_spec = self.rearrange_mixed_qkv(mixed_qkv_spec)
|
|
||||||
|
|
||||||
# Split mixed non-spec-decode+prefill to process independently
|
# Split mixed non-spec-decode+prefill to process independently
|
||||||
split_non_spec = (
|
split_non_spec = (
|
||||||
@@ -1778,43 +1703,7 @@ class QwenGatedDeltaNetAttention(GatedDeltaNetAttention):
|
|||||||
# 2. Recurrent attention
|
# 2. Recurrent attention
|
||||||
|
|
||||||
# 2.1: Process the multi-query part
|
# 2.1: Process the multi-query part
|
||||||
if spec_sequence_masks is not None and getattr(
|
if spec_sequence_masks is not None:
|
||||||
self, "use_gdn_recoverssm", False
|
|
||||||
):
|
|
||||||
# verify the window off the checkpoint; the commit after sampling
|
|
||||||
# writes the state once
|
|
||||||
from vllm.model_executor.layers.mamba.gdn.recoverssm_gdn import (
|
|
||||||
gdn_recoverssm_verify,
|
|
||||||
)
|
|
||||||
|
|
||||||
_n = attn_metadata.num_spec_decodes
|
|
||||||
assert spec_query_start_loc is not None
|
|
||||||
assert spec_state_indices_tensor is not None
|
|
||||||
core_attn_out_spec = gdn_recoverssm_verify(
|
|
||||||
self.A_log,
|
|
||||||
a_spec,
|
|
||||||
b_spec,
|
|
||||||
self.dt_bias,
|
|
||||||
query_spec,
|
|
||||||
key_spec,
|
|
||||||
value_spec,
|
|
||||||
checkpoint_state=ssm_state,
|
|
||||||
replay_cache=self_kv_cache[2],
|
|
||||||
query_start_loc=spec_query_start_loc[: _n + 1],
|
|
||||||
state_indices=spec_state_indices_tensor[:_n, 0],
|
|
||||||
spec_query_len=self.num_spec + 1,
|
|
||||||
use_qk_l2norm_in_kernel=True,
|
|
||||||
# spec-only batch: write straight into the layer output
|
|
||||||
out=(
|
|
||||||
core_attn_out[:num_actual_tokens].unsqueeze(0)
|
|
||||||
if verify_views
|
|
||||||
and mixed_qkv_non_spec is None
|
|
||||||
and query_spec.shape[1] == num_actual_tokens
|
|
||||||
else None
|
|
||||||
),
|
|
||||||
)
|
|
||||||
last_recurrent_state = None
|
|
||||||
elif spec_sequence_masks is not None:
|
|
||||||
core_attn_out_spec, last_recurrent_state = (
|
core_attn_out_spec, last_recurrent_state = (
|
||||||
fused_sigmoid_gating_delta_rule_update(
|
fused_sigmoid_gating_delta_rule_update(
|
||||||
A_log=self.A_log,
|
A_log=self.A_log,
|
||||||
@@ -1966,8 +1855,7 @@ class QwenGatedDeltaNetAttention(GatedDeltaNetAttention):
|
|||||||
0, non_spec_token_indx, core_attn_out_non_spec.squeeze(0)
|
0, non_spec_token_indx, core_attn_out_non_spec.squeeze(0)
|
||||||
)
|
)
|
||||||
elif spec_sequence_masks is not None:
|
elif spec_sequence_masks is not None:
|
||||||
if core_attn_out_spec.data_ptr() != core_attn_out.data_ptr():
|
core_attn_out[:num_actual_tokens] = core_attn_out_spec.squeeze(0)
|
||||||
core_attn_out[:num_actual_tokens] = core_attn_out_spec.squeeze(0)
|
|
||||||
else:
|
else:
|
||||||
core_attn_out[:num_actual_tokens] = core_attn_out_non_spec.squeeze(0)
|
core_attn_out[:num_actual_tokens] = core_attn_out_non_spec.squeeze(0)
|
||||||
|
|
||||||
|
|||||||
@@ -1,695 +0,0 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
||||||
"""RecoverSSM for Gated DeltaNet (Qwen-style GDN): speculative verify from one
|
|
||||||
checkpoint without per-draft state snapshots, and accepted-state recovery after
|
|
||||||
sampling.
|
|
||||||
|
|
||||||
GDN port of the Kimi-K3 KDA RecoverSSM path
|
|
||||||
(vllm/models/kimi_k3/nvidia/ops/recoverssm.py). Differences from KDA: the gate is a
|
|
||||||
scalar per value head (g = -exp(A_log) * softplus(a + dt_bias)), q/k heads are grouped
|
|
||||||
over value heads (HV // H), and q/k are L2-normalised inside the kernel when requested.
|
|
||||||
The verify step caches, per token, the delta-rule correction c_t = beta_t * (v_t - S'_t
|
|
||||||
k_t) (V floats), the normalised key (K floats) and the log-decay g_t (1 float) in one
|
|
||||||
fp32 "replay" record. Recovery folds the accepted prefix: S_n = exp(sum_t g_t) S_0 +
|
|
||||||
sum_t exp(sum_{s>t} g_s) c_t k_t^T and writes the checkpoint once (plus the
|
|
||||||
block-boundary state in align mode)."""
|
|
||||||
|
|
||||||
from collections.abc import Sequence
|
|
||||||
from dataclasses import dataclass
|
|
||||||
from typing import Any
|
|
||||||
|
|
||||||
import torch
|
|
||||||
|
|
||||||
from vllm.model_executor.layers.mamba.ops.recoverssm import (
|
|
||||||
compact_conv_state_kernel,
|
|
||||||
prepare_commit_plan_kernel,
|
|
||||||
)
|
|
||||||
from vllm.model_executor.layers.mamba.recoverssm_utils import recoverssm_require
|
|
||||||
from vllm.triton_utils import tl, triton
|
|
||||||
from vllm.v1.attention.backends.utils import NULL_BLOCK_ID
|
|
||||||
|
|
||||||
|
|
||||||
def _require(cond: bool, msg: str) -> None:
|
|
||||||
recoverssm_require(cond, msg, "GDN RecoverSSM")
|
|
||||||
|
|
||||||
|
|
||||||
@triton.jit
|
|
||||||
def _gdn_recoverssm_verify_kernel(
|
|
||||||
q_ptr,
|
|
||||||
k_ptr,
|
|
||||||
v_ptr,
|
|
||||||
a_ptr,
|
|
||||||
b_ptr,
|
|
||||||
A_log_ptr,
|
|
||||||
dt_bias_ptr,
|
|
||||||
state_ptr,
|
|
||||||
replay_ptr,
|
|
||||||
out_ptr,
|
|
||||||
query_start_loc_ptr,
|
|
||||||
state_indices_ptr,
|
|
||||||
scale,
|
|
||||||
softplus_beta,
|
|
||||||
softplus_threshold,
|
|
||||||
null_block_id,
|
|
||||||
stride_q_token,
|
|
||||||
stride_k_token,
|
|
||||||
stride_v_token,
|
|
||||||
stride_a_token,
|
|
||||||
stride_b_token,
|
|
||||||
stride_state_block,
|
|
||||||
stride_state_head,
|
|
||||||
stride_state_v,
|
|
||||||
stride_state_k,
|
|
||||||
stride_replay_block,
|
|
||||||
stride_replay_head,
|
|
||||||
stride_replay_pos,
|
|
||||||
stride_replay_dim,
|
|
||||||
stride_out_token,
|
|
||||||
stride_qsl,
|
|
||||||
stride_si,
|
|
||||||
H: tl.constexpr,
|
|
||||||
HV: tl.constexpr,
|
|
||||||
K: tl.constexpr,
|
|
||||||
V: tl.constexpr,
|
|
||||||
BK: tl.constexpr,
|
|
||||||
BV: tl.constexpr,
|
|
||||||
SPEC_QUERY_LEN: tl.constexpr,
|
|
||||||
USE_QK_L2NORM: tl.constexpr,
|
|
||||||
):
|
|
||||||
pid_v = tl.program_id(0)
|
|
||||||
pid_b = tl.program_id(1)
|
|
||||||
pid_hv = tl.program_id(2)
|
|
||||||
pid_h = pid_hv // (HV // H)
|
|
||||||
bos = tl.load(query_start_loc_ptr + pid_b * stride_qsl).to(tl.int64)
|
|
||||||
eos = tl.load(query_start_loc_ptr + (pid_b + 1) * stride_qsl).to(tl.int64)
|
|
||||||
query_len = eos - bos
|
|
||||||
state_idx = tl.load(state_indices_ptr + pid_b * stride_si).to(tl.int64)
|
|
||||||
offs_k = tl.arange(0, BK)
|
|
||||||
offs_v = pid_v * BV + tl.arange(0, BV)
|
|
||||||
mask_k = offs_k < K
|
|
||||||
mask_v = offs_v < V
|
|
||||||
mask_state = mask_v[:, None] & mask_k[None, :]
|
|
||||||
if state_idx <= null_block_id:
|
|
||||||
for t in tl.static_range(SPEC_QUERY_LEN):
|
|
||||||
tl.store(
|
|
||||||
out_ptr + (bos + t) * stride_out_token + pid_hv * V + offs_v,
|
|
||||||
tl.zeros([BV], dtype=tl.float32),
|
|
||||||
mask=(t < query_len) & mask_v,
|
|
||||||
)
|
|
||||||
return
|
|
||||||
state = tl.load(
|
|
||||||
state_ptr
|
|
||||||
+ state_idx * stride_state_block
|
|
||||||
+ pid_hv * stride_state_head
|
|
||||||
+ offs_v[:, None] * stride_state_v
|
|
||||||
+ offs_k[None, :] * stride_state_k,
|
|
||||||
mask=mask_state,
|
|
||||||
other=0.0,
|
|
||||||
).to(tl.float32)
|
|
||||||
neg_A = -tl.exp(tl.load(A_log_ptr + pid_hv).to(tl.float32))
|
|
||||||
dt_bias = tl.load(dt_bias_ptr + pid_hv).to(tl.float32)
|
|
||||||
rec_base = (
|
|
||||||
replay_ptr + state_idx * stride_replay_block + pid_hv * stride_replay_head
|
|
||||||
)
|
|
||||||
for t in tl.static_range(SPEC_QUERY_LEN):
|
|
||||||
valid = t < query_len
|
|
||||||
tok = bos + t
|
|
||||||
q = tl.load(
|
|
||||||
q_ptr + tok * stride_q_token + pid_h * K + offs_k,
|
|
||||||
mask=valid & mask_k,
|
|
||||||
other=0.0,
|
|
||||||
).to(tl.float32)
|
|
||||||
k = tl.load(
|
|
||||||
k_ptr + tok * stride_k_token + pid_h * K + offs_k,
|
|
||||||
mask=valid & mask_k,
|
|
||||||
other=0.0,
|
|
||||||
).to(tl.float32)
|
|
||||||
v = tl.load(
|
|
||||||
v_ptr + tok * stride_v_token + pid_hv * V + offs_v,
|
|
||||||
mask=valid & mask_v,
|
|
||||||
other=0.0,
|
|
||||||
).to(tl.float32)
|
|
||||||
x = (
|
|
||||||
tl.load(a_ptr + tok * stride_a_token + pid_hv, mask=valid, other=0.0).to(
|
|
||||||
tl.float32
|
|
||||||
)
|
|
||||||
+ dt_bias
|
|
||||||
)
|
|
||||||
sp = tl.where(
|
|
||||||
softplus_beta * x <= softplus_threshold,
|
|
||||||
(1 / softplus_beta) * tl.log(1 + tl.exp(softplus_beta * x)),
|
|
||||||
x,
|
|
||||||
)
|
|
||||||
g = neg_A * sp
|
|
||||||
beta = tl.sigmoid(
|
|
||||||
tl.load(b_ptr + tok * stride_b_token + pid_hv, mask=valid, other=0.0).to(
|
|
||||||
tl.float32
|
|
||||||
)
|
|
||||||
)
|
|
||||||
if USE_QK_L2NORM:
|
|
||||||
q = q * tl.rsqrt(tl.sum(q * q) + 1e-6)
|
|
||||||
k = k * tl.rsqrt(tl.sum(k * k) + 1e-6)
|
|
||||||
q = q * scale
|
|
||||||
new_state = state * tl.exp(g)
|
|
||||||
corr = (v - tl.sum(new_state * k[None, :], 1)) * beta
|
|
||||||
new_state = new_state + corr[:, None] * k[None, :]
|
|
||||||
state = tl.where(valid, new_state, state)
|
|
||||||
o = tl.sum(state * q[None, :], 1)
|
|
||||||
tl.store(
|
|
||||||
out_ptr + tok * stride_out_token + pid_hv * V + offs_v,
|
|
||||||
o.to(out_ptr.dtype.element_ty),
|
|
||||||
mask=valid & mask_v,
|
|
||||||
)
|
|
||||||
rec = rec_base + t * stride_replay_pos
|
|
||||||
tl.store(rec + offs_v * stride_replay_dim, corr, mask=valid & mask_v)
|
|
||||||
if pid_v == 0:
|
|
||||||
tl.store(rec + (V + offs_k) * stride_replay_dim, k, mask=valid & mask_k)
|
|
||||||
tl.store(rec + (V + K) * stride_replay_dim, g, mask=valid)
|
|
||||||
|
|
||||||
|
|
||||||
def gdn_recoverssm_verify(
|
|
||||||
A_log: torch.Tensor,
|
|
||||||
a: torch.Tensor,
|
|
||||||
b: torch.Tensor,
|
|
||||||
dt_bias: torch.Tensor,
|
|
||||||
q: torch.Tensor,
|
|
||||||
k: torch.Tensor,
|
|
||||||
v: torch.Tensor,
|
|
||||||
*,
|
|
||||||
checkpoint_state: torch.Tensor,
|
|
||||||
replay_cache: torch.Tensor,
|
|
||||||
query_start_loc: torch.Tensor,
|
|
||||||
state_indices: torch.Tensor,
|
|
||||||
spec_query_len: int,
|
|
||||||
scale: float | None = None,
|
|
||||||
softplus_beta: float = 1.0,
|
|
||||||
softplus_threshold: float = 20.0,
|
|
||||||
use_qk_l2norm_in_kernel: bool = True,
|
|
||||||
out: torch.Tensor | None = None,
|
|
||||||
) -> torch.Tensor:
|
|
||||||
"""Verify a GDN speculative window against its checkpoint without modifying the
|
|
||||||
checkpoint. q, k: [1, T, H, K]; v: [1, T, HV, V]; a, b: [T, HV] (or [1, T, HV]);
|
|
||||||
checkpoint_state: [blocks, HV, V, K]; replay_cache: [blocks, HV, spec_query_len, V +
|
|
||||||
K + 1] fp32. Returns out [1, T, HV, V]."""
|
|
||||||
_require(
|
|
||||||
q.ndim == 4 and q.shape[0] == 1, "q must have shape [1, tokens, heads, dim]"
|
|
||||||
)
|
|
||||||
_, total, H, K = q.shape
|
|
||||||
_require(k.shape == q.shape, "q and k shapes differ")
|
|
||||||
_require(
|
|
||||||
v.ndim == 4 and tuple(v.shape[:2]) == (1, total),
|
|
||||||
"v must have shape [1, tokens, value heads, dim]",
|
|
||||||
)
|
|
||||||
HV, V = v.shape[-2], v.shape[-1]
|
|
||||||
_require(
|
|
||||||
H > 0 and HV >= H and HV % H == 0,
|
|
||||||
"value heads must be a positive multiple of the q/k heads",
|
|
||||||
)
|
|
||||||
_require(
|
|
||||||
a.numel() == total * HV and b.numel() == total * HV,
|
|
||||||
"gate or beta shape is incompatible",
|
|
||||||
)
|
|
||||||
a2 = a.reshape(total, HV)
|
|
||||||
b2 = b.reshape(total, HV)
|
|
||||||
_require(
|
|
||||||
a2.stride(1) == 1 and b2.stride(1) == 1,
|
|
||||||
"gate and beta heads must be contiguous",
|
|
||||||
)
|
|
||||||
_require(
|
|
||||||
tuple(A_log.shape) == (HV,) and tuple(dt_bias.shape) == (HV,),
|
|
||||||
"A_log or dt_bias shape is incompatible",
|
|
||||||
)
|
|
||||||
_require(
|
|
||||||
all(t_.stride(-1) == 1 and t_.stride(-2) == K for t_ in (q, k)),
|
|
||||||
"q and k heads must be contiguous",
|
|
||||||
)
|
|
||||||
_require(v.stride(-1) == 1 and v.stride(-2) == V, "v heads must be contiguous")
|
|
||||||
_require(checkpoint_state.ndim == 4, "checkpoint must be four-dimensional")
|
|
||||||
nb = checkpoint_state.shape[0]
|
|
||||||
_require(
|
|
||||||
tuple(checkpoint_state.shape[1:]) == (HV, V, K),
|
|
||||||
"checkpoint shape is incompatible",
|
|
||||||
)
|
|
||||||
_rec = (nb, HV, spec_query_len, V + K + 1)
|
|
||||||
_require(tuple(replay_cache.shape) == _rec, f"replay buffer needs shape {_rec}")
|
|
||||||
_require(replay_cache.dtype == torch.float32, "replay buffer must use float32")
|
|
||||||
_require(state_indices.ndim == 1, "state indices must be one-dimensional")
|
|
||||||
_require(
|
|
||||||
query_start_loc.ndim == 1
|
|
||||||
and query_start_loc.shape[0] == state_indices.shape[0] + 1,
|
|
||||||
"query metadata is incompatible",
|
|
||||||
)
|
|
||||||
_require(
|
|
||||||
total <= state_indices.shape[0] * spec_query_len,
|
|
||||||
"speculative decode input exceeds its activation capacity",
|
|
||||||
)
|
|
||||||
_dev = q.device
|
|
||||||
_require(
|
|
||||||
all(
|
|
||||||
t_.device == _dev
|
|
||||||
for t_ in (
|
|
||||||
k,
|
|
||||||
v,
|
|
||||||
a,
|
|
||||||
b,
|
|
||||||
A_log,
|
|
||||||
dt_bias,
|
|
||||||
checkpoint_state,
|
|
||||||
replay_cache,
|
|
||||||
query_start_loc,
|
|
||||||
state_indices,
|
|
||||||
)
|
|
||||||
if t_ is not None
|
|
||||||
)
|
|
||||||
and (out is None or out.device == _dev),
|
|
||||||
"inputs must be on the same device",
|
|
||||||
)
|
|
||||||
if scale is None:
|
|
||||||
scale = K**-0.5
|
|
||||||
if out is None:
|
|
||||||
out = torch.empty(1, total, HV, V, dtype=v.dtype, device=v.device)
|
|
||||||
_require(
|
|
||||||
tuple(out.shape) == (1, total, HV, V) and out.stride()[2:] == (V, 1),
|
|
||||||
"output shape or layout is incompatible",
|
|
||||||
)
|
|
||||||
batch = state_indices.shape[0]
|
|
||||||
if total == 0 or batch == 0:
|
|
||||||
return out
|
|
||||||
BK = triton.next_power_of_2(K)
|
|
||||||
BV = min(triton.next_power_of_2(V), 32)
|
|
||||||
grid = (triton.cdiv(V, BV), batch, HV)
|
|
||||||
_gdn_recoverssm_verify_kernel[grid](
|
|
||||||
q,
|
|
||||||
k,
|
|
||||||
v,
|
|
||||||
a2,
|
|
||||||
b2,
|
|
||||||
A_log,
|
|
||||||
dt_bias,
|
|
||||||
checkpoint_state,
|
|
||||||
replay_cache,
|
|
||||||
out,
|
|
||||||
query_start_loc,
|
|
||||||
state_indices,
|
|
||||||
scale,
|
|
||||||
softplus_beta,
|
|
||||||
softplus_threshold,
|
|
||||||
NULL_BLOCK_ID,
|
|
||||||
q.stride(1),
|
|
||||||
k.stride(1),
|
|
||||||
v.stride(1),
|
|
||||||
a2.stride(0),
|
|
||||||
b2.stride(0),
|
|
||||||
checkpoint_state.stride(0),
|
|
||||||
checkpoint_state.stride(1),
|
|
||||||
checkpoint_state.stride(2),
|
|
||||||
checkpoint_state.stride(3),
|
|
||||||
replay_cache.stride(0),
|
|
||||||
replay_cache.stride(1),
|
|
||||||
replay_cache.stride(2),
|
|
||||||
replay_cache.stride(3),
|
|
||||||
out.stride(1),
|
|
||||||
query_start_loc.stride(0),
|
|
||||||
state_indices.stride(0),
|
|
||||||
H=H,
|
|
||||||
HV=HV,
|
|
||||||
K=K,
|
|
||||||
V=V,
|
|
||||||
BK=BK,
|
|
||||||
BV=BV,
|
|
||||||
SPEC_QUERY_LEN=spec_query_len,
|
|
||||||
USE_QK_L2NORM=use_qk_l2norm_in_kernel,
|
|
||||||
num_warps=4,
|
|
||||||
num_stages=2,
|
|
||||||
)
|
|
||||||
return out
|
|
||||||
|
|
||||||
|
|
||||||
@triton.jit
|
|
||||||
def _commit_gdn_state_kernel(
|
|
||||||
state_ref_ptr,
|
|
||||||
state_base_addrs_ptr,
|
|
||||||
state_block_strides_ptr,
|
|
||||||
replay_ref_ptr,
|
|
||||||
replay_base_addrs_ptr,
|
|
||||||
replay_block_strides_ptr,
|
|
||||||
state_indices_ptr,
|
|
||||||
commit_lens_ptr,
|
|
||||||
final_state_indices_ptr,
|
|
||||||
boundary_state_indices_ptr,
|
|
||||||
boundary_recovery_lens_ptr,
|
|
||||||
null_block_id,
|
|
||||||
stride_state_head,
|
|
||||||
stride_state_v,
|
|
||||||
stride_state_k,
|
|
||||||
stride_replay_head,
|
|
||||||
stride_replay_pos,
|
|
||||||
stride_replay_dim,
|
|
||||||
stride_si,
|
|
||||||
K: tl.constexpr,
|
|
||||||
V: tl.constexpr,
|
|
||||||
BK: tl.constexpr,
|
|
||||||
BV: tl.constexpr,
|
|
||||||
NUM_HEADS: tl.constexpr,
|
|
||||||
ALIGN_MODE: tl.constexpr,
|
|
||||||
):
|
|
||||||
pid_v = tl.program_id(0)
|
|
||||||
pid_b = tl.program_id(1)
|
|
||||||
pid_lh = tl.program_id(2)
|
|
||||||
pid_l = pid_lh // NUM_HEADS
|
|
||||||
pid_h = pid_lh % NUM_HEADS
|
|
||||||
src = tl.load(state_indices_ptr + pid_b * stride_si).to(tl.int64)
|
|
||||||
if src <= null_block_id:
|
|
||||||
return
|
|
||||||
n = tl.load(commit_lens_ptr + pid_b)
|
|
||||||
if n == 0:
|
|
||||||
return
|
|
||||||
final_idx = tl.load(final_state_indices_ptr + pid_b).to(tl.int64)
|
|
||||||
boundary_idx = tl.load(boundary_state_indices_ptr + pid_b).to(tl.int64)
|
|
||||||
boundary_len = tl.load(boundary_recovery_lens_ptr + pid_b)
|
|
||||||
if final_idx <= null_block_id:
|
|
||||||
return
|
|
||||||
state_ptr = tl.load(state_base_addrs_ptr + pid_l).to(
|
|
||||||
tl.pointer_type(state_ref_ptr.dtype.element_ty)
|
|
||||||
)
|
|
||||||
sbs = tl.load(state_block_strides_ptr + pid_l)
|
|
||||||
replay_ptr = tl.load(replay_base_addrs_ptr + pid_l).to(
|
|
||||||
tl.pointer_type(replay_ref_ptr.dtype.element_ty)
|
|
||||||
)
|
|
||||||
rbs = tl.load(replay_block_strides_ptr + pid_l)
|
|
||||||
rec_base = replay_ptr + src * rbs + pid_h * stride_replay_head
|
|
||||||
offs_k = tl.arange(0, BK)
|
|
||||||
offs_v = pid_v * BV + tl.arange(0, BV)
|
|
||||||
mask_k = offs_k < K
|
|
||||||
mask_v = offs_v < V
|
|
||||||
mask_state = mask_v[:, None] & mask_k[None, :]
|
|
||||||
sp = offs_v[:, None] * stride_state_v + offs_k[None, :] * stride_state_k
|
|
||||||
s0 = tl.load(
|
|
||||||
state_ptr + src * sbs + pid_h * stride_state_head + sp,
|
|
||||||
mask=mask_state,
|
|
||||||
other=0.0,
|
|
||||||
).to(tl.float32)
|
|
||||||
fin_decay = 1.0
|
|
||||||
fin_corr = tl.zeros([BV, BK], tl.float32)
|
|
||||||
bnd_decay = 1.0
|
|
||||||
bnd_corr = tl.zeros([BV, BK], tl.float32)
|
|
||||||
for r in range(n):
|
|
||||||
t = n - r - 1
|
|
||||||
rec = rec_base + t * stride_replay_pos
|
|
||||||
c = tl.load(rec + offs_v * stride_replay_dim, mask=mask_v, other=0.0)
|
|
||||||
kk = tl.load(rec + (V + offs_k) * stride_replay_dim, mask=mask_k, other=0.0)
|
|
||||||
g = tl.load(rec + (V + K) * stride_replay_dim)
|
|
||||||
upd = c[:, None] * kk[None, :]
|
|
||||||
dec = tl.exp(g)
|
|
||||||
fin_corr += upd * fin_decay
|
|
||||||
fin_decay *= dec
|
|
||||||
if ALIGN_MODE:
|
|
||||||
before = t < boundary_len
|
|
||||||
bnd_corr += tl.where(before, upd * bnd_decay, 0.0)
|
|
||||||
bnd_decay *= tl.where(before, dec, 1.0)
|
|
||||||
if ALIGN_MODE:
|
|
||||||
bs = s0 * bnd_decay + bnd_corr
|
|
||||||
tl.store(
|
|
||||||
state_ptr + boundary_idx * sbs + pid_h * stride_state_head + sp,
|
|
||||||
bs.to(state_ref_ptr.dtype.element_ty),
|
|
||||||
mask=mask_state & (boundary_idx > null_block_id),
|
|
||||||
)
|
|
||||||
fs = s0 * fin_decay + fin_corr
|
|
||||||
tl.store(
|
|
||||||
state_ptr + final_idx * sbs + pid_h * stride_state_head + sp,
|
|
||||||
fs.to(state_ref_ptr.dtype.element_ty),
|
|
||||||
mask=mask_state,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class GDNRecoverSSMCommitContext:
|
|
||||||
conv_states: tuple[torch.Tensor, ...]
|
|
||||||
conv_state_base_addrs: torch.Tensor
|
|
||||||
conv_state_block_strides: torch.Tensor
|
|
||||||
conv_state_dim_strides: torch.Tensor
|
|
||||||
conv_state_token_strides: torch.Tensor
|
|
||||||
conv_history_len: int
|
|
||||||
checkpoints: tuple[torch.Tensor, ...]
|
|
||||||
state_base_addrs: torch.Tensor
|
|
||||||
state_block_strides: torch.Tensor
|
|
||||||
replays: tuple[torch.Tensor, ...]
|
|
||||||
replay_base_addrs: torch.Tensor
|
|
||||||
replay_block_strides: torch.Tensor
|
|
||||||
commit_lens: torch.Tensor
|
|
||||||
final_state_indices: torch.Tensor
|
|
||||||
boundary_state_indices: torch.Tensor
|
|
||||||
boundary_recovery_lens: torch.Tensor
|
|
||||||
spec_query_len: int
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_tensors(
|
|
||||||
cls,
|
|
||||||
conv_states: Sequence[torch.Tensor],
|
|
||||||
checkpoints: Sequence[torch.Tensor],
|
|
||||||
replays: Sequence[torch.Tensor],
|
|
||||||
*,
|
|
||||||
spec_query_len: int,
|
|
||||||
max_num_reqs: int,
|
|
||||||
conv_dim_first: bool = True,
|
|
||||||
) -> "GDNRecoverSSMCommitContext":
|
|
||||||
_require(len(checkpoints) > 0, "commit requires at least one layer")
|
|
||||||
_require(
|
|
||||||
len(conv_states) == len(checkpoints) == len(replays),
|
|
||||||
"conv, state and replay lists differ",
|
|
||||||
)
|
|
||||||
if not conv_dim_first:
|
|
||||||
conv_states = [s.transpose(-1, -2) for s in conv_states]
|
|
||||||
ref = checkpoints[0]
|
|
||||||
_require(ref.ndim == 4, "checkpoint must be four-dimensional")
|
|
||||||
nb, HV, V, K = ref.shape
|
|
||||||
_dev = ref.device
|
|
||||||
for s in checkpoints:
|
|
||||||
_require(
|
|
||||||
s.shape == ref.shape
|
|
||||||
and s.dtype == ref.dtype
|
|
||||||
and s.stride()[1:] == ref.stride()[1:]
|
|
||||||
and s.device == _dev,
|
|
||||||
"layers need matching checkpoints",
|
|
||||||
)
|
|
||||||
_rec = (nb, HV, spec_query_len, V + K + 1)
|
|
||||||
for r in replays:
|
|
||||||
_require(
|
|
||||||
tuple(r.shape) == _rec
|
|
||||||
and r.dtype == torch.float32
|
|
||||||
and r.stride()[1:] == replays[0].stride()[1:]
|
|
||||||
and r.device == _dev,
|
|
||||||
f"layers need matching float32 replay buffers of shape {_rec}",
|
|
||||||
)
|
|
||||||
conv_ref = conv_states[0]
|
|
||||||
_require(
|
|
||||||
conv_ref.ndim == 3 and conv_ref.shape[0] == nb,
|
|
||||||
"conv state must be [blocks, dim, window] with the checkpoint's "
|
|
||||||
"block count",
|
|
||||||
)
|
|
||||||
for c in conv_states:
|
|
||||||
_require(
|
|
||||||
c.shape == conv_ref.shape
|
|
||||||
and c.dtype == conv_ref.dtype
|
|
||||||
and c.stride()[1:] == conv_ref.stride()[1:]
|
|
||||||
and c.device == _dev,
|
|
||||||
"layers need matching conv states",
|
|
||||||
)
|
|
||||||
conv_dim, conv_len = conv_ref.shape[1:]
|
|
||||||
hist = conv_len - spec_query_len + 1
|
|
||||||
_require(hist > 0, "conv state is shorter than its window")
|
|
||||||
dev = ref.device
|
|
||||||
addr = lambda ts: torch.tensor(
|
|
||||||
[t.data_ptr() for t in ts], dtype=torch.int64, device=dev
|
|
||||||
)
|
|
||||||
bstr = lambda ts: torch.tensor(
|
|
||||||
[t.stride(0) for t in ts], dtype=torch.int64, device=dev
|
|
||||||
)
|
|
||||||
z = lambda: torch.empty(max_num_reqs, dtype=torch.int32, device=dev)
|
|
||||||
return cls(
|
|
||||||
tuple(conv_states),
|
|
||||||
addr(conv_states),
|
|
||||||
bstr(conv_states),
|
|
||||||
torch.tensor(
|
|
||||||
[s.stride(1) for s in conv_states], dtype=torch.int64, device=dev
|
|
||||||
),
|
|
||||||
torch.tensor(
|
|
||||||
[s.stride(2) for s in conv_states], dtype=torch.int64, device=dev
|
|
||||||
),
|
|
||||||
hist,
|
|
||||||
tuple(checkpoints),
|
|
||||||
addr(checkpoints),
|
|
||||||
bstr(checkpoints),
|
|
||||||
tuple(replays),
|
|
||||||
addr(replays),
|
|
||||||
bstr(replays),
|
|
||||||
z(),
|
|
||||||
z(),
|
|
||||||
z(),
|
|
||||||
z(),
|
|
||||||
spec_query_len,
|
|
||||||
)
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def create(
|
|
||||||
cls, layers: Sequence[Any], *, spec_query_len: int, max_num_reqs: int
|
|
||||||
) -> "GDNRecoverSSMCommitContext":
|
|
||||||
from vllm.model_executor.layers.mamba.mamba_utils import is_conv_state_dim_first
|
|
||||||
|
|
||||||
if any(len(layer.kv_cache) != 3 for layer in layers):
|
|
||||||
raise ValueError("GDN RecoverSSM pages must contain conv, state and replay")
|
|
||||||
return cls.from_tensors(
|
|
||||||
[layer.kv_cache[0] for layer in layers],
|
|
||||||
[layer.kv_cache[1] for layer in layers],
|
|
||||||
[layer.kv_cache[2] for layer in layers],
|
|
||||||
spec_query_len=spec_query_len,
|
|
||||||
max_num_reqs=max_num_reqs,
|
|
||||||
conv_dim_first=is_conv_state_dim_first(),
|
|
||||||
)
|
|
||||||
|
|
||||||
def commit(
|
|
||||||
self,
|
|
||||||
num_accepted_tokens: torch.Tensor,
|
|
||||||
state_indices: torch.Tensor,
|
|
||||||
query_start_loc: torch.Tensor,
|
|
||||||
request_indices: torch.Tensor | None = None,
|
|
||||||
block_table: torch.Tensor | None = None,
|
|
||||||
num_computed_tokens: torch.Tensor | None = None,
|
|
||||||
mamba_block_size: int | None = None,
|
|
||||||
commit_conv: bool = True,
|
|
||||||
) -> None:
|
|
||||||
"""Fold accepted GDN and convolution inputs into every layer's checkpoint."""
|
|
||||||
batch = state_indices.shape[0]
|
|
||||||
if batch == 0:
|
|
||||||
return
|
|
||||||
_require(state_indices.ndim == 1, "state indices must be one-dimensional")
|
|
||||||
_require(
|
|
||||||
batch <= self.commit_lens.shape[0], "commit batch exceeds its plan capacity"
|
|
||||||
)
|
|
||||||
_require(
|
|
||||||
query_start_loc.ndim == 1 and query_start_loc.shape[0] == batch + 1,
|
|
||||||
"commit metadata is incompatible",
|
|
||||||
)
|
|
||||||
_require(
|
|
||||||
request_indices is None or request_indices.shape[0] >= batch,
|
|
||||||
"request mapping is too short",
|
|
||||||
)
|
|
||||||
_require(
|
|
||||||
num_accepted_tokens.ndim == 1
|
|
||||||
and (request_indices is not None or num_accepted_tokens.shape[0] >= batch),
|
|
||||||
"accepted-token counts are too short",
|
|
||||||
)
|
|
||||||
_align = (block_table, num_computed_tokens, mamba_block_size)
|
|
||||||
_require(
|
|
||||||
all(x is None for x in _align) or all(x is not None for x in _align),
|
|
||||||
"align metadata is incomplete",
|
|
||||||
)
|
|
||||||
_require(
|
|
||||||
mamba_block_size is None or mamba_block_size >= self.spec_query_len,
|
|
||||||
"align block size must cover one speculative window",
|
|
||||||
)
|
|
||||||
_require(
|
|
||||||
block_table is None or block_table.ndim == 2,
|
|
||||||
"block table must be two-dimensional",
|
|
||||||
)
|
|
||||||
_dev = self.checkpoints[0].device
|
|
||||||
_require(
|
|
||||||
all(
|
|
||||||
t_ is None or t_.device == _dev
|
|
||||||
for t_ in (
|
|
||||||
num_accepted_tokens,
|
|
||||||
state_indices,
|
|
||||||
query_start_loc,
|
|
||||||
request_indices,
|
|
||||||
block_table,
|
|
||||||
num_computed_tokens,
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"commit inputs must be on the same device",
|
|
||||||
)
|
|
||||||
bt_stride = (0, 0) if block_table is None else block_table.stride()
|
|
||||||
prepare_commit_plan_kernel[(batch,)](
|
|
||||||
num_accepted_tokens,
|
|
||||||
request_indices,
|
|
||||||
state_indices,
|
|
||||||
query_start_loc,
|
|
||||||
block_table,
|
|
||||||
num_computed_tokens,
|
|
||||||
self.commit_lens,
|
|
||||||
self.final_state_indices,
|
|
||||||
self.boundary_state_indices,
|
|
||||||
self.boundary_recovery_lens,
|
|
||||||
NULL_BLOCK_ID,
|
|
||||||
mamba_block_size or 1,
|
|
||||||
block_table.shape[1] if block_table is not None else 1,
|
|
||||||
num_accepted_tokens.stride(0),
|
|
||||||
request_indices.stride(0) if request_indices is not None else 0,
|
|
||||||
state_indices.stride(0),
|
|
||||||
query_start_loc.stride(0),
|
|
||||||
bt_stride[0],
|
|
||||||
bt_stride[1],
|
|
||||||
0 if num_computed_tokens is None else num_computed_tokens.stride(0),
|
|
||||||
SPEC_QUERY_LEN=self.spec_query_len,
|
|
||||||
num_warps=1,
|
|
||||||
)
|
|
||||||
num_layers = len(self.checkpoints)
|
|
||||||
if commit_conv:
|
|
||||||
conv_ref = self.conv_states[0]
|
|
||||||
conv_dim = conv_ref.shape[1]
|
|
||||||
compact_conv_state_kernel[(triton.cdiv(conv_dim, 256), batch, num_layers)](
|
|
||||||
conv_ref,
|
|
||||||
self.conv_state_base_addrs,
|
|
||||||
self.conv_state_block_strides,
|
|
||||||
self.conv_state_dim_strides,
|
|
||||||
self.conv_state_token_strides,
|
|
||||||
state_indices,
|
|
||||||
self.commit_lens,
|
|
||||||
self.final_state_indices,
|
|
||||||
self.boundary_state_indices,
|
|
||||||
self.boundary_recovery_lens,
|
|
||||||
NULL_BLOCK_ID,
|
|
||||||
conv_dim,
|
|
||||||
self.conv_history_len,
|
|
||||||
state_indices.stride(0),
|
|
||||||
BLOCK_D=256,
|
|
||||||
BLOCK_HISTORY=triton.next_power_of_2(self.conv_history_len),
|
|
||||||
ALIGN_MODE=block_table is not None,
|
|
||||||
num_warps=4,
|
|
||||||
)
|
|
||||||
ref = self.checkpoints[0]
|
|
||||||
_, HV, V, K = ref.shape
|
|
||||||
BK = triton.next_power_of_2(K)
|
|
||||||
BV = min(triton.next_power_of_2(V), 32)
|
|
||||||
rr = self.replays[0]
|
|
||||||
_commit_gdn_state_kernel[(triton.cdiv(V, BV), batch, num_layers * HV)](
|
|
||||||
ref,
|
|
||||||
self.state_base_addrs,
|
|
||||||
self.state_block_strides,
|
|
||||||
rr,
|
|
||||||
self.replay_base_addrs,
|
|
||||||
self.replay_block_strides,
|
|
||||||
state_indices,
|
|
||||||
self.commit_lens,
|
|
||||||
self.final_state_indices,
|
|
||||||
self.boundary_state_indices,
|
|
||||||
self.boundary_recovery_lens,
|
|
||||||
NULL_BLOCK_ID,
|
|
||||||
ref.stride(1),
|
|
||||||
ref.stride(2),
|
|
||||||
ref.stride(3),
|
|
||||||
rr.stride(1),
|
|
||||||
rr.stride(2),
|
|
||||||
rr.stride(3),
|
|
||||||
state_indices.stride(0),
|
|
||||||
K=K,
|
|
||||||
V=V,
|
|
||||||
BK=BK,
|
|
||||||
BV=BV,
|
|
||||||
NUM_HEADS=HV,
|
|
||||||
ALIGN_MODE=block_table is not None,
|
|
||||||
num_warps=4,
|
|
||||||
num_stages=2,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = ["GDNRecoverSSMCommitContext", "gdn_recoverssm_verify"]
|
|
||||||
@@ -1,200 +0,0 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
||||||
"""Model-independent RecoverSSM Triton kernels shared by every recurrent-state
|
|
||||||
implementation.
|
|
||||||
|
|
||||||
RecoverSSM verifies a speculative window from a read-only checkpoint and, after
|
|
||||||
sampling, commits the accepted prefix once. The per-model parts (the KDA and GDN verify
|
|
||||||
kernels and their state reconstruction) live with their models; the kernels they share
|
|
||||||
are here:
|
|
||||||
|
|
||||||
- ``prepare_commit_plan_kernel``: per request, the commit length and the destination
|
|
||||||
state blocks (final and, in align mode, the block-boundary block) from the accepted
|
|
||||||
counts and the block table;
|
|
||||||
- ``compact_conv_state_kernel``: moves the accepted suffix of an extended short-conv
|
|
||||||
window to the front of the destination block (and writes the boundary window in align
|
|
||||||
mode)."""
|
|
||||||
|
|
||||||
from vllm.triton_utils import tl, triton
|
|
||||||
|
|
||||||
|
|
||||||
@triton.heuristics(
|
|
||||||
{
|
|
||||||
"HAS_REQUEST_INDICES": lambda args: args["request_indices_ptr"] is not None,
|
|
||||||
"ALIGN_MODE": lambda args: args["block_table_ptr"] is not None,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@triton.jit
|
|
||||||
def prepare_commit_plan_kernel(
|
|
||||||
num_accepted_ptr,
|
|
||||||
request_indices_ptr,
|
|
||||||
state_indices_ptr,
|
|
||||||
query_start_loc_ptr,
|
|
||||||
block_table_ptr,
|
|
||||||
num_computed_ptr,
|
|
||||||
commit_lens_ptr,
|
|
||||||
final_state_indices_ptr,
|
|
||||||
boundary_state_indices_ptr,
|
|
||||||
boundary_recovery_lens_ptr,
|
|
||||||
null_block_id,
|
|
||||||
mamba_block_size,
|
|
||||||
block_table_width,
|
|
||||||
stride_num_accepted,
|
|
||||||
stride_request_indices,
|
|
||||||
stride_state_indices,
|
|
||||||
stride_query_start_loc,
|
|
||||||
stride_block_table_row,
|
|
||||||
stride_block_table_col,
|
|
||||||
stride_num_computed,
|
|
||||||
SPEC_QUERY_LEN: tl.constexpr,
|
|
||||||
HAS_REQUEST_INDICES: tl.constexpr,
|
|
||||||
ALIGN_MODE: tl.constexpr,
|
|
||||||
):
|
|
||||||
spec_idx = tl.program_id(0)
|
|
||||||
source_state_idx = tl.load(state_indices_ptr + spec_idx * stride_state_indices).to(
|
|
||||||
tl.int64
|
|
||||||
)
|
|
||||||
request_idx = spec_idx
|
|
||||||
if HAS_REQUEST_INDICES:
|
|
||||||
request_idx = tl.load(
|
|
||||||
request_indices_ptr + spec_idx * stride_request_indices
|
|
||||||
).to(tl.int64)
|
|
||||||
num_accepted = tl.load(num_accepted_ptr + request_idx * stride_num_accepted).to(
|
|
||||||
tl.int32
|
|
||||||
)
|
|
||||||
bos = tl.load(query_start_loc_ptr + spec_idx * stride_query_start_loc).to(tl.int64)
|
|
||||||
eos = tl.load(query_start_loc_ptr + (spec_idx + 1) * stride_query_start_loc).to(
|
|
||||||
tl.int64
|
|
||||||
)
|
|
||||||
query_len = (eos - bos).to(tl.int32)
|
|
||||||
commit_len = tl.minimum(tl.maximum(num_accepted, 0), query_len)
|
|
||||||
commit_len = tl.minimum(commit_len, SPEC_QUERY_LEN)
|
|
||||||
|
|
||||||
final_state_idx = source_state_idx
|
|
||||||
boundary_state_idx = null_block_id
|
|
||||||
boundary_recovery_len = 0
|
|
||||||
if ALIGN_MODE:
|
|
||||||
num_computed = tl.load(num_computed_ptr + request_idx * stride_num_computed).to(
|
|
||||||
tl.int32
|
|
||||||
)
|
|
||||||
final_num_computed = num_computed + commit_len
|
|
||||||
# The committed state belongs to the block holding the last committed
|
|
||||||
# token. A window ending exactly on a boundary stays in that block; the
|
|
||||||
# next block may still be unallocated.
|
|
||||||
final_state_col = tl.minimum(
|
|
||||||
tl.maximum(final_num_computed - 1, 0) // mamba_block_size,
|
|
||||||
block_table_width - 1,
|
|
||||||
)
|
|
||||||
final_state_idx = tl.load(
|
|
||||||
block_table_ptr
|
|
||||||
+ request_idx * stride_block_table_row
|
|
||||||
+ final_state_col * stride_block_table_col
|
|
||||||
).to(tl.int64)
|
|
||||||
next_boundary = (num_computed // mamba_block_size + 1) * mamba_block_size
|
|
||||||
crosses_boundary = final_num_computed >= next_boundary
|
|
||||||
boundary_recovery_len = next_boundary - num_computed
|
|
||||||
boundary_state_idx = tl.load(
|
|
||||||
block_table_ptr
|
|
||||||
+ request_idx * stride_block_table_row
|
|
||||||
+ (next_boundary // mamba_block_size - 1) * stride_block_table_col,
|
|
||||||
mask=crosses_boundary,
|
|
||||||
other=null_block_id,
|
|
||||||
).to(tl.int64)
|
|
||||||
valid = (source_state_idx > null_block_id) & (commit_len > 0)
|
|
||||||
tl.store(commit_lens_ptr + spec_idx, tl.where(valid, commit_len, 0))
|
|
||||||
tl.store(
|
|
||||||
final_state_indices_ptr + spec_idx,
|
|
||||||
tl.where(valid, final_state_idx, null_block_id),
|
|
||||||
)
|
|
||||||
tl.store(
|
|
||||||
boundary_state_indices_ptr + spec_idx,
|
|
||||||
tl.where(valid, boundary_state_idx, null_block_id),
|
|
||||||
)
|
|
||||||
tl.store(
|
|
||||||
boundary_recovery_lens_ptr + spec_idx,
|
|
||||||
tl.where(valid, boundary_recovery_len, 0),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@triton.jit
|
|
||||||
def compact_conv_state_kernel(
|
|
||||||
conv_state_ref_ptr,
|
|
||||||
conv_state_base_addrs_ptr,
|
|
||||||
conv_state_block_strides_ptr,
|
|
||||||
conv_state_dim_strides_ptr,
|
|
||||||
conv_state_token_strides_ptr,
|
|
||||||
state_indices_ptr,
|
|
||||||
commit_lens_ptr,
|
|
||||||
final_state_indices_ptr,
|
|
||||||
boundary_state_indices_ptr,
|
|
||||||
boundary_recovery_lens_ptr,
|
|
||||||
null_block_id,
|
|
||||||
conv_dim,
|
|
||||||
conv_history_len,
|
|
||||||
stride_state_indices,
|
|
||||||
BLOCK_D: tl.constexpr,
|
|
||||||
BLOCK_HISTORY: tl.constexpr,
|
|
||||||
ALIGN_MODE: tl.constexpr,
|
|
||||||
):
|
|
||||||
pid_d = tl.program_id(0)
|
|
||||||
pid_b = tl.program_id(1)
|
|
||||||
pid_l = tl.program_id(2)
|
|
||||||
source_state_idx = tl.load(state_indices_ptr + pid_b * stride_state_indices).to(
|
|
||||||
tl.int64
|
|
||||||
)
|
|
||||||
if source_state_idx <= null_block_id:
|
|
||||||
return
|
|
||||||
|
|
||||||
commit_len = tl.load(commit_lens_ptr + pid_b)
|
|
||||||
if commit_len == 0:
|
|
||||||
return
|
|
||||||
final_state_idx = tl.load(final_state_indices_ptr + pid_b).to(tl.int64)
|
|
||||||
boundary_state_idx = tl.load(boundary_state_indices_ptr + pid_b).to(tl.int64)
|
|
||||||
boundary_recovery_len = tl.load(boundary_recovery_lens_ptr + pid_b)
|
|
||||||
|
|
||||||
if final_state_idx <= null_block_id:
|
|
||||||
return
|
|
||||||
|
|
||||||
base_addr = tl.load(conv_state_base_addrs_ptr + pid_l)
|
|
||||||
block_stride = tl.load(conv_state_block_strides_ptr + pid_l)
|
|
||||||
dim_stride = tl.load(conv_state_dim_strides_ptr + pid_l)
|
|
||||||
token_stride = tl.load(conv_state_token_strides_ptr + pid_l)
|
|
||||||
conv_state_ptr = base_addr.to(tl.pointer_type(conv_state_ref_ptr.dtype.element_ty))
|
|
||||||
source_ptr = conv_state_ptr + source_state_idx * block_stride
|
|
||||||
final_ptr = conv_state_ptr + final_state_idx * block_stride
|
|
||||||
|
|
||||||
offs_d = pid_d * BLOCK_D + tl.arange(0, BLOCK_D)
|
|
||||||
offs_h = tl.arange(0, BLOCK_HISTORY)
|
|
||||||
mask = (offs_d[:, None] < conv_dim) & (offs_h[None, :] < conv_history_len)
|
|
||||||
final_values = tl.load(
|
|
||||||
source_ptr
|
|
||||||
+ offs_d[:, None] * dim_stride
|
|
||||||
+ (commit_len - 1 + offs_h[None, :]) * token_stride,
|
|
||||||
mask=mask,
|
|
||||||
)
|
|
||||||
if ALIGN_MODE:
|
|
||||||
boundary_values = tl.load(
|
|
||||||
source_ptr
|
|
||||||
+ offs_d[:, None] * dim_stride
|
|
||||||
+ (boundary_recovery_len - 1 + offs_h[None, :]) * token_stride,
|
|
||||||
mask=mask & (boundary_state_idx > null_block_id),
|
|
||||||
)
|
|
||||||
boundary_ptr = conv_state_ptr + boundary_state_idx * block_stride
|
|
||||||
tl.store(
|
|
||||||
boundary_ptr
|
|
||||||
+ offs_d[:, None] * dim_stride
|
|
||||||
+ offs_h[None, :] * token_stride,
|
|
||||||
boundary_values,
|
|
||||||
mask=mask & (boundary_state_idx > null_block_id),
|
|
||||||
)
|
|
||||||
tl.store(
|
|
||||||
final_ptr + offs_d[:, None] * dim_stride + offs_h[None, :] * token_stride,
|
|
||||||
final_values,
|
|
||||||
mask=mask,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
|
||||||
"compact_conv_state_kernel",
|
|
||||||
"prepare_commit_plan_kernel",
|
|
||||||
]
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
||||||
"""Model-independent RecoverSSM Python helpers: the activation predicate shared by
|
|
||||||
layers, models and backends, and argument validation that raises ``ValueError``
|
|
||||||
before any raw-pointer kernel launch."""
|
|
||||||
|
|
||||||
|
|
||||||
def recoverssm_require(cond: bool, msg: str, component: str = "RecoverSSM") -> None:
|
|
||||||
if not cond:
|
|
||||||
raise ValueError(f"{component}: {msg}")
|
|
||||||
|
|
||||||
|
|
||||||
def uses_recoverssm(cache_config, num_speculative_tokens: int) -> bool:
|
|
||||||
"""True when this model instance runs RecoverSSM for its recurrent states.
|
|
||||||
|
|
||||||
VllmConfig sets ``cache_config.use_recoverssm`` for every model whose recurrent
|
|
||||||
states support it (Kimi-K3 KDA, Qwen GDN/PLE). Without speculative tokens there is
|
|
||||||
nothing to recover, so the stock path runs."""
|
|
||||||
return (
|
|
||||||
bool(getattr(cache_config, "use_recoverssm", False))
|
|
||||||
and num_speculative_tokens > 0
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = ["recoverssm_require", "uses_recoverssm"]
|
|
||||||
@@ -1,175 +0,0 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
"""Optional runtime refusal-direction removal ("abliteration").
|
|
||||||
|
|
||||||
``VLLM_ABLITERATION`` (or the legacy ``QWEN38_ABLITERATION``) names a JSON file
|
|
||||||
with a ``refusal_direction`` list, or a safetensors file with that tensor, of
|
|
||||||
length ``hidden_size``. A bare name resolves to ``<name>.json`` in
|
|
||||||
``/opt/qwen38/abliteration``, then in ``/data/abliteration``. When set, every
|
|
||||||
write into the residual stream loses its component along the unit direction r:
|
|
||||||
|
|
||||||
x <- x - r (r . x)
|
|
||||||
|
|
||||||
This runs on the attention block outputs (full and linear attention), the MLP
|
|
||||||
output and the text token embeddings. For one direction it equals the weight
|
|
||||||
edit ``W' = W - r (r^T W)`` on ``self_attn.o_proj``,
|
|
||||||
``linear_attn.out_proj``, ``mlp.down_proj`` and the rows of ``embed_tokens``
|
|
||||||
(Arditi et al., 2024), so the served weights, quantized or not, stay untouched.
|
|
||||||
|
|
||||||
Unset, no projection kernel runs. The buffer always exists, holding zeros while
|
|
||||||
the switch is off, so the attribute a compiled or captured graph refers to is
|
|
||||||
always present, and the switch is part of the torch.compile cache key, so
|
|
||||||
toggling it never reuses a stale graph.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import json
|
|
||||||
import math
|
|
||||||
import os
|
|
||||||
from functools import lru_cache
|
|
||||||
|
|
||||||
import torch
|
|
||||||
|
|
||||||
from vllm import envs
|
|
||||||
from vllm.logger import init_logger
|
|
||||||
|
|
||||||
logger = init_logger(__name__)
|
|
||||||
|
|
||||||
ENV = "VLLM_ABLITERATION"
|
|
||||||
BUILTIN_DIRS = ("/opt/qwen38/abliteration", "/data/abliteration")
|
|
||||||
DIRECTION = "_abliteration_r"
|
|
||||||
ENABLED = "_abliteration_on"
|
|
||||||
|
|
||||||
_shape_warned = False
|
|
||||||
_register_logged = False
|
|
||||||
|
|
||||||
|
|
||||||
def clear_logs() -> None:
|
|
||||||
"""Forget the once-only log flags, for tests."""
|
|
||||||
global _register_logged, _shape_warned
|
|
||||||
_register_logged = False
|
|
||||||
_shape_warned = False
|
|
||||||
|
|
||||||
|
|
||||||
def direction_path() -> str | None:
|
|
||||||
"""The configured direction file, or None when the switch is off."""
|
|
||||||
value = (envs.VLLM_ABLITERATION or "").strip()
|
|
||||||
if value in ("", "0"):
|
|
||||||
return None
|
|
||||||
if os.sep in value or value.endswith((".json", ".safetensors")):
|
|
||||||
return value
|
|
||||||
for directory in BUILTIN_DIRS:
|
|
||||||
path = os.path.join(directory, f"{value}.json")
|
|
||||||
if os.path.exists(path):
|
|
||||||
return path
|
|
||||||
return os.path.join(BUILTIN_DIRS[0], f"{value}.json")
|
|
||||||
|
|
||||||
|
|
||||||
@lru_cache(maxsize=4)
|
|
||||||
def _read(path: str) -> torch.Tensor:
|
|
||||||
"""The direction as a unit float32 CPU tensor, read once per path."""
|
|
||||||
if path.endswith(".json"):
|
|
||||||
with open(path) as f:
|
|
||||||
values = json.load(f)["refusal_direction"]
|
|
||||||
# A model built on the meta device would otherwise make this CPU tensor
|
|
||||||
# a meta one, and a meta tensor cannot be inspected or copied.
|
|
||||||
r = torch.tensor(values, dtype=torch.float32, device="cpu")
|
|
||||||
else:
|
|
||||||
from safetensors import safe_open
|
|
||||||
|
|
||||||
with safe_open(path, framework="pt", device="cpu") as f:
|
|
||||||
r = f.get_tensor("refusal_direction")
|
|
||||||
r = r.to(dtype=torch.float32, device="cpu")
|
|
||||||
r = r.flatten()
|
|
||||||
norm = float(r.norm())
|
|
||||||
if not math.isfinite(norm) or norm == 0.0:
|
|
||||||
raise ValueError(f"{ENV}: {path} holds a zero or non-finite direction")
|
|
||||||
logger.info("%s: refusal direction (%d values) from %s", ENV, r.numel(), path)
|
|
||||||
return r / norm
|
|
||||||
|
|
||||||
|
|
||||||
def load_direction(hidden_size: int) -> torch.Tensor | None:
|
|
||||||
"""The unit refusal direction on CPU, or None when the switch is off."""
|
|
||||||
path = direction_path()
|
|
||||||
if path is None:
|
|
||||||
return None
|
|
||||||
r = _read(path)
|
|
||||||
if r.numel() != hidden_size:
|
|
||||||
raise ValueError(
|
|
||||||
f"{ENV}: {path} holds {r.numel()} values; the model's hidden size "
|
|
||||||
f"is {hidden_size}"
|
|
||||||
)
|
|
||||||
return r
|
|
||||||
|
|
||||||
|
|
||||||
@torch._dynamo.disable
|
|
||||||
def register(module: torch.nn.Module, hidden_size: int, dtype: torch.dtype) -> None:
|
|
||||||
"""Attach the direction as a non-persistent buffer, from a model constructor.
|
|
||||||
|
|
||||||
Call it before CUDA-graph capture so the buffer lands on the model's device.
|
|
||||||
It holds zeros when the switch is off. A construction pass that cannot hold
|
|
||||||
data, the meta device or a fake-tensor compile pass, turns the projection off
|
|
||||||
for that module and says so.
|
|
||||||
"""
|
|
||||||
r = load_direction(hidden_size)
|
|
||||||
buf = torch.zeros(hidden_size, dtype=dtype)
|
|
||||||
on = r is not None
|
|
||||||
if on:
|
|
||||||
try:
|
|
||||||
buf.copy_(r)
|
|
||||||
except (RuntimeError, NotImplementedError):
|
|
||||||
# Meta or fake tensor construction: no room for a direction here.
|
|
||||||
logger.warning(
|
|
||||||
"%s: %s is constructed on the %s device, which cannot hold a "
|
|
||||||
"direction; projection is off for this module",
|
|
||||||
ENV,
|
|
||||||
type(module).__name__,
|
|
||||||
buf.device.type,
|
|
||||||
)
|
|
||||||
on = False
|
|
||||||
module.register_buffer(DIRECTION, buf, persistent=False)
|
|
||||||
setattr(module, ENABLED, on)
|
|
||||||
# Logging from project_ would sit inside a torch.compile region, which cannot
|
|
||||||
# trace a logger call, so the proof that the switch is live goes here.
|
|
||||||
global _register_logged
|
|
||||||
if on and not _register_logged:
|
|
||||||
_register_logged = True
|
|
||||||
logger.info(
|
|
||||||
"%s: projection is active, first registered on %s (hidden size %d)",
|
|
||||||
ENV,
|
|
||||||
type(module).__name__,
|
|
||||||
hidden_size,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def project_(module: torch.nn.Module, x: torch.Tensor) -> torch.Tensor:
|
|
||||||
"""Remove the component of x along the direction, in place. No-op when off."""
|
|
||||||
if not getattr(module, ENABLED, False):
|
|
||||||
return x
|
|
||||||
r = getattr(module, DIRECTION)
|
|
||||||
width = x.shape[-1]
|
|
||||||
if width != r.numel():
|
|
||||||
_warn_shape(type(module).__name__, width, r.numel())
|
|
||||||
return x
|
|
||||||
if r.dtype != x.dtype:
|
|
||||||
# Activations do not always carry the model dtype, and the rank-1 update
|
|
||||||
# needs one dtype throughout.
|
|
||||||
r = r.to(x.dtype)
|
|
||||||
if x.is_contiguous():
|
|
||||||
flat = x.view(-1, width)
|
|
||||||
flat.addr_(flat @ r, r, alpha=-1.0)
|
|
||||||
else:
|
|
||||||
x.sub_(torch.outer(x.reshape(-1, width) @ r, r).view(x.shape))
|
|
||||||
return x
|
|
||||||
|
|
||||||
|
|
||||||
@torch._dynamo.disable
|
|
||||||
def _warn_shape(name: str, width: int, size: int) -> None:
|
|
||||||
global _shape_warned
|
|
||||||
if not _shape_warned:
|
|
||||||
_shape_warned = True
|
|
||||||
logger.warning(
|
|
||||||
"%s: skipped a %d-wide tensor from %s; the direction has %d values",
|
|
||||||
ENV,
|
|
||||||
width,
|
|
||||||
name,
|
|
||||||
size,
|
|
||||||
)
|
|
||||||
@@ -88,7 +88,6 @@ MambaStateShapes: TypeAlias = (
|
|||||||
| tuple[tuple[int, int, int]]
|
| tuple[tuple[int, int, int]]
|
||||||
| tuple[tuple[int, int], tuple[int, int]]
|
| tuple[tuple[int, int], tuple[int, int]]
|
||||||
| tuple[tuple[int, int], tuple[int, int, int]]
|
| tuple[tuple[int, int], tuple[int, int, int]]
|
||||||
| tuple[tuple[int, int], tuple[int, int, int], tuple[int, int, int]]
|
|
||||||
| tuple[
|
| tuple[
|
||||||
tuple[int, int],
|
tuple[int, int],
|
||||||
tuple[int, int, int],
|
tuple[int, int, int],
|
||||||
|
|||||||
@@ -61,15 +61,11 @@ from vllm.model_executor.layers.vocab_parallel_embedding import (
|
|||||||
ParallelLMHead,
|
ParallelLMHead,
|
||||||
VocabParallelEmbedding,
|
VocabParallelEmbedding,
|
||||||
)
|
)
|
||||||
from vllm.model_executor.model_loader.weight_utils import (
|
|
||||||
maybe_remap_kv_scale_name,
|
|
||||||
)
|
|
||||||
from vllm.multimodal import MULTIMODAL_REGISTRY
|
from vllm.multimodal import MULTIMODAL_REGISTRY
|
||||||
from vllm.multimodal.inputs import MultiModalFeatureSpec
|
from vllm.multimodal.inputs import MultiModalFeatureSpec
|
||||||
from vllm.sequence import IntermediateTensors
|
from vllm.sequence import IntermediateTensors
|
||||||
from vllm.tokenizers.registry import cached_tokenizer_from_config
|
from vllm.tokenizers.registry import cached_tokenizer_from_config
|
||||||
|
|
||||||
from . import abliteration
|
|
||||||
from .interfaces import (
|
from .interfaces import (
|
||||||
HasInnerState,
|
HasInnerState,
|
||||||
IsHybrid,
|
IsHybrid,
|
||||||
@@ -195,7 +191,6 @@ class Qwen3_5DecoderLayer(Qwen3NextDecoderLayer):
|
|||||||
self.post_attention_layernorm = Qwen3_5RMSNorm(
|
self.post_attention_layernorm = Qwen3_5RMSNorm(
|
||||||
config.hidden_size, eps=config.rms_norm_eps
|
config.hidden_size, eps=config.rms_norm_eps
|
||||||
)
|
)
|
||||||
abliteration.register(self, config.hidden_size, model_config.dtype)
|
|
||||||
|
|
||||||
self.layer_scale = getattr(config, "layer_scale", False)
|
self.layer_scale = getattr(config, "layer_scale", False)
|
||||||
if self.layer_scale:
|
if self.layer_scale:
|
||||||
@@ -256,10 +251,7 @@ class Qwen3_5Model(Qwen3NextModel):
|
|||||||
self.embed_tokens = VocabParallelEmbedding(
|
self.embed_tokens = VocabParallelEmbedding(
|
||||||
self.vocab_size,
|
self.vocab_size,
|
||||||
config.hidden_size,
|
config.hidden_size,
|
||||||
quant_config=self.quant_config,
|
|
||||||
prefix=f"{prefix}.embed_tokens",
|
|
||||||
)
|
)
|
||||||
abliteration.register(self, config.hidden_size, vllm_config.model_config.dtype)
|
|
||||||
|
|
||||||
def get_layer(prefix: str):
|
def get_layer(prefix: str):
|
||||||
return Qwen3_5DecoderLayer(
|
return Qwen3_5DecoderLayer(
|
||||||
@@ -299,28 +291,8 @@ class Qwen3_5Model(Qwen3NextModel):
|
|||||||
n_shared_experts=1,
|
n_shared_experts=1,
|
||||||
ckpt_prefix="mlp.shared_expert",
|
ckpt_prefix="mlp.shared_expert",
|
||||||
)
|
)
|
||||||
# Checkpoints that ship calibrated KV-cache scales name them
|
|
||||||
# `...self_attn.{k,v}_scale`, but the runtime parameters live on the
|
|
||||||
# inner attention layer (`...self_attn.attn.{k,v}_scale`), and
|
|
||||||
# AutoWeightsLoader performs no remapping — without this the scales
|
|
||||||
# are silently dropped and fp8 KV runs at scale 1.0 (#54623).
|
|
||||||
params_dict = dict(self.named_parameters())
|
|
||||||
|
|
||||||
def _remap_kv_scale_names(
|
|
||||||
weights: Iterable[tuple[str, torch.Tensor]],
|
|
||||||
) -> Iterable[tuple[str, torch.Tensor]]:
|
|
||||||
for name, weight in weights:
|
|
||||||
if name.endswith((".k_scale", ".v_scale", ".q_scale")):
|
|
||||||
remapped = maybe_remap_kv_scale_name(name, params_dict)
|
|
||||||
if remapped is None:
|
|
||||||
continue
|
|
||||||
name = remapped
|
|
||||||
yield name, weight
|
|
||||||
|
|
||||||
loader = AutoWeightsLoader(self)
|
loader = AutoWeightsLoader(self)
|
||||||
return loader.load_weights(
|
return loader.load_weights(weights, mapper=self.hf_to_vllm_mapper)
|
||||||
_remap_kv_scale_names(weights), mapper=self.hf_to_vllm_mapper
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class Qwen3_5ForCausalLMBase(
|
class Qwen3_5ForCausalLMBase(
|
||||||
|
|||||||
@@ -2,16 +2,14 @@
|
|||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||||
"""Inference-only Qwen3_5 MTP model."""
|
"""Inference-only Qwen3_5 MTP model."""
|
||||||
|
|
||||||
import json
|
|
||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
|
|
||||||
import huggingface_hub
|
|
||||||
import torch
|
import torch
|
||||||
from torch import nn
|
from torch import nn
|
||||||
from transformers import Qwen3_5MoeTextConfig, Qwen3_5TextConfig
|
from transformers import Qwen3_5MoeTextConfig, Qwen3_5TextConfig
|
||||||
|
|
||||||
from vllm.compilation.decorators import support_torch_compile
|
from vllm.compilation.decorators import support_torch_compile
|
||||||
from vllm.config import ModelConfig, VllmConfig
|
from vllm.config import VllmConfig
|
||||||
from vllm.distributed import get_pp_group, tensor_model_parallel_all_gather
|
from vllm.distributed import get_pp_group, tensor_model_parallel_all_gather
|
||||||
from vllm.logger import init_logger
|
from vllm.logger import init_logger
|
||||||
from vllm.model_executor.layers.fused_moe.utils import (
|
from vllm.model_executor.layers.fused_moe.utils import (
|
||||||
@@ -35,9 +33,7 @@ from vllm.model_executor.models.qwen3_next import (
|
|||||||
)
|
)
|
||||||
from vllm.model_executor.models.utils import sequence_parallel_chunk
|
from vllm.model_executor.models.utils import sequence_parallel_chunk
|
||||||
from vllm.sequence import IntermediateTensors
|
from vllm.sequence import IntermediateTensors
|
||||||
from vllm.transformers_utils.repo_utils import try_get_local_file
|
|
||||||
|
|
||||||
from . import abliteration
|
|
||||||
from .interfaces import (
|
from .interfaces import (
|
||||||
MultiModalEmbeddings,
|
MultiModalEmbeddings,
|
||||||
SupportsMultiModal,
|
SupportsMultiModal,
|
||||||
@@ -55,64 +51,6 @@ from .utils import (
|
|||||||
|
|
||||||
logger = init_logger(__name__)
|
logger = init_logger(__name__)
|
||||||
|
|
||||||
# Parameter suffixes a quantized MTP head would carry in the checkpoint.
|
|
||||||
_MTP_QUANT_ARTIFACT_SUFFIXES = (
|
|
||||||
"weight_packed",
|
|
||||||
"weight_scale",
|
|
||||||
"weight_zero_point",
|
|
||||||
"input_scale",
|
|
||||||
"input_zero_point",
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def _mtp_weight_names(model_config: ModelConfig) -> list[str] | None:
|
|
||||||
"""Return the checkpoint's mtp.* tensor names, or None when unknown.
|
|
||||||
|
|
||||||
Reads the safetensors index from the local cache or the Hub, the same way
|
|
||||||
config-time helpers read recipe.yaml. A single-file checkpoint has no
|
|
||||||
index, so its layout stays unknown (callers keep the default behavior).
|
|
||||||
"""
|
|
||||||
file_path = try_get_local_file(
|
|
||||||
model=model_config.model,
|
|
||||||
file_name="model.safetensors.index.json",
|
|
||||||
revision=model_config.revision,
|
|
||||||
)
|
|
||||||
if file_path is None:
|
|
||||||
try:
|
|
||||||
file_path = huggingface_hub.hf_hub_download(
|
|
||||||
model_config.model,
|
|
||||||
"model.safetensors.index.json",
|
|
||||||
revision=model_config.revision,
|
|
||||||
)
|
|
||||||
except Exception:
|
|
||||||
return None
|
|
||||||
try:
|
|
||||||
with open(file_path) as f:
|
|
||||||
weight_map = json.load(f).get("weight_map", {})
|
|
||||||
except (OSError, ValueError):
|
|
||||||
return None
|
|
||||||
return [name for name in weight_map if name.startswith("mtp.")]
|
|
||||||
|
|
||||||
|
|
||||||
def _checkpoint_ships_dense_mtp(model_config: ModelConfig) -> bool:
|
|
||||||
"""Whether the checkpoint ships the MTP head as dense weights.
|
|
||||||
|
|
||||||
Quantizers sometimes leave the MTP head unquantized without declaring it
|
|
||||||
in the quant config's ignore list; the tensors then arrive as plain
|
|
||||||
`mtp.*.weight` with no packed or scale companions (#58807). Detection is
|
|
||||||
name-based, so a properly quantized MTP head (any artifact suffix on any
|
|
||||||
mtp.* tensor) keeps the target's quantization.
|
|
||||||
"""
|
|
||||||
names = _mtp_weight_names(model_config)
|
|
||||||
if not names:
|
|
||||||
return False
|
|
||||||
mtp_names = [name for name in names if name.startswith("mtp.")]
|
|
||||||
if not mtp_names:
|
|
||||||
return False
|
|
||||||
return not any(
|
|
||||||
name.rsplit(".", 1)[-1] in _MTP_QUANT_ARTIFACT_SUFFIXES for name in mtp_names
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@support_torch_compile(
|
@support_torch_compile(
|
||||||
dynamic_arg_dims={
|
dynamic_arg_dims={
|
||||||
@@ -147,25 +85,14 @@ class Qwen3_5MultiTokenPredictor(nn.Module):
|
|||||||
self.vocab_size,
|
self.vocab_size,
|
||||||
config.hidden_size,
|
config.hidden_size,
|
||||||
)
|
)
|
||||||
abliteration.register(self, config.hidden_size, model_config.dtype)
|
|
||||||
|
|
||||||
# Workaround: mtp.fc is stored as BF16 in NVFP4 checkpoints but is
|
# Workaround: mtp.fc is stored as BF16 in NVFP4 checkpoints but is
|
||||||
# missing from hf_quant_config.json exclude_modules. Force unquantized.
|
# missing from hf_quant_config.json exclude_modules. Force unquantized.
|
||||||
# Ref: https://github.com/vllm-project/vllm/pull/38650
|
# Ref: https://github.com/vllm-project/vllm/pull/38650
|
||||||
# Ref: https://github.com/NVIDIA/Model-Optimizer/pull/1124
|
# Ref: https://github.com/NVIDIA/Model-Optimizer/pull/1124
|
||||||
# compressed-tensors pack-quantized checkpoints may likewise ship the
|
|
||||||
# whole MTP head dense without declaring it in the ignore list (#58807).
|
|
||||||
mtp_dense = (
|
|
||||||
quant_config is not None
|
|
||||||
and quant_config.get_name() == "compressed-tensors"
|
|
||||||
and _checkpoint_ships_dense_mtp(model_config)
|
|
||||||
)
|
|
||||||
fc_quant = (
|
fc_quant = (
|
||||||
None
|
None
|
||||||
if (
|
if (quant_config and quant_config.get_name() == "modelopt_fp4")
|
||||||
quant_config
|
|
||||||
and (quant_config.get_name() == "modelopt_fp4" or mtp_dense)
|
|
||||||
)
|
|
||||||
else quant_config
|
else quant_config
|
||||||
)
|
)
|
||||||
self.fc = ColumnParallelLinear(
|
self.fc = ColumnParallelLinear(
|
||||||
@@ -181,18 +108,13 @@ class Qwen3_5MultiTokenPredictor(nn.Module):
|
|||||||
# GPTQ: quantized checkpoints may exclude MTP from quantization via
|
# GPTQ: quantized checkpoints may exclude MTP from quantization via
|
||||||
# quantization_config.dynamic with "-:pattern" entries. When detected,
|
# quantization_config.dynamic with "-:pattern" entries. When detected,
|
||||||
# disable quantization for MTP layers so they use unquantized params.
|
# disable quantization for MTP layers so they use unquantized params.
|
||||||
# The dense-MTP detection above covers the same need for
|
|
||||||
# compressed-tensors checkpoints that declare nothing at all.
|
|
||||||
original_quant = vllm_config.quant_config
|
original_quant = vllm_config.quant_config
|
||||||
if quant_config and quant_config.get_name() not in ("modelopt_fp4",):
|
if quant_config and quant_config.get_name() not in ("modelopt_fp4",):
|
||||||
hf_qc = getattr(model_config.hf_config, "quantization_config", None)
|
hf_qc = getattr(model_config.hf_config, "quantization_config", None)
|
||||||
if mtp_dense or (
|
if isinstance(hf_qc, dict):
|
||||||
isinstance(hf_qc, dict)
|
dynamic = hf_qc.get("dynamic", {})
|
||||||
and any(
|
if any(k.startswith("-:") and "mtp" in k for k in dynamic):
|
||||||
k.startswith("-:") and "mtp" in k for k in hf_qc.get("dynamic", {})
|
vllm_config.quant_config = None
|
||||||
)
|
|
||||||
):
|
|
||||||
vllm_config.quant_config = None
|
|
||||||
self.layers = torch.nn.ModuleList(
|
self.layers = torch.nn.ModuleList(
|
||||||
Qwen3_5DecoderLayer(
|
Qwen3_5DecoderLayer(
|
||||||
vllm_config,
|
vllm_config,
|
||||||
@@ -219,7 +141,7 @@ class Qwen3_5MultiTokenPredictor(nn.Module):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def embed_input_ids(self, input_ids: torch.Tensor) -> torch.Tensor:
|
def embed_input_ids(self, input_ids: torch.Tensor) -> torch.Tensor:
|
||||||
return abliteration.project_(self, self.embed_tokens(input_ids))
|
return self.embed_tokens(input_ids)
|
||||||
|
|
||||||
def forward(
|
def forward(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ from vllm.platforms import current_platform
|
|||||||
from vllm.sequence import IntermediateTensors
|
from vllm.sequence import IntermediateTensors
|
||||||
from vllm.v1.attention.backend import AttentionType
|
from vllm.v1.attention.backend import AttentionType
|
||||||
|
|
||||||
from . import abliteration
|
|
||||||
from .interfaces import (
|
from .interfaces import (
|
||||||
EagleModelMixin,
|
EagleModelMixin,
|
||||||
HasInnerState,
|
HasInnerState,
|
||||||
@@ -538,7 +537,6 @@ class Qwen3NextDecoderLayer(nn.Module):
|
|||||||
self.post_attention_layernorm = Qwen3NextRMSNorm(
|
self.post_attention_layernorm = Qwen3NextRMSNorm(
|
||||||
config.hidden_size, eps=config.rms_norm_eps
|
config.hidden_size, eps=config.rms_norm_eps
|
||||||
)
|
)
|
||||||
abliteration.register(self, config.hidden_size, model_config.dtype)
|
|
||||||
|
|
||||||
self.layer_scale = getattr(config, "layer_scale", False)
|
self.layer_scale = getattr(config, "layer_scale", False)
|
||||||
if self.layer_scale:
|
if self.layer_scale:
|
||||||
@@ -586,8 +584,6 @@ class Qwen3NextDecoderLayer(nn.Module):
|
|||||||
else:
|
else:
|
||||||
raise ValueError("Invalid layer_type")
|
raise ValueError("Invalid layer_type")
|
||||||
|
|
||||||
abliteration.project_(self, hidden_states)
|
|
||||||
|
|
||||||
if self.layer_scale:
|
if self.layer_scale:
|
||||||
if len(hidden_states.shape) == 2:
|
if len(hidden_states.shape) == 2:
|
||||||
hidden_states = hidden_states * (
|
hidden_states = hidden_states * (
|
||||||
@@ -616,8 +612,6 @@ class Qwen3NextDecoderLayer(nn.Module):
|
|||||||
else:
|
else:
|
||||||
hidden_states = self.mlp(hidden_states)
|
hidden_states = self.mlp(hidden_states)
|
||||||
|
|
||||||
abliteration.project_(self, hidden_states)
|
|
||||||
|
|
||||||
if self.layer_scale:
|
if self.layer_scale:
|
||||||
if len(hidden_states.shape) == 2:
|
if len(hidden_states.shape) == 2:
|
||||||
hidden_states = hidden_states * (
|
hidden_states = hidden_states * (
|
||||||
@@ -667,7 +661,6 @@ class Qwen3NextModel(nn.Module, EagleModelMixin):
|
|||||||
self.vocab_size,
|
self.vocab_size,
|
||||||
config.hidden_size,
|
config.hidden_size,
|
||||||
)
|
)
|
||||||
abliteration.register(self, config.hidden_size, vllm_config.model_config.dtype)
|
|
||||||
|
|
||||||
def get_layer(prefix: str):
|
def get_layer(prefix: str):
|
||||||
return Qwen3NextDecoderLayer(
|
return Qwen3NextDecoderLayer(
|
||||||
@@ -696,7 +689,7 @@ class Qwen3NextModel(nn.Module, EagleModelMixin):
|
|||||||
self.aux_hidden_state_layers: tuple[int, ...] = ()
|
self.aux_hidden_state_layers: tuple[int, ...] = ()
|
||||||
|
|
||||||
def embed_input_ids(self, input_ids: torch.Tensor) -> torch.Tensor:
|
def embed_input_ids(self, input_ids: torch.Tensor) -> torch.Tensor:
|
||||||
return abliteration.project_(self, self.embed_tokens(input_ids))
|
return self.embed_tokens(input_ids)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def use_sequence_parallel(self) -> bool:
|
def use_sequence_parallel(self) -> bool:
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ from vllm.model_executor.layers.vocab_parallel_embedding import (
|
|||||||
ParallelLMHead,
|
ParallelLMHead,
|
||||||
VocabParallelEmbedding,
|
VocabParallelEmbedding,
|
||||||
)
|
)
|
||||||
from vllm.model_executor.models import abliteration
|
|
||||||
from vllm.model_executor.models.qwen3_next import (
|
from vllm.model_executor.models.qwen3_next import (
|
||||||
Qwen3NextDecoderLayer,
|
Qwen3NextDecoderLayer,
|
||||||
Qwen3NextModel,
|
Qwen3NextModel,
|
||||||
@@ -67,7 +66,6 @@ class Qwen3NextMultiTokenPredictor(nn.Module):
|
|||||||
self.vocab_size,
|
self.vocab_size,
|
||||||
config.hidden_size,
|
config.hidden_size,
|
||||||
)
|
)
|
||||||
abliteration.register(self, config.hidden_size, model_config.dtype)
|
|
||||||
|
|
||||||
# Workaround: mtp.fc is stored as BF16 in NVFP4 checkpoints but is
|
# Workaround: mtp.fc is stored as BF16 in NVFP4 checkpoints but is
|
||||||
# missing from the checkpoint quant exclude list (its `ignore` glob
|
# missing from the checkpoint quant exclude list (its `ignore` glob
|
||||||
@@ -115,7 +113,7 @@ class Qwen3NextMultiTokenPredictor(nn.Module):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def embed_input_ids(self, input_ids: torch.Tensor) -> torch.Tensor:
|
def embed_input_ids(self, input_ids: torch.Tensor) -> torch.Tensor:
|
||||||
return abliteration.project_(self, self.embed_tokens(input_ids))
|
return self.embed_tokens(input_ids)
|
||||||
|
|
||||||
def forward(
|
def forward(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@@ -676,25 +676,13 @@ class Qwen3_VisionTransformer(nn.Module):
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
# An offloader moves tower parameters to host RAM after this
|
|
||||||
# constructor returns, and no weight is left on the accelerator to
|
|
||||||
# read the compute device from. Record it here while they are still
|
|
||||||
# placed, so `device` keeps working once every weight is streamed.
|
|
||||||
first_param = next(self.parameters(), None)
|
|
||||||
self._compute_device = (
|
|
||||||
torch.device("cpu") if first_param is None else first_param.device
|
|
||||||
)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def dtype(self) -> torch.dtype:
|
def dtype(self) -> torch.dtype:
|
||||||
return self.patch_embed.proj.weight.dtype
|
return self.patch_embed.proj.weight.dtype
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device(self) -> torch.device:
|
def device(self) -> torch.device:
|
||||||
weight_device = self.patch_embed.proj.weight.device
|
return self.patch_embed.proj.weight.device
|
||||||
if weight_device.type != "cpu":
|
|
||||||
return weight_device
|
|
||||||
return self._compute_device
|
|
||||||
|
|
||||||
def rot_pos_ids(self, h: int, w: int, spatial_merge_size: int) -> torch.Tensor:
|
def rot_pos_ids(self, h: int, w: int, spatial_merge_size: int) -> torch.Tensor:
|
||||||
cache_key = (h, w, spatial_merge_size)
|
cache_key = (h, w, spatial_merge_size)
|
||||||
@@ -763,7 +751,7 @@ class Qwen3_VisionTransformer(nn.Module):
|
|||||||
for t, h, w in grid_thw:
|
for t, h, w in grid_thw:
|
||||||
outputs.append(
|
outputs.append(
|
||||||
interpolate_fn(
|
interpolate_fn(
|
||||||
self.pos_embed_table(),
|
self.pos_embed.weight,
|
||||||
t,
|
t,
|
||||||
h,
|
h,
|
||||||
w,
|
w,
|
||||||
@@ -774,16 +762,6 @@ class Qwen3_VisionTransformer(nn.Module):
|
|||||||
)
|
)
|
||||||
return torch.cat(outputs, dim=0)
|
return torch.cat(outputs, dim=0)
|
||||||
|
|
||||||
def pos_embed_table(self) -> torch.Tensor:
|
|
||||||
"""The position embedding table on the compute device. The whole tower
|
|
||||||
may be streamed from host RAM, but the interpolation kernel cannot read
|
|
||||||
host memory.
|
|
||||||
"""
|
|
||||||
table = self.pos_embed.weight
|
|
||||||
if table.device.type == "cpu":
|
|
||||||
table = table.to(self.device, non_blocking=True)
|
|
||||||
return table
|
|
||||||
|
|
||||||
def prepare_encoder_metadata(
|
def prepare_encoder_metadata(
|
||||||
self,
|
self,
|
||||||
grid_thw_list: Sequence[Sequence[int]],
|
grid_thw_list: Sequence[Sequence[int]],
|
||||||
|
|||||||
@@ -56,9 +56,8 @@ class BaseOffloader(ABC):
|
|||||||
`SupportsMultiModal._mark_tower_model`, outside the `make_layers` call.
|
`SupportsMultiModal._mark_tower_model`, outside the `make_layers` call.
|
||||||
|
|
||||||
Offloaders whose `wrap_modules` may only be called on the decoder layer
|
Offloaders whose `wrap_modules` may only be called on the decoder layer
|
||||||
stack must keep this `False`. `PrefetchOffloader` enables it per-instance
|
stack (e.g. `PrefetchOffloader`, which schedules prefetches over a
|
||||||
when `offload_towers` is configured, via a tower path that does not use
|
circular layer stack) must keep this `False`.
|
||||||
the circular layer stack or the static buffer pool.
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
@@ -144,8 +143,8 @@ def create_offloader(offload_config: "OffloadConfig") -> BaseOffloader:
|
|||||||
"""Create an offloader based on the offload configuration.
|
"""Create an offloader based on the offload configuration.
|
||||||
|
|
||||||
Uses the explicit ``offload_backend`` selector. When set to ``"auto"``,
|
Uses the explicit ``offload_backend`` selector. When set to ``"auto"``,
|
||||||
selects prefetch if ``offload_group_size > 0`` or ``offload_towers`` is
|
selects prefetch if ``offload_group_size > 0``, UVA if
|
||||||
set, UVA if ``cpu_offload_gb > 0``, otherwise noop.
|
``cpu_offload_gb > 0``, otherwise noop.
|
||||||
"""
|
"""
|
||||||
from vllm.model_executor.offloader.prefetch import PrefetchOffloader
|
from vllm.model_executor.offloader.prefetch import PrefetchOffloader
|
||||||
from vllm.model_executor.offloader.uva import UVAOffloader
|
from vllm.model_executor.offloader.uva import UVAOffloader
|
||||||
@@ -155,7 +154,7 @@ def create_offloader(offload_config: "OffloadConfig") -> BaseOffloader:
|
|||||||
prefetch = offload_config.prefetch
|
prefetch = offload_config.prefetch
|
||||||
|
|
||||||
if backend == "auto":
|
if backend == "auto":
|
||||||
if prefetch.offload_group_size > 0 or prefetch.offload_towers:
|
if prefetch.offload_group_size > 0:
|
||||||
backend = "prefetch"
|
backend = "prefetch"
|
||||||
elif uva.cpu_offload_gb > 0:
|
elif uva.cpu_offload_gb > 0:
|
||||||
backend = "uva"
|
backend = "uva"
|
||||||
@@ -168,7 +167,6 @@ def create_offloader(offload_config: "OffloadConfig") -> BaseOffloader:
|
|||||||
num_in_group=prefetch.offload_num_in_group,
|
num_in_group=prefetch.offload_num_in_group,
|
||||||
prefetch_step=prefetch.offload_prefetch_step,
|
prefetch_step=prefetch.offload_prefetch_step,
|
||||||
offload_params=prefetch.offload_params,
|
offload_params=prefetch.offload_params,
|
||||||
offload_towers=prefetch.offload_towers,
|
|
||||||
mode="cpu",
|
mode="cpu",
|
||||||
)
|
)
|
||||||
elif backend == "uva":
|
elif backend == "uva":
|
||||||
|
|||||||
@@ -150,10 +150,6 @@ class PrefetchOffloader(BaseOffloader):
|
|||||||
group_size: Group every N layers together.
|
group_size: Group every N layers together.
|
||||||
num_in_group: Offload this many layers per group (last N of each group).
|
num_in_group: Offload this many layers per group (last N of each group).
|
||||||
prefetch_step: Number of layers to prefetch ahead.
|
prefetch_step: Number of layers to prefetch ahead.
|
||||||
offload_towers: Also offload multimodal tower weights to pinned host
|
|
||||||
memory, streaming them to the GPU during each encoder forward
|
|
||||||
(bulk-copy). Group scheduling still applies to decoder layers
|
|
||||||
only; `group_size` may be 0 when only towers are offloaded.
|
|
||||||
mode: Offload mode ("cpu" is currently supported).
|
mode: Offload mode ("cpu" is currently supported).
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -164,24 +160,19 @@ class PrefetchOffloader(BaseOffloader):
|
|||||||
num_in_group: int,
|
num_in_group: int,
|
||||||
prefetch_step: int,
|
prefetch_step: int,
|
||||||
offload_params: set[str] | None = None,
|
offload_params: set[str] | None = None,
|
||||||
offload_towers: bool = False,
|
|
||||||
mode: str = "cpu",
|
mode: str = "cpu",
|
||||||
):
|
):
|
||||||
self.group_size = group_size
|
self.group_size = group_size
|
||||||
self.num_in_group = num_in_group
|
self.num_in_group = num_in_group
|
||||||
self.prefetch_step = prefetch_step
|
self.prefetch_step = prefetch_step
|
||||||
self.offload_params = offload_params or set()
|
self.offload_params = offload_params or set()
|
||||||
self.offload_towers = offload_towers
|
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
if offload_towers:
|
|
||||||
self.supports_tower_offload = True
|
|
||||||
|
|
||||||
# Copy stream for async H2D transfers
|
# Copy stream for async H2D transfers
|
||||||
self.copy_stream = torch.cuda.Stream()
|
self.copy_stream = torch.cuda.Stream()
|
||||||
|
|
||||||
# Module offloaders and buffer pool (populated in wrap_modules/post_init)
|
# Module offloaders and buffer pool (populated in wrap_modules/post_init)
|
||||||
self.module_offloaders: list[_ModuleOffloader] = []
|
self.module_offloaders: list[_ModuleOffloader] = []
|
||||||
self.tower_streamers: list[_TowerUnitStreamer] = []
|
|
||||||
self.buffer_pool: StaticBufferPool | None = None
|
self.buffer_pool: StaticBufferPool | None = None
|
||||||
self.total_offloaded_bytes = 0
|
self.total_offloaded_bytes = 0
|
||||||
|
|
||||||
@@ -191,29 +182,17 @@ class PrefetchOffloader(BaseOffloader):
|
|||||||
prefix: str = "",
|
prefix: str = "",
|
||||||
) -> list[nn.Module]:
|
) -> list[nn.Module]:
|
||||||
"""Wrap modules with prefetch offloading logic."""
|
"""Wrap modules with prefetch offloading logic."""
|
||||||
modules = list(modules_generator)
|
assert len(self.module_offloaders) == 0, (
|
||||||
|
"wrap_modules should only be called once"
|
||||||
|
)
|
||||||
|
|
||||||
if prefix:
|
if prefix:
|
||||||
# Routed by _mark_tower_model: a whole tower module, handled by
|
prefix = f"{prefix}."
|
||||||
# the streaming path, independent of the decoder group schedule.
|
|
||||||
if self.offload_towers:
|
|
||||||
for module in modules:
|
|
||||||
self._wrap_tower(module, prefix)
|
|
||||||
return modules
|
|
||||||
|
|
||||||
if self.group_size <= 0:
|
|
||||||
# Prefetch backend selected for towers only; decoder layers
|
|
||||||
# stay resident on the device.
|
|
||||||
return modules
|
|
||||||
|
|
||||||
assert len(self.module_offloaders) == 0, (
|
|
||||||
"wrap_modules should only be called once for the decoder stack"
|
|
||||||
)
|
|
||||||
|
|
||||||
all_modules = []
|
all_modules = []
|
||||||
offload_modules = []
|
offload_modules = []
|
||||||
|
|
||||||
for module_index, module in enumerate(modules):
|
for module_index, module in enumerate(modules_generator):
|
||||||
all_modules.append(module)
|
all_modules.append(module)
|
||||||
|
|
||||||
# Select layers to offload based on group pattern
|
# Select layers to offload based on group pattern
|
||||||
@@ -249,68 +228,6 @@ class PrefetchOffloader(BaseOffloader):
|
|||||||
|
|
||||||
return all_modules
|
return all_modules
|
||||||
|
|
||||||
def _wrap_tower(self, tower: nn.Module, prefix: str):
|
|
||||||
"""Split a tower into parameter-bearing units and place each one
|
|
||||||
in pinned host RAM until its forward executes (bulk-copy).
|
|
||||||
|
|
||||||
A tower restricts this to its heavy compute subtrees by declaring
|
|
||||||
`tower_offload_children`. Tower code reads a small anchor weight to find
|
|
||||||
its compute device, and passes embedding weights straight to a kernel,
|
|
||||||
so weights outside that list stay on the device.
|
|
||||||
"""
|
|
||||||
first_param = next(tower.parameters(), None)
|
|
||||||
if first_param is None:
|
|
||||||
# Tower was staged out (e.g. --limit-mm-per-prompt zero for all
|
|
||||||
# its modalities) or carries no parameters.
|
|
||||||
return
|
|
||||||
device = first_param.device
|
|
||||||
if device.type == "cpu":
|
|
||||||
return
|
|
||||||
|
|
||||||
declared = getattr(tower, "tower_offload_children", None)
|
|
||||||
children = dict(tower.named_children())
|
|
||||||
if declared is None:
|
|
||||||
roots: list[nn.Module] = [tower]
|
|
||||||
kept: list[str] = []
|
|
||||||
else:
|
|
||||||
roots = [c for name, c in children.items() if name in declared]
|
|
||||||
kept = [name for name in children if name not in declared]
|
|
||||||
|
|
||||||
num_units = 0
|
|
||||||
for root in roots:
|
|
||||||
for submodule in root.modules():
|
|
||||||
param_names = [
|
|
||||||
name for name, _ in submodule.named_parameters(recurse=False)
|
|
||||||
]
|
|
||||||
if not param_names:
|
|
||||||
continue
|
|
||||||
streamer = _TowerUnitStreamer(submodule, param_names, device)
|
|
||||||
streamer.offload_to_host_now()
|
|
||||||
self.tower_streamers.append(streamer)
|
|
||||||
num_units += 1
|
|
||||||
|
|
||||||
logger.info(
|
|
||||||
"[PrefetchOffloader] Queued tower '%s' for host streaming: "
|
|
||||||
"%d parameter units, %d children kept on device (%s) (weights "
|
|
||||||
"move to the GPU only during encoder forwards).",
|
|
||||||
prefix,
|
|
||||||
num_units,
|
|
||||||
len(kept),
|
|
||||||
", ".join(kept) or "none",
|
|
||||||
)
|
|
||||||
|
|
||||||
if isinstance(getattr(type(tower), "device", None), property):
|
|
||||||
resolved = getattr(tower, "device", None)
|
|
||||||
if isinstance(resolved, torch.device) and resolved.type != device.type:
|
|
||||||
logger.warning(
|
|
||||||
"[PrefetchOffloader] Tower '%s' resolves its compute "
|
|
||||||
"device to %s from offloaded weights, so code that calls "
|
|
||||||
".to(tower.device) runs on the host. Add the anchor "
|
|
||||||
"submodule to tower_offload_children.",
|
|
||||||
prefix,
|
|
||||||
resolved,
|
|
||||||
)
|
|
||||||
|
|
||||||
def _hook_module_forward(self, index: int, module: nn.Module):
|
def _hook_module_forward(self, index: int, module: nn.Module):
|
||||||
"""Hook module's forward with torch.compile-compatible sync."""
|
"""Hook module's forward with torch.compile-compatible sync."""
|
||||||
original_forward = module.forward
|
original_forward = module.forward
|
||||||
@@ -423,21 +340,6 @@ class PrefetchOffloader(BaseOffloader):
|
|||||||
(in _CpuParamOffloader.__init__), so GPU memory is available for the
|
(in _CpuParamOffloader.__init__), so GPU memory is available for the
|
||||||
static buffer pool.
|
static buffer pool.
|
||||||
"""
|
"""
|
||||||
# Tower streamers: re-snapshot host storage from the final processed
|
|
||||||
# weights, then install the streaming forwards.
|
|
||||||
for streamer in self.tower_streamers:
|
|
||||||
streamer.sync_storage()
|
|
||||||
for streamer in self.tower_streamers:
|
|
||||||
streamer.hook_forward()
|
|
||||||
if self.tower_streamers:
|
|
||||||
tower_bytes = sum(s.offloaded_bytes for s in self.tower_streamers)
|
|
||||||
self.total_offloaded_bytes += tower_bytes
|
|
||||||
logger.info_once(
|
|
||||||
f"[PrefetchOffloader] Tower offload active: "
|
|
||||||
f"{len(self.tower_streamers)} units, "
|
|
||||||
f"{tower_bytes / 1e9:.4f} GB in pinned host RAM."
|
|
||||||
)
|
|
||||||
|
|
||||||
# Sync CPU storage with current param.data BEFORE collecting param info.
|
# Sync CPU storage with current param.data BEFORE collecting param info.
|
||||||
# This is needed because process_weights_after_loading may have:
|
# This is needed because process_weights_after_loading may have:
|
||||||
# 1. Transformed weights (quantization, transpose, etc.)
|
# 1. Transformed weights (quantization, transpose, etc.)
|
||||||
@@ -489,136 +391,6 @@ class PrefetchOffloader(BaseOffloader):
|
|||||||
self.module_offloaders[i].start_onload_to_static()
|
self.module_offloaders[i].start_onload_to_static()
|
||||||
|
|
||||||
|
|
||||||
class _TowerUnitStreamer:
|
|
||||||
"""Bulk-copy placement for one parameter-bearing submodule of a tower.
|
|
||||||
|
|
||||||
The unit's parameters live in pinned host memory between forwards.
|
|
||||||
On each forward, they are bulk-copied to freshly allocated GPU tensors
|
|
||||||
on the compute stream (so copies are stream-ordered ahead of the unit's
|
|
||||||
kernels with no explicit sync) and released right after. At steady
|
|
||||||
state only the unit currently executing holds VRAM, and freed blocks
|
|
||||||
are recycled by the caching allocator for the next unit's weights.
|
|
||||||
|
|
||||||
This is the bulk-copy alternative to UVA zero-copy for multimodal
|
|
||||||
towers: whole-tensor H2D transfers instead of operand tiles re-read
|
|
||||||
over PCIe inside the GEMM inner loop.
|
|
||||||
|
|
||||||
Interaction notes:
|
|
||||||
- If an encoder CUDA graph captures a streamed unit, correctness is
|
|
||||||
preserved (the memcpy is captured and replays from host memory), but
|
|
||||||
the captured allocations persist in the graph pool, so the VRAM
|
|
||||||
saving is lost. Prefer eager encoder execution (`cudagraph_mm_encoder`
|
|
||||||
off) together with tower offloading.
|
|
||||||
- Sleep/wake weight reload is not intercepted; storage is re-synced
|
|
||||||
from `param.data` at `post_init` only.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, unit: nn.Module, param_names: list[str], device: Any):
|
|
||||||
self.unit = unit
|
|
||||||
self.param_names = param_names
|
|
||||||
self.device = device
|
|
||||||
self.offloaded_bytes = 0
|
|
||||||
# name -> pinned host tensor holding the weights between forwards.
|
|
||||||
# Populated/refreshed in sync_storage() (after weight loading and
|
|
||||||
# process_weights_after_loading), which is the authoritative point.
|
|
||||||
self._storages: dict[str, torch.Tensor] = {}
|
|
||||||
|
|
||||||
def _get_param(self, name: str) -> nn.Parameter:
|
|
||||||
return getattr(self.unit, name)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def _empty_cpu_like(data: torch.Tensor, pin_memory: bool) -> torch.Tensor:
|
|
||||||
return torch.empty_strided(
|
|
||||||
size=data.size(),
|
|
||||||
stride=data.stride(),
|
|
||||||
dtype=data.dtype,
|
|
||||||
layout=data.layout,
|
|
||||||
device="cpu",
|
|
||||||
pin_memory=pin_memory,
|
|
||||||
)
|
|
||||||
|
|
||||||
def offload_to_host_now(self) -> None:
|
|
||||||
"""Move current parameter data to pinned host storage during
|
|
||||||
construction, so weight loading writes to host memory and the
|
|
||||||
device never accumulates tower weights.
|
|
||||||
"""
|
|
||||||
pin_memory = should_pin_memory()
|
|
||||||
for name in self.param_names:
|
|
||||||
p = self._get_param(name)
|
|
||||||
if p.device.type == "cpu":
|
|
||||||
continue
|
|
||||||
cpu_data = self._empty_cpu_like(p.data, pin_memory)
|
|
||||||
cpu_data.copy_(p.data)
|
|
||||||
p.data = cpu_data
|
|
||||||
|
|
||||||
def sync_storage(self) -> None:
|
|
||||||
"""Re-snapshot host storage from param.data.
|
|
||||||
|
|
||||||
Called from post_init() after weight loading and
|
|
||||||
process_weights_after_loading. device_loading_context may have
|
|
||||||
replaced param.data with fresh (already pinned) CPU tensors, and
|
|
||||||
quantization processing may have left data on the device; handle
|
|
||||||
both so _storages always references the final processed weights.
|
|
||||||
"""
|
|
||||||
self.offloaded_bytes = 0
|
|
||||||
for name in list(self.param_names):
|
|
||||||
try:
|
|
||||||
p = self._get_param(name)
|
|
||||||
except AttributeError:
|
|
||||||
# Parameter deleted by process_weights_after_loading.
|
|
||||||
self.param_names.remove(name)
|
|
||||||
continue
|
|
||||||
data = p.data
|
|
||||||
if data.device.type != "cpu":
|
|
||||||
cpu_data = self._empty_cpu_like(data, pin_memory=should_pin_memory())
|
|
||||||
cpu_data.copy_(data)
|
|
||||||
data = cpu_data
|
|
||||||
p.data = data
|
|
||||||
elif should_pin_memory() and not data.is_pinned():
|
|
||||||
pinned = self._empty_cpu_like(data, pin_memory=True)
|
|
||||||
pinned.copy_(data)
|
|
||||||
data = pinned
|
|
||||||
p.data = data
|
|
||||||
self._storages[name] = data
|
|
||||||
self.offloaded_bytes += data.numel() * data.element_size()
|
|
||||||
|
|
||||||
def hook_forward(self) -> None:
|
|
||||||
if getattr(self.unit, "_vllm_tower_streamed", False):
|
|
||||||
return # post_init ran more than once
|
|
||||||
original_forward = self.unit.forward
|
|
||||||
streamer = self
|
|
||||||
|
|
||||||
def forward(*args, **kwargs):
|
|
||||||
if torch.cuda.is_current_stream_capturing():
|
|
||||||
logger.warning_once(
|
|
||||||
"[_TowerUnitStreamer] Streaming a tower unit during "
|
|
||||||
"CUDA graph capture: results stay correct but the "
|
|
||||||
"weights will be captured into the graph pool, so no "
|
|
||||||
"VRAM is saved. Disable encoder CUDA graphs "
|
|
||||||
"(cudagraph_mm_encoder) to keep the saving."
|
|
||||||
)
|
|
||||||
for name in streamer.param_names:
|
|
||||||
storage = streamer._storages.get(name)
|
|
||||||
if storage is None:
|
|
||||||
continue
|
|
||||||
# Async H2D on the compute stream: ordered ahead of this
|
|
||||||
# unit's kernels, no explicit synchronization needed.
|
|
||||||
streamer._get_param(name).data = storage.to(
|
|
||||||
streamer.device, non_blocking=True
|
|
||||||
)
|
|
||||||
try:
|
|
||||||
return original_forward(*args, **kwargs)
|
|
||||||
finally:
|
|
||||||
for name in streamer.param_names:
|
|
||||||
storage = streamer._storages.get(name)
|
|
||||||
if storage is None:
|
|
||||||
continue
|
|
||||||
streamer._get_param(name).data = storage
|
|
||||||
|
|
||||||
self.unit._vllm_tower_streamed = True
|
|
||||||
self.unit.forward = forward
|
|
||||||
|
|
||||||
|
|
||||||
class _ModuleOffloader:
|
class _ModuleOffloader:
|
||||||
"""Manages offloading for a single module.
|
"""Manages offloading for a single module.
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user