@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 803b9d7881
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 4, 13:45 UTC

[Bugfix] Fix Deepseek V4 import error due to AOT compile cache loading (#41090)

Signed-off-by: wzhao18 <wzhao18.sz@gmail.com> Signed-off-by: Wei Zhao <51183510+wzhao18@users.noreply.github.com>

Wei Zhao committed Apr 29, 2026 at 00:08 UTC 803b9d7881cd3a8482aaa1e6bf990193b55c6331
1 file changed +5 -5
vllm/model_executor/models/deepseek_v4.py
+5 -5
@@ -1097,6 +1097,11 @@ class DeepseekV4DecoderLayer(nn.Module):
1097 aux_stream_list: list[torch.cuda.Stream] | None = None,
1098 ):
1099 super().__init__()
1100 +
1101 + # Lazy import to avoid top-level tilelang dependency.
1102 + # Registers both torch.ops.vllm.mhc_pre and mhc_post
1103 + import vllm.model_executor.layers.mhc # noqa: F401
1104 +
1105 config = vllm_config.model_config.hf_config
1106 self.hidden_size = config.hidden_size
1107
@@ -1167,11 +1172,6 @@ class DeepseekV4DecoderLayer(nn.Module):
1172 hc_scale: torch.Tensor,
1173 hc_base: torch.Tensor,
1174 ):
1170 - # Lazy import to avoid top-level tilelang dependency.
1171 - # Registers both torch.ops.vllm.mhc_pre and mhc_post,
1172 - # so hc_post() doesn't need its own import.
1173 - import vllm.model_executor.layers.mhc # noqa: F401
1174 -
1175 post_mix, res_mix, layer_input = torch.ops.vllm.mhc_pre(
1176 residual=x,
1177 fn=hc_fn,