[Bugfix][CPU] Fix basic unit tests failing in CPU platforms (#34677)

Signed-off-by: Yanwen Lin <lyw1124278064@gmail.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Yanwen Lin
2026-02-25 00:36:15 -08:00
committed by GitHub
parent 80e60a6133
commit 675ec59aa9

View File

@@ -926,12 +926,17 @@ def test_vllm_config_defaults(model_id, compiliation_config, optimization_level)
# Verify other compilation_config defaults
compilation_config_dict = default_config["compilation_config"]
for k, v in compilation_config_dict.items():
if k != "pass_config":
actual = getattr(vllm_config.compilation_config, k)
expected = v(vllm_config) if callable(v) else v
assert actual == expected, (
f"compilation_config.{k}: expected {expected}, got {actual}"
)
if k == "pass_config":
continue
actual = getattr(vllm_config.compilation_config, k)
expected = v(vllm_config) if callable(v) else v
# On platforms without static graph support, __post_init__ forces
# cudagraph_mode to NONE; expect that instead of the level default.
if k == "cudagraph_mode" and not current_platform.support_static_graph_mode():
expected = CUDAGraphMode.NONE
assert actual == expected, (
f"compilation_config.{k}: expected {expected}, got {actual}"
)
def test_vllm_config_callable_defaults():
@@ -969,6 +974,10 @@ def test_vllm_config_callable_defaults():
assert enable_if_sequential(config_quantized) is True
@pytest.mark.skipif(
not current_platform.support_static_graph_mode(),
reason="Explicit overrides may be force-overwritten without static graph support.",
)
def test_vllm_config_explicit_overrides():
"""Test that explicit property overrides work correctly with callable defaults.