Unverified Commit 7ed8e51b authored by Varun Vinayak Shenoy's avatar Varun Vinayak Shenoy Committed by GitHub
Browse files

[fix] Fix divide by zero error for llama4. (#8683)

parent 32f28154
......@@ -415,6 +415,8 @@ class Llama4DecoderLayer(nn.Module):
)
def _is_moe_layer(self, layer_id: int) -> bool:
if self.config.interleave_moe_layer_step == 0:
return self.config.num_local_experts > 0
return (layer_id + 1) % self.config.interleave_moe_layer_step == 0
def forward(
......
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