Fix the shared expert & routed expert overlap in Llama 4 (#12405)

Co-authored-by: Brayden Zhong <b8zhong@users.noreply.github.com>
This commit is contained in:
b8zhong
2025-10-30 20:14:49 -07:00
committed by GitHub
parent 9416ee60dd
commit 34c286b811

View File

@@ -148,7 +148,7 @@ class Llama4MoE(nn.Module):
return out_aD
def _forward_core(self, hidden_states, forward_mode: ForwardMode):
if hidden_states.shape[0] < 4 and _is_cuda:
if _is_cuda:
return self._forward_core_shared_routed_overlap(hidden_states)
else:
return self._forward_core_normal(hidden_states)