[CI] speed up ut (#4901)
avoid model download to speed up ut test.
- vLLM version: v0.12.0
- vLLM main:
ad32e3e19c
Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import torch
|
||||
@@ -507,8 +508,6 @@ class TestAscendMLAMetadataBuilderBuild(TestBase):
|
||||
|
||||
def setUp(self):
|
||||
self.mock_vllm_config = MagicMock(spec=VllmConfig)
|
||||
self.mock_vllm_config.model_config = ModelConfig(max_model_len=2048)
|
||||
self.mock_vllm_config.model_config.hf_text_config.qk_rope_head_dim = 32
|
||||
self.mock_vllm_config.cache_config = CacheConfig(block_size=32)
|
||||
mock_scheduler_config = MagicMock(spec=SchedulerConfig)
|
||||
mock_scheduler_config.max_num_seqs = 8
|
||||
@@ -516,7 +515,15 @@ class TestAscendMLAMetadataBuilderBuild(TestBase):
|
||||
self.mock_vllm_config.scheduler_config = mock_scheduler_config
|
||||
self.mock_vllm_config.speculative_config = None
|
||||
self.mock_device = torch.device("cpu")
|
||||
|
||||
fake_weight_path = os.path.join(os.path.dirname(__file__), "..",
|
||||
"fake_weight")
|
||||
model_config = ModelConfig(
|
||||
model=fake_weight_path,
|
||||
skip_tokenizer_init=True,
|
||||
)
|
||||
model_config.hf_text_config.head_dim = 128
|
||||
model_config.hf_text_config.qk_rope_head_dim = 32
|
||||
self.mock_vllm_config.model_config = model_config
|
||||
self.kv_cache_spec = MagicMock()
|
||||
self.kv_cache_spec.num_layers = 32
|
||||
self.kv_cache_spec.head_size = 128
|
||||
|
||||
@@ -4,7 +4,6 @@ from unittest.mock import MagicMock, patch
|
||||
import pytest
|
||||
import torch
|
||||
from vllm.config.compilation import CompilationMode, CUDAGraphMode
|
||||
from vllm.engine.arg_utils import EngineArgs
|
||||
from vllm.platforms import PlatformEnum
|
||||
|
||||
from tests.ut.base import TestBase
|
||||
@@ -579,30 +578,3 @@ class TestNPUPlatform(TestBase):
|
||||
self.platform.get_static_graph_wrapper_cls(),
|
||||
"vllm_ascend.compilation.acl_graph.ACLGraphWrapper",
|
||||
)
|
||||
|
||||
def test_aclgraph_enable(self):
|
||||
config = EngineArgs()
|
||||
VllmConfig = config.create_engine_config()
|
||||
self.assertEqual(VllmConfig.compilation_config.cudagraph_mode,
|
||||
CUDAGraphMode.PIECEWISE)
|
||||
|
||||
with self.assertLogs(logger="vllm", level="INFO") as cm:
|
||||
from vllm_ascend import platform
|
||||
|
||||
importlib.reload(platform)
|
||||
self.platform.check_and_update_config(VllmConfig)
|
||||
target_msg = "PIECEWISE compilation enabled on NPU. use_inductor not supported - using only ACL Graph mode"
|
||||
found = any(target_msg in log for log in cm.output)
|
||||
|
||||
self.assertTrue(
|
||||
found,
|
||||
f"Expected log message not found. Captured logs: {cm.output}")
|
||||
|
||||
self.assertEqual(
|
||||
VllmConfig.compilation_config.mode,
|
||||
CompilationMode.VLLM_COMPILE,
|
||||
)
|
||||
self.assertEqual(
|
||||
VllmConfig.compilation_config.cudagraph_mode,
|
||||
CUDAGraphMode.PIECEWISE,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user