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
5e5baa91
Unverified
Commit
5e5baa91
authored
Jun 16, 2025
by
bnellnm
Committed by
GitHub
Jun 16, 2025
Browse files
[Kernels] Use empty for modular MoE workspaces (#19667)
Signed-off-by:
Bill Nell
<
bnell@redhat.com
>
parent
836d4ce1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
vllm/model_executor/layers/fused_moe/fused_batched_moe.py
vllm/model_executor/layers/fused_moe/fused_batched_moe.py
+3
-0
vllm/model_executor/layers/fused_moe/modular_kernel.py
vllm/model_executor/layers/fused_moe/modular_kernel.py
+2
-2
No files found.
vllm/model_executor/layers/fused_moe/fused_batched_moe.py
View file @
5e5baa91
...
@@ -716,6 +716,9 @@ class BatchedTritonExperts(mk.FusedMoEPermuteExpertsUnpermute):
...
@@ -716,6 +716,9 @@ class BatchedTritonExperts(mk.FusedMoEPermuteExpertsUnpermute):
intermediate_cache2
=
_resize_cache
(
workspace2
,
intermediate_cache2
=
_resize_cache
(
workspace2
,
(
E
,
max_num_tokens
,
N
//
2
))
(
E
,
max_num_tokens
,
N
//
2
))
if
self
.
use_fp8_w8a8
:
intermediate_cache1
.
fill_
(
0
)
# MM1
# MM1
invoke_moe_batched_triton_kernel
(
A
=
hidden_states
,
invoke_moe_batched_triton_kernel
(
A
=
hidden_states
,
B
=
w1
,
B
=
w1
,
...
...
vllm/model_executor/layers/fused_moe/modular_kernel.py
View file @
5e5baa91
...
@@ -426,10 +426,10 @@ class FusedMoEModularKernel(torch.nn.Module):
...
@@ -426,10 +426,10 @@ class FusedMoEModularKernel(torch.nn.Module):
# We can reuse the memory between cache1 and cache3 because by the
# We can reuse the memory between cache1 and cache3 because by the
# time we need cache3, we're done with cache1.
# time we need cache3, we're done with cache1.
workspace13
=
torch
.
zeros
(
prod
(
workspace13_shape
),
workspace13
=
torch
.
empty
(
prod
(
workspace13_shape
),
device
=
a1
.
device
,
device
=
a1
.
device
,
dtype
=
workspace_dtype
)
dtype
=
workspace_dtype
)
workspace2
=
torch
.
zeros
(
prod
(
workspace2_shape
),
workspace2
=
torch
.
empty
(
prod
(
workspace2_shape
),
device
=
a1
.
device
,
device
=
a1
.
device
,
dtype
=
workspace_dtype
)
dtype
=
workspace_dtype
)
...
...
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