Support MLA properly in the Transformers modeling backend (#48250)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2026-08-04 13:24:11 +01:00
committed by GitHub
parent 24c939c47d
commit 59b2fdfc4e
9 changed files with 704 additions and 57 deletions
+7 -1
View File
@@ -1789,7 +1789,13 @@ class ModelConfig:
@property
def use_mla(self) -> bool:
return self.is_deepseek_mla and not envs.VLLM_MLA_DISABLE
if envs.VLLM_MLA_DISABLE:
return False
if self.using_transformers_backend():
# kv_lora_rank indicates that a Transformers model implementation uses MLA
return getattr(self.hf_text_config, "kv_lora_rank", None) is not None
# Manually maintained list of model types for vLLM model implementations
return self.is_deepseek_mla
@property
def is_matryoshka(self) -> bool: