Skip to content

Commit 67dd3a4

Browse files
authored
[UT] fix skip ut test for test_utils (#3803)
### What this PR does / why we need it? [UT] fix ut test for test_utils that #3612 skipped. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? vLLM version: v0.11.0rc3 vLLM main: vllm-project/vllm@17c540a - vLLM version: v0.11.0rc3 - vLLM main: vllm-project/vllm@83f478b --------- Signed-off-by: Meihan-chen <jcccx.cmh@gmail.com>
1 parent eed1957 commit 67dd3a4

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

.github/workflows/vllm_ascend_test.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ jobs:
120120
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/Ascend/ascend-toolkit/latest/x86_64-linux/devlib
121121
pytest -sv --cov --cov-report=xml:unittests-coverage.xml tests/ut \
122122
--ignore tests/ut/torchair/models/test_torchair_deepseek_mtp.py \
123-
--ignore tests/ut/torchair/models/test_torchair_deepseek_v2.py \
124-
--ignore tests/ut/test_utils.py \
125-
--ignore tests/ut/test_platform.py
123+
--ignore tests/ut/torchair/models/test_torchair_deepseek_v2.py
126124
127125
- name: Upload coverage to Codecov
128126
# only upload coverage when commits merged

tests/ut/test_platform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def test_check_and_update_config_unsupported_compilation_level(
359359
if vllm_version_is("0.11.0"):
360360
self.assertEqual(
361361
vllm_config.compilation_config.level,
362-
CompilationMode.NONE,
362+
CompilationLevel.NO_COMPILATION,
363363
)
364364
else:
365365
self.assertEqual(

tests/ut/test_utils.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929

3030
class TestUtils(TestBase):
3131

32+
def setUp(self):
33+
import importlib
34+
35+
from vllm_ascend import platform
36+
importlib.reload(platform)
37+
3238
def test_is_310p(self):
3339
utils._IS_310P = None
3440
with mock.patch("vllm_ascend._build_info.__soc_version__",
@@ -252,16 +258,12 @@ def to_dict(self):
252258
self.assertIn("num_hidden_layers", str(context.exception))
253259

254260
def test_update_aclgraph_sizes(self):
255-
# max_num_batch_sizes < len(original_sizes)
256261
test_compilation_config = CompilationConfig(
257262
cudagraph_capture_sizes=[i for i in range(150)])
258263
model_path = os.path.join(os.path.dirname(__file__), "fake_weight")
259264
test_model_config = ModelConfig(model=model_path, enforce_eager=True)
260265
test_parallel_config = ParallelConfig()
261-
ascend_config = mock.MagicMock()
262-
ascend_config.max_num_batched_tokens = 2048
263-
ascend_config.max_model_len = 1024
264-
ascend_config.ascend_scheduler_config.enabled = False
266+
ascend_config = {"ascend_scheduler_config": {"enabled": False}}
265267
test_vllm_config = VllmConfig(
266268
model_config=test_model_config,
267269
compilation_config=test_compilation_config,
@@ -271,9 +273,18 @@ def test_update_aclgraph_sizes(self):
271273
os.environ['HCCL_OP_EXPANSION_MODE'] = 'AIV'
272274
utils.update_aclgraph_sizes(test_vllm_config)
273275
del os.environ['HCCL_OP_EXPANSION_MODE']
274-
self.assertEqual(
275-
137,
276-
len(test_vllm_config.compilation_config.cudagraph_capture_sizes))
276+
277+
if utils.vllm_version_is("0.11.0"):
278+
self.assertEqual(
279+
137,
280+
len(test_vllm_config.compilation_config.cudagraph_capture_sizes
281+
))
282+
else:
283+
self.assertEqual(
284+
0,
285+
len(test_vllm_config.compilation_config.cudagraph_capture_sizes
286+
))
287+
return
277288

278289
test_vllm_config.speculative_config = mock.MagicMock()
279290
test_vllm_config.speculative_config.num_speculative_tokens = 2

0 commit comments

Comments
 (0)