[Config] Remove Engram CUDA-alike device restrictions (#59171)

Signed-off-by: QwertyJack <7554089+QwertyJack@users.noreply.github.com> Co-authored-by: QwertyJack <7554089+QwertyJack@users.noreply.github.com>

jack committed Sep 29, 2026 at 20:42 UTC 79a0307d7463b11938c30e924c606509601b22aa
3 files changed +4 -12
tests/test_config.py
+2 -2
@@ -1588,14 +1588,14 @@ def test_engram_dp_shared_memory_config_validation(
1588 ("DeepseekV41ForCausalLM", [1], "cuda", True),
1589 ("DeepseekV41ForCausalLM", [1], "rocm", True),
1590 ("DeepseekV41ForCausalLM", [], "cuda", False),
1591 - ("DeepseekV41ForCausalLM", [1], "cpu", False),
1591 + ("DeepseekV41ForCausalLM", [1], "cpu", True),
1592 ("Qwen4ExpForCausalLM", [1], "cuda", True),
1593 ("Qwen4ExpForCausalLM", [1], "rocm", True),
1594 ("Qwen4ExpForConditionalGeneration", [1], "cuda", True),
1595 ("Qwen4ExpForConditionalGeneration", [1], "rocm", True),
1596 ("Qwen4ExpForCausalLM", [], "cuda", False),
1597 ("Qwen4ExpForCausalLM", None, "cuda", False),
1598 - ("Qwen4ExpForCausalLM", [1], "cpu", False),
1598 + ("Qwen4ExpForCausalLM", [1], "cpu", True),
1599 ("LlamaForCausalLM", [1], "cuda", False),
1600 ("Qwen4ExpMTP", [], "cuda", False),
1601 (None, None, "cuda", False),
vllm/config/engram.py
+1 -5
@@ -67,8 +67,6 @@ class EngramConfig:
67
68 def verify_model_config(self, model_config: "ModelConfig | None") -> None:
69 """Reject Engram configuration for models without n-gram embeddings."""
70 - from vllm.platforms import current_platform
71 -
70 field = (
71 _NGRAM_LAYER_FIELDS.get(model_config.architecture)
72 if model_config is not None
@@ -77,13 +75,11 @@ class EngramConfig:
75 if (
76 model_config is None
77 or field is None
80 - or not current_platform.is_cuda_alike()
78 or not getattr(model_config.hf_text_config, field, None)
79 ):
80 raise ValueError(
81 "EngramConfig requires a model with supported Engram "
85 - "embeddings, non-empty n-gram layer ids, and a CUDA-alike "
86 - "device (CUDA or ROCm)."
82 + "embeddings and non-empty n-gram layer ids."
83 )
84
85 def resolve_dp_shared_memory(self, parallel_config: "ParallelConfig") -> None:
vllm/config/vllm.py
+1 -5
@@ -1370,8 +1370,6 @@ class VllmConfig:
1370
1371 def _resolve_and_verify_engram_config(self) -> None:
1372 """Resolve defaults and validate n-gram embedding settings."""
1373 - from vllm.platforms import current_platform
1374 -
1373 model_config = self.model_config
1374 speculative_config = self.speculative_config
1375 # Draft configs inherit the target's communication groups and settings.
@@ -1392,9 +1390,7 @@ class VllmConfig:
1390 "Disable --enable-dbo and set --ubatch-size to 0."
1391 )
1392 if self.engram_config is None:
1395 - if not current_platform.is_cuda_alike() or not model_has_engram_layers(
1396 - model_config
1397 - ):
1393 + if not model_has_engram_layers(model_config):
1394 return
1395 self.engram_config = EngramConfig()
1396 self.engram_config.verify_model_config(model_config)