[Attention] Remove deprecated MLA prefill arguments (#42555)
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
This commit is contained in:
@@ -368,12 +368,8 @@ def test_attention_config():
|
||||
"true",
|
||||
"--attention-config.flash_attn_max_num_splits_for_cuda_graph",
|
||||
"16",
|
||||
"--attention-config.use_trtllm_ragged_deepseek_prefill",
|
||||
"true",
|
||||
"--attention-config.use_trtllm_attention",
|
||||
"true",
|
||||
"--attention-config.disable_flashinfer_prefill",
|
||||
"true",
|
||||
"--attention-config.disable_flashinfer_q_quantization",
|
||||
"true",
|
||||
]
|
||||
@@ -385,9 +381,7 @@ def test_attention_config():
|
||||
assert engine_args.attention_config.flash_attn_version == 3
|
||||
assert engine_args.attention_config.use_prefill_decode_attention is True
|
||||
assert engine_args.attention_config.flash_attn_max_num_splits_for_cuda_graph == 16
|
||||
assert engine_args.attention_config.use_trtllm_ragged_deepseek_prefill is True
|
||||
assert engine_args.attention_config.use_trtllm_attention is True
|
||||
assert engine_args.attention_config.disable_flashinfer_prefill is True
|
||||
assert engine_args.attention_config.disable_flashinfer_q_quantization is True
|
||||
|
||||
# set to string form of a dict with all fields
|
||||
@@ -397,10 +391,7 @@ def test_attention_config():
|
||||
'{"backend": "FLASHINFER", "flash_attn_version": 2, '
|
||||
'"use_prefill_decode_attention": false, '
|
||||
'"flash_attn_max_num_splits_for_cuda_graph": 8, '
|
||||
'"use_cudnn_prefill": false, '
|
||||
'"use_trtllm_ragged_deepseek_prefill": false, '
|
||||
'"use_trtllm_attention": false, '
|
||||
'"disable_flashinfer_prefill": false, '
|
||||
'"disable_flashinfer_q_quantization": false}',
|
||||
]
|
||||
)
|
||||
@@ -411,10 +402,7 @@ def test_attention_config():
|
||||
assert engine_args.attention_config.flash_attn_version == 2
|
||||
assert engine_args.attention_config.use_prefill_decode_attention is False
|
||||
assert engine_args.attention_config.flash_attn_max_num_splits_for_cuda_graph == 8
|
||||
assert engine_args.attention_config.use_cudnn_prefill is False
|
||||
assert engine_args.attention_config.use_trtllm_ragged_deepseek_prefill is False
|
||||
assert engine_args.attention_config.use_trtllm_attention is False
|
||||
assert engine_args.attention_config.disable_flashinfer_prefill is False
|
||||
assert engine_args.attention_config.disable_flashinfer_q_quantization is False
|
||||
|
||||
# test --attention-backend flows into VllmConfig.attention_config
|
||||
|
||||
@@ -269,36 +269,21 @@ class TestMLAPrefillBackendParsing:
|
||||
)
|
||||
|
||||
|
||||
class TestDeprecatedFlagMigration:
|
||||
"""Tests for _migrate_deprecated_mla_prefill_flags in AttentionConfig."""
|
||||
class TestMLAPrefillBackendConfig:
|
||||
"""Tests for mla_prefill_backend configuration in AttentionConfig."""
|
||||
|
||||
def test_no_deprecated_flags_leaves_backend_none(self):
|
||||
def test_default_backend_is_none(self):
|
||||
config = AttentionConfig()
|
||||
assert config.mla_prefill_backend is None
|
||||
|
||||
def test_use_trtllm_ragged_migrates_to_trtllm_ragged(self):
|
||||
config = AttentionConfig(use_trtllm_ragged_deepseek_prefill=True)
|
||||
assert config.mla_prefill_backend == MLAPrefillBackendEnum.TRTLLM_RAGGED
|
||||
|
||||
def test_disable_flashinfer_prefill_migrates_to_flash_attn(self):
|
||||
config = AttentionConfig(disable_flashinfer_prefill=True)
|
||||
assert config.mla_prefill_backend == MLAPrefillBackendEnum.FLASH_ATTN
|
||||
|
||||
def test_explicit_backend_ignores_deprecated_flags(self):
|
||||
def test_explicit_flash_attn_backend(self):
|
||||
config = AttentionConfig(
|
||||
mla_prefill_backend=MLAPrefillBackendEnum.FLASH_ATTN,
|
||||
use_cudnn_prefill=True,
|
||||
)
|
||||
assert config.mla_prefill_backend == MLAPrefillBackendEnum.FLASH_ATTN
|
||||
|
||||
def test_cudnn_raises_error(self):
|
||||
match = "cuDNN MLA prefill backend has been removed"
|
||||
with pytest.raises(ValueError, match=match):
|
||||
AttentionConfig(use_cudnn_prefill=True)
|
||||
|
||||
def test_trtllm_takes_priority_over_disable_flashinfer(self):
|
||||
def test_explicit_trtllm_ragged_backend(self):
|
||||
config = AttentionConfig(
|
||||
use_trtllm_ragged_deepseek_prefill=True,
|
||||
disable_flashinfer_prefill=True,
|
||||
mla_prefill_backend=MLAPrefillBackendEnum.TRTLLM_RAGGED,
|
||||
)
|
||||
assert config.mla_prefill_backend == MLAPrefillBackendEnum.TRTLLM_RAGGED
|
||||
|
||||
Reference in New Issue
Block a user