fix: reserve Qwen3-Omni NVFP4 backend fix (#7200)
Signed-off-by: kunkunblueberry <1833921874@qq.com>
This commit is contained in:
1 parent
7c1b1e4189
commit
2f1845fa4e
4 files changed
+59
-8
No files matched your search
@@ -764,12 +764,15 @@ def prepare_engine_environment() -> None:
|
||||
pass
|
||||
|
||||
|
||||
def _maybe_set_qwen3_omni_moe_backend(engine_args_dict: dict[str, Any]) -> None:
|
||||
def _maybe_set_qwen3_omni_moe_backend(
|
||||
engine_args_dict: dict[str, Any],
|
||||
*,
|
||||
moe_backend_is_explicit: bool | None = None,
|
||||
) -> None:
|
||||
"""Choose the stable MoE backend when Qwen3-Omni has no explicit choice."""
|
||||
if (
|
||||
engine_args_dict.get("model_arch") == "Qwen3OmniMoeForConditionalGeneration"
|
||||
and engine_args_dict.get("moe_backend", "auto") == "auto"
|
||||
):
|
||||
if moe_backend_is_explicit is None:
|
||||
moe_backend_is_explicit = "moe_backend" in engine_args_dict
|
||||
if engine_args_dict.get("model_arch") == "Qwen3OmniMoeForConditionalGeneration" and not moe_backend_is_explicit:
|
||||
engine_args_dict["moe_backend"] = "triton"
|
||||
logger.info("[stage_init] Set moe_backend=triton for Qwen3-Omni stage")
|
||||
|
||||
@@ -1121,6 +1124,10 @@ def _project_omni_stage_engine_args(
|
||||
# The legacy builder always emits this key, including for pipelines such
|
||||
# as Audex that intentionally defer architecture discovery to HF config.
|
||||
engine_args["model_arch"] = copy.deepcopy(stage_config.model_config.model_arch)
|
||||
_maybe_set_qwen3_omni_moe_backend(
|
||||
engine_args,
|
||||
moe_backend_is_explicit="moe_backend" in getattr(stage_config.model_config, "_omni_explicit_fields", ()),
|
||||
)
|
||||
|
||||
topology = stage_config.stage_pipeline_config
|
||||
topology_engine_args = {
|
||||
@@ -1283,7 +1290,6 @@ def _finalize_engine_args_dict(
|
||||
engine_args_dict["has_sampling_extra_args"] = has_sampling_extra_args
|
||||
engine_args_dict["sampling_extra_args_keys"] = sampling_extra_args_keys
|
||||
|
||||
# Select the typed backend option during stage argument finalization.
|
||||
_maybe_set_qwen3_omni_moe_backend(engine_args_dict)
|
||||
return engine_args_dict
|
||||
|
||||
|
||||
Reference in new issue
Block a user