[Qwen4Exp] Restore torch.compile on the NVIDIA path; exact breakable pin; runtime graph-mode assertion
- torch.compile restored on the NVIDIA Qwen4Exp target and MTP so the production profile (VLLM_COMPILE + FULL_AND_PIECEWISE, breakable off) runs. - The production pin requires VLLM_USE_BREAKABLE_CUDAGRAPH to be exactly "0". - assert_resolved_cudagraph_modes() runs at the top of capture_model. - CPU tests for the combined profile, the exact pin and the resolved modes. Co-Authored-By: Hinata <hinata@idihore.id> Signed-off-by: MOVZX <movzx@yahoo.com>
This commit is contained in:
@@ -20,6 +20,7 @@ import torch
|
||||
from torch import nn
|
||||
from transformers import Qwen4ExpTextConfig
|
||||
|
||||
from vllm.compilation.decorators import support_torch_compile
|
||||
from vllm.config import VllmConfig, replace, set_current_vllm_config
|
||||
from vllm.distributed import get_pp_group
|
||||
from vllm.model_executor.layers.fused_moe.utils import (
|
||||
@@ -51,7 +52,11 @@ from vllm.model_executor.models.utils import (
|
||||
maybe_prefix,
|
||||
)
|
||||
from vllm.sequence import IntermediateTensors
|
||||
from vllm.v1.e2_guards import assert_graph_profile_is_executable, assert_ple_mode
|
||||
from vllm.v1.e2_guards import (
|
||||
assert_compiled_submodule,
|
||||
assert_graph_profile_is_executable,
|
||||
assert_ple_mode,
|
||||
)
|
||||
|
||||
from .hyperconnection import GatedResidual, HyperConnectionConfig
|
||||
from .low_latency_gemm import enable_qwen4_exp_low_latency_gemm
|
||||
@@ -168,6 +173,18 @@ def _make_draft_vllm_config(
|
||||
return draft_vllm_config
|
||||
|
||||
|
||||
# Compile restored on the drafter too (reverts #55272 here), as
|
||||
# on v2.0.1: both classes wrapped; the outer one compiles, the inner is
|
||||
# inlined while Dynamo traces.
|
||||
@support_torch_compile(
|
||||
dynamic_arg_dims={
|
||||
"input_ids": 0,
|
||||
"positions": -1,
|
||||
"intermediate_tensors": 0,
|
||||
"inputs_embeds": 0,
|
||||
"hidden_states": 0,
|
||||
}
|
||||
)
|
||||
class Qwen4ExpMultiTokenPredictor(nn.Module):
|
||||
hf_to_vllm_mapper = Qwen3_5Model.hf_to_vllm_mapper | _EXTRA_WEIGHTS_MAPPER
|
||||
|
||||
@@ -411,6 +428,7 @@ class Qwen4ExpMTP(
|
||||
vllm_config=vllm_config,
|
||||
prefix=maybe_prefix(prefix, "mtp"),
|
||||
)
|
||||
assert_compiled_submodule(self.model, vllm_config, role="draft")
|
||||
|
||||
if get_pp_group().is_last_rank:
|
||||
if config.tie_word_embeddings:
|
||||
|
||||
Reference in New Issue
Block a user