[Test] Refactor hard coded device string in test files under compile/quantization/models/model_executor folders (#38901)

Signed-off-by: Liao, Wei <wei.liao@intel.com>
This commit is contained in:
wliao2
2026-04-15 11:02:35 +08:00
committed by GitHub
parent f4b42df048
commit 3abf858443
24 changed files with 122 additions and 66 deletions
+3 -1
View File
@@ -17,8 +17,10 @@ from vllm.config.compilation import (
)
from vllm.config.scheduler import SchedulerConfig
from vllm.forward_context import set_forward_context
from vllm.platforms import current_platform
MLP_SIZE = 64
DEVICE_TYPE = current_platform.device_type
@support_torch_compile
@@ -71,7 +73,7 @@ class TraceStructuredCapture:
@pytest.mark.skipif(not torch.cuda.is_available(), reason="CUDA required")
def test_vllm_structured_logging_artifacts(use_fresh_inductor_cache):
"""Test that all expected vLLM artifacts are logged during compilation."""
torch.set_default_device("cuda")
torch.set_default_device(DEVICE_TYPE)
capture = TraceStructuredCapture()