[BugFix] Fixes Qwen3-Next enable nz accuracy problem (#4058)

### What this PR does / why we need it?
- Fixes Qwen3-Next enable nz accuracy problem

### Does this PR introduce _any_ user-facing change?
N/A


- vLLM version: v0.11.0
- vLLM main:
83f478bb19

---------

Signed-off-by: Icey <1790571317@qq.com>
Signed-off-by: wxsIcey <1790571317@qq.com>
This commit is contained in:
Icey
2025-11-10 20:54:57 +08:00
committed by GitHub
parent e6625bb582
commit e04a87f4be
8 changed files with 36 additions and 20 deletions

View File

@@ -46,12 +46,18 @@ class TestUtils(TestBase):
self.assertFalse(utils.is_310p())
def test_is_enable_nz(self):
with mock.patch("vllm_ascend.utils.envs_ascend.VLLM_ASCEND_ENABLE_NZ",
1):
self.assertTrue(utils.is_enable_nz())
with mock.patch("vllm_ascend.utils.envs_ascend.VLLM_ASCEND_ENABLE_NZ",
0):
self.assertFalse(utils.is_enable_nz())
# Case when _ENABLE_NZ is already set
utils._ENABLE_NZ = True
self.assertTrue(utils.is_enable_nz())
utils._ENABLE_NZ = False
self.assertFalse(utils.is_enable_nz())
# Case when _ENABLE_NZ is None and vllm_config is not provided
utils._ENABLE_NZ = None
with self.assertRaises(ValueError) as context:
utils.is_enable_nz()
self.assertIn("vllm_config must be provided", str(context.exception))
def test_sleep_mode_enabled(self):
utils._SLEEP_MODE_ENABLED = None