vllm.models.kimi_k3.amd.ops.fp4_indexer
¶
No-RoPE FP4 indexer quantization for the AITER row-group layout.
Each 128-element head has four UE8M0 scales and 64 E2M1 payload bytes. Cache writes preserve the physical page stride of the merged MLA cache.
Functions:
-
cache_views–View index sections as payload/scales without copying across MLA pages.
-
decode_layout–Group verify rows by request and bound scores in rank-local key space.
-
decode_tile_size–Bound logits, selection scratch and queries while grouping verify rows.
-
quantize_queries–Quantize [rows, heads, 128] without folding scales into head weights.
-
score_paged–Score one bounded query tile using shared-key row-group FP4 MLA logits.
-
store_keys–Quantize normalized keys into merged cache pages; negative slots are padding.
cache_views(cache)
¶
View index sections as payload/scales without copying across MLA pages.
Source code in vllm/models/kimi_k3/amd/ops/fp4_indexer.py
decode_layout(seq_lens, query_lens, num_rows, dcp_rank=0, dcp_world_size=1, interleave=1)
¶
Group verify rows by request and bound scores in rank-local key space.
seq_lens are global, uncompressed sequence lengths from indexer metadata. Graph padding remains outside the last query boundary, with zero key bounds. No device-to-host reads are needed, including for nonuniform verify lengths.
Source code in vllm/models/kimi_k3/amd/ops/fp4_indexer.py
decode_tile_size(max_model_len, width, topk, heads)
¶
Bound logits, selection scratch and queries while grouping verify rows.
Source code in vllm/models/kimi_k3/amd/ops/fp4_indexer.py
quantize_queries(q)
¶
Quantize [rows, heads, 128] without folding scales into head weights.
Source code in vllm/models/kimi_k3/amd/ops/fp4_indexer.py
score_paged(query, cache, weights, block_table, query_starts, row_ends, max_query_len)
¶
Score one bounded query tile using shared-key row-group FP4 MLA logits.
Weights include the model's head/softmax factors, but not FP4 group scales. The AITER reader must support physical page strides for merged caches.
Source code in vllm/models/kimi_k3/amd/ops/fp4_indexer.py
store_keys(keys, cache, slots)
¶
Quantize normalized keys into merged cache pages; negative slots are padding.