vllm.models.hy_v4.amd.aiter_mla_sparse
¶
AITER sparse MLA backend for HY V4 top-k rows that are not front-packed (ROCm).
The AITER sparse path reads each row's first paged_kv_indptr delta entries
and maps an invalid index to slot 0 rather than skipping it. The DFly draft
composes each top-k row from the target's history, padding, and the draft's
causal block, so its live entries are not at the front of the row and their
count depends on the target's history. This backend packs every row in place
and rebuilds paged_kv_indptr from the live counts before each layer reads it,
without a host sync.
Classes:
-
HYV4AiterMLASparseImpl–Sparse MLA that packs and counts each top-k row before reading it.
Functions:
-
pack_live_indices_–Stably move each row's live indices to its front, in place.
-
warn_if_aiter_triton_sparse_mla_disabled–Warn when HY V4 sparse MLA would use AITER's default decode kernel.
HYV4AiterMLASparseImpl
¶
Bases: ROCMAiterMLASparseImpl
Sparse MLA that packs and counts each top-k row before reading it.
Source code in vllm/models/hy_v4/amd/aiter_mla_sparse.py
pack_live_indices_(indices)
¶
Stably move each row's live indices to its front, in place.
Returns the number of live indices per row.
Source code in vllm/models/hy_v4/amd/aiter_mla_sparse.py
warn_if_aiter_triton_sparse_mla_disabled()
¶
Warn when HY V4 sparse MLA would use AITER's default decode kernel.
That kernel reads the wrong KV rows once a layer's KV cache passes 4 GiB (fixed by ROCm/aiter#6277); the Triton sparse MLA kernel does not.