vllm.models.step5.nvidia.ops.sparse_prefill
¶
Compact sparse-prefill KV gathering and reusable host planning metadata.
Functions:
-
gather_prefill_kv–Gather selected tokens in exactly the boolean-indexed reference order.
-
make_indptr–Compute exact compact lengths from the selector's cardinality contract.
-
make_prefill_chunks–Share CPU plans and one GPU prefix copy across all sparse layers.
gather_prefill_kv(cache, regions, block_table, owners, positions, cu_kv, total_tokens, max_length, *, output_dtype=None, k_scale=None, v_scale=None)
¶
Gather selected tokens in exactly the boolean-indexed reference order.
Source code in vllm/models/step5/nvidia/ops/sparse_prefill.py
make_indptr(positions, region_count)
¶
Compute exact compact lengths from the selector's cardinality contract.
Source code in vllm/models/step5/nvidia/ops/sparse_prefill.py
make_prefill_chunks(positions, topk, device)
¶
Share CPU plans and one GPU prefix copy across all sparse layers.