Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
86debab5
Unverified
Commit
86debab5
authored
Jul 01, 2025
by
Richard Barnes
Committed by
GitHub
Jul 01, 2025
Browse files
Fix `numel()` downcast in vllm/csrc/moe/moe_align_sum_kernels.cu +2 (#17082)
Co-authored-by:
mgoin
<
mgoin64@gmail.com
>
parent
be250bbc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
csrc/moe/moe_align_sum_kernels.cu
csrc/moe/moe_align_sum_kernels.cu
+1
-1
csrc/moe/topk_softmax_kernels.cu
csrc/moe/topk_softmax_kernels.cu
+1
-1
No files found.
csrc/moe/moe_align_sum_kernels.cu
View file @
86debab5
...
...
@@ -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
);
...
...
csrc/moe/topk_softmax_kernels.cu
View file @
86debab5
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment