[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>
This commit is contained in:
jack
2026-09-29 12:42:02 +00:00
committed by GitHub
co-authored by QwertyJack
parent 998490cd9f
commit 79a0307d74
3 changed files with 4 additions and 12 deletions
+2 -2
View File
@@ -1588,14 +1588,14 @@ def test_engram_dp_shared_memory_config_validation(
("DeepseekV41ForCausalLM", [1], "cuda", True),
("DeepseekV41ForCausalLM", [1], "rocm", True),
("DeepseekV41ForCausalLM", [], "cuda", False),
("DeepseekV41ForCausalLM", [1], "cpu", False),
("DeepseekV41ForCausalLM", [1], "cpu", True),
("Qwen4ExpForCausalLM", [1], "cuda", True),
("Qwen4ExpForCausalLM", [1], "rocm", True),
("Qwen4ExpForConditionalGeneration", [1], "cuda", True),
("Qwen4ExpForConditionalGeneration", [1], "rocm", True),
("Qwen4ExpForCausalLM", [], "cuda", False),
("Qwen4ExpForCausalLM", None, "cuda", False),
("Qwen4ExpForCausalLM", [1], "cpu", False),
("Qwen4ExpForCausalLM", [1], "cpu", True),
("LlamaForCausalLM", [1], "cuda", False),
("Qwen4ExpMTP", [], "cuda", False),
(None, None, "cuda", False),
+1 -5
View File
@@ -67,8 +67,6 @@ class EngramConfig:
def verify_model_config(self, model_config: "ModelConfig | None") -> None:
"""Reject Engram configuration for models without n-gram embeddings."""
from vllm.platforms import current_platform
field = (
_NGRAM_LAYER_FIELDS.get(model_config.architecture)
if model_config is not None
@@ -77,13 +75,11 @@ class EngramConfig:
if (
model_config is None
or field is None
or not current_platform.is_cuda_alike()
or not getattr(model_config.hf_text_config, field, None)
):
raise ValueError(
"EngramConfig requires a model with supported Engram "
"embeddings, non-empty n-gram layer ids, and a CUDA-alike "
"device (CUDA or ROCm)."
"embeddings and non-empty n-gram layer ids."
)
def resolve_dp_shared_memory(self, parallel_config: "ParallelConfig") -> None:
+1 -5
View File
@@ -1370,8 +1370,6 @@ class VllmConfig:
def _resolve_and_verify_engram_config(self) -> None:
"""Resolve defaults and validate n-gram embedding settings."""
from vllm.platforms import current_platform
model_config = self.model_config
speculative_config = self.speculative_config
# Draft configs inherit the target's communication groups and settings.
@@ -1392,9 +1390,7 @@ class VllmConfig:
"Disable --enable-dbo and set --ubatch-size to 0."
)
if self.engram_config is None:
if not current_platform.is_cuda_alike() or not model_has_engram_layers(
model_config
):
if not model_has_engram_layers(model_config):
return
self.engram_config = EngramConfig()
self.engram_config.verify_model_config(model_config)