Skip to content

Commit ce61c6b

Browse files
authored
Use the correct torch dtype in topk kernel assertion
Torch 2.7 doesn't define `ScalarType::Int64` but rather defines `::Long instead`: https://github.com/pytorch/pytorch/blob/release/2.7/c10/core/ScalarType.h#L67 Without this patch, it's impossible to build vllm with an error message like ``` /amd/vadim/vllm/build/temp.linux-x86_64-cpython-310/csrc/moe/topk_softmax_kernels.hip /home/amd/vadim/vllm/build/temp.linux-x86_64-cpython-310/csrc/moe/topk_softmax_kernels.hip:535:62: error: no member named 'Int64' in 'c10::ScalarType' 535 | assert(topk_indices.scalar_type() == at::ScalarType::Int64); | ~~~~~~~~~~~~~~~~^ /usr/include/assert.h:93:27: note: expanded from macro 'assert' 93 | (static_cast <bool> (expr) \ | ^~~~ 1 error generated when compiling for gfx942. ```
1 parent 9b43d47 commit ce61c6b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

csrc/moe/topk_softmax_kernels.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ void topk_softmax(
530530
stream);
531531
}
532532
else {
533-
assert(topk_indices.scalar_type() == at::ScalarType::Int64);
533+
assert(topk_indices.scalar_type() == at::ScalarType::Long);
534534
vllm::moe::topkGatingSoftmaxKernelLauncher(
535535
gating_output.data_ptr<float>(),
536536
topk_weights.data_ptr<float>(),

0 commit comments

Comments
 (0)