Conversation
Signed-off-by: tjtanaa <tunjian.tan@embeddedllm.com>
Signed-off-by: tjtanaa <tunjian.tan@embeddedllm.com>
Signed-off-by: tjtanaa <tunjian.tan@embeddedllm.com>
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: tjtanaa <tunjian.tan@embeddedllm.com>
|
For Upstream CI:
For AMD CI:
|
| metadata.paged_kv_last_page_len = paged_kv_last_page_len | ||
| metadata.paged_kv_indices = paged_kv_indices | ||
| metadata.paged_kv_indptr = paged_kv_indptr | ||
| # A long pure prefill is modeled as many separate qseqlen=1 entries. |
There was a problem hiding this comment.
When fixing the unit test this issue surfaces.
There was a problem hiding this comment.
The issue is surfaced by these two numerical cases:
tests/v1/attention/test_sparse_mla_backends.py::test_sparse_backend_decode_correctness[1.0-1.0-64-2-auto-large_q_pure_prefill-ROCMAiterMLA]
tests/v1/attention/test_sparse_mla_backends.py::test_sparse_backend_decode_correctness[2.0-3.0-64-2-auto-large_q_pure_prefill-ROCMAiterMLA]
The parameters mean:
- BF16 KV cache: auto
- Pure prefill: large_q_pure_prefill
- Prefill length: 256
- topk_tokens: 128
- Simulated TP=2: 64 query heads
- Block size: 64
- Scale pairs: 1.0/1.0 and 2.0/3.0
|
|
||
|
|
||
| @pytest.fixture(autouse=True) | ||
| def _skip_cuda_specific_sparse_mla_tests_on_rocm(request): |
There was a problem hiding this comment.
Is this applied when you run the tests in a bulk? I had a weird case in the past that I dont remember well, where this would not be applied unless I just pytest only this file.
There was a problem hiding this comment.
Yes. It does skip the rest.
|
It's LGTM from me, gonna stamp it soon as well (mostly waiting for the answer on my previous comment, although i m sure i m just imagining things .. would like a review from Rohan (@Rohan138) for the src (the sparse mla changes). |
|
This pull request has merge conflicts that must be resolved before it can be |
Purpose
This PR follows #47327 in optimizing the performance for short sequence prefill of ROCm AITER Sparse MLA backend.
Test Plan
Update unit tests
Add unit tests to make sure that we cover the cases below for metadata and correctness tests: Permute the following aspects:
seqlen < topk_tokensandseqlen >= topk_tokensGSM8K with 30 num-shot
Performance gain on DeepSeek V3.2
Test Result
Unit test
pytest tests/v1/attention/test_sparse_mla_backends.pypytest tests/kernels/attention/test_rocm_aiter_mla_sparse_metadata_sync.pyServer command:
LM-Eval Command
Perf improvement on DeepSeek-V3.2
Benchmark command:
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.