vllm.models.hy_v4_flash.amd.swa
¶
ROCm sparse MLA backends and causal window indexing for HYV4 Flash.
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, so every indexer
must pack its live indices to the front of the row, and the builder must count
exactly the live entries of each row.
Functions:
-
live_counts–Live top-k entries per query token, given its logical position.
-
window_indices–Causal window indices packed to the front of each row.
live_counts(seq_lens, query_start_loc, num_tokens, max_query_len, window, ratio, group_budget)
¶
Live top-k entries per query token, given its logical position.
A window row holds min(pos + 1, window) entries. A compressed row holds
up to group_budget whole history groups plus the pos % ratio + 1
tokens of its open group, which is pos + 1 until the budget saturates.
Source code in vllm/models/hy_v4_flash/amd/swa.py
window_indices(positions, window, width)
¶
Causal window indices packed to the front of each row.