@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / b4ac4fa04d
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 12:15 UTC

[model] make llama4 compatible with pure dense layers (#17315)

Signed-off-by: Lucia Fang <fanglu@fb.com>

Lucia Fang committed Apr 28, 2025 at 19:22 UTC b4ac4fa04da14c4f40688fb98211367981a1f4d7
1 file changed +2 -2
vllm/model_executor/models/llama4.py
+2 -2
@@ -273,8 +273,8 @@ class Llama4DecoderLayer(nn.Module):
273 cache_config=cache_config,
274 prefix=f"{prefix}.self_attn",
275 )
276 - is_moe_layer = (self.layer_idx +
277 - 1) % config.interleave_moe_layer_step == 0
276 + is_moe_layer = config.interleave_moe_layer_step > 0 and (
277 + self.layer_idx + 1) % config.interleave_moe_layer_step == 0
278 if is_moe_layer:
279 self.feed_forward = Llama4MoE(
280 config=config,