Unverified Commit 86debab5 authored by Richard Barnes's avatar Richard Barnes Committed by GitHub
Browse files

Fix `numel()` downcast in vllm/csrc/moe/moe_align_sum_kernels.cu +2 (#17082)


Co-authored-by: default avatarmgoin <mgoin64@gmail.com>
parent be250bbc
......@@ -239,7 +239,7 @@ void moe_sum(torch::Tensor& input, // [num_tokens, topk, hidden_size]
torch::Tensor& output) // [num_tokens, hidden_size]
{
const int hidden_size = input.size(-1);
const int num_tokens = output.numel() / hidden_size;
const auto num_tokens = output.numel() / hidden_size;
const int topk = input.size(1);
dim3 grid(num_tokens);
......
......@@ -492,7 +492,7 @@ void topk_softmax(
torch::Tensor& gating_output) // [num_tokens, num_experts]
{
const int num_experts = gating_output.size(-1);
const int num_tokens = gating_output.numel() / num_experts;
const auto num_tokens = gating_output.numel() / num_experts;
const int topk = topk_weights.size(-1);
const bool is_pow_2 = (num_experts != 0) && ((num_experts & (num_experts - 1)) == 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment