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
4548c03c
Unverified
Commit
4548c03c
authored
Jul 05, 2025
by
Chengji Yao
Committed by
GitHub
Jul 05, 2025
Browse files
[TPU][Bugfix] fix the MoE OOM issue (#20339)
Signed-off-by:
Chengji Yao
<
chengjiyao@google.com
>
parent
40b86aa0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
vllm/model_executor/layers/fused_moe/layer.py
vllm/model_executor/layers/fused_moe/layer.py
+7
-2
No files found.
vllm/model_executor/layers/fused_moe/layer.py
View file @
4548c03c
...
@@ -1320,8 +1320,13 @@ class FusedMoE(torch.nn.Module):
...
@@ -1320,8 +1320,13 @@ class FusedMoE(torch.nn.Module):
def
forward
(
self
,
hidden_states
:
torch
.
Tensor
,
def
forward
(
self
,
hidden_states
:
torch
.
Tensor
,
router_logits
:
torch
.
Tensor
):
router_logits
:
torch
.
Tensor
):
return
torch
.
ops
.
vllm
.
moe_forward
(
hidden_states
,
router_logits
,
# TODO: Once the OOM issue for the TPU backend is resolved, we will
self
.
layer_name
)
# switch to using the moe_forward custom op.
if
current_platform
.
is_tpu
():
return
self
.
forward_impl
(
hidden_states
,
router_logits
)
else
:
return
torch
.
ops
.
vllm
.
moe_forward
(
hidden_states
,
router_logits
,
self
.
layer_name
)
def
forward_impl_chunked
(
self
,
full_hidden_states
:
torch
.
Tensor
,
def
forward_impl_chunked
(
self
,
full_hidden_states
:
torch
.
Tensor
,
full_router_logits
:
torch
.
Tensor
):
full_router_logits
:
torch
.
Tensor
):
...
...
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