### What this PR does / why we need it? - Fixes Qwen3-Next enable nz accuracy problem --------- Signed-off-by: wxsIcey <1790571317@qq.com> Signed-off-by: Icey <1790571317@qq.com>
This commit is contained in:
@@ -59,6 +59,7 @@ _MIN_DP_BUFFER_SIZE = 50
|
||||
_IS_MOE_MODEL = None
|
||||
_ENABLE_SP = None
|
||||
_HAS_LAYER_IDX = None
|
||||
_ENABLE_NZ = None
|
||||
|
||||
|
||||
def is_310p():
|
||||
@@ -69,8 +70,14 @@ def is_310p():
|
||||
return _IS_310P
|
||||
|
||||
|
||||
def is_enable_nz():
|
||||
return envs_ascend.VLLM_ASCEND_ENABLE_NZ
|
||||
def is_enable_nz(vllm_config: Optional[VllmConfig] = None) -> bool:
|
||||
global _ENABLE_NZ
|
||||
if _ENABLE_NZ is None:
|
||||
if not vllm_config:
|
||||
raise ValueError(
|
||||
"vllm_config must be provided when _ENABLE_NZ is None")
|
||||
_ENABLE_NZ = envs_ascend.VLLM_ASCEND_ENABLE_NZ and vllm_config.model_config.hf_config.model_type != "qwen3_next"
|
||||
return _ENABLE_NZ
|
||||
|
||||
|
||||
def sleep_mode_enabled():
|
||||
|
||||
@@ -81,6 +81,7 @@ class NPUWorker(WorkerBase):
|
||||
# register patch for vllm
|
||||
from vllm_ascend.utils import adapt_patch
|
||||
adapt_patch()
|
||||
is_enable_nz(vllm_config)
|
||||
# Register ops when worker init.
|
||||
from vllm_ascend import ops
|
||||
ops.register_dummy_fusion_op()
|
||||
|
||||
Reference in New Issue
Block a user