Unverified Commit 675ec59a authored by Yanwen Lin's avatar Yanwen Lin Committed by GitHub
Browse files

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


Signed-off-by: default avatarYanwen Lin <lyw1124278064@gmail.com>
Co-authored-by: default avatarHarry Mellor <19981378+hmellor@users.noreply.github.com>
parent 80e60a61
...@@ -926,12 +926,17 @@ def test_vllm_config_defaults(model_id, compiliation_config, optimization_level) ...@@ -926,12 +926,17 @@ def test_vllm_config_defaults(model_id, compiliation_config, optimization_level)
# Verify other compilation_config defaults # Verify other compilation_config defaults
compilation_config_dict = default_config["compilation_config"] compilation_config_dict = default_config["compilation_config"]
for k, v in compilation_config_dict.items(): for k, v in compilation_config_dict.items():
if k != "pass_config": if k == "pass_config":
actual = getattr(vllm_config.compilation_config, k) continue
expected = v(vllm_config) if callable(v) else v actual = getattr(vllm_config.compilation_config, k)
assert actual == expected, ( expected = v(vllm_config) if callable(v) else v
f"compilation_config.{k}: expected {expected}, got {actual}" # 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(): def test_vllm_config_callable_defaults():
...@@ -969,6 +974,10 @@ def test_vllm_config_callable_defaults(): ...@@ -969,6 +974,10 @@ def test_vllm_config_callable_defaults():
assert enable_if_sequential(config_quantized) is True 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(): def test_vllm_config_explicit_overrides():
"""Test that explicit property overrides work correctly with callable defaults. """Test that explicit property overrides work correctly with callable defaults.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment