Repository navigation
Conversation
Add opt-in pack/selective dequant plus companion full counted dequant, contract/accuracy tests, and p50 microbench JSON (default OFF).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Port Compact TopK-union selective KV dequant from SGLang #635 (KV slice only).
Includes:
_pack_compact_sparse_token_ids/ LightOpdsv4_pack_sparse_topk_workspacedsv4_dequantize_sparse_topk_out(selective)kv_full_dequant_lightop.py)Does not port mHC/CP fusion or CP in-place reorder from the same SGLang PR.
Why
Provides the SparsePrefill flat-ID ABI and a measured full-counted dequant path. Selective TopK alone is not a microbench win at small shapes → both gates stay default OFF.
Accuracy
tests/runtime_patch/test_compact_topk_dequant_contract.pytests/accuracy/test_compact_topk_dequant_accuracy.pyPerformance (p50)
Selective vs full counted (same device class as fusion bench notes):
JSON:
tests/accuracy/compact_topk_dequant_perf.jsonFair note from fusion rebase notes: vs vLLM-native, full counted is the ~3.5× path; selective alone is opt-in for ABI/parity, not speed.
How to use
Contract:
full_ids.numel() <= Q * topkceil(P·584/576)·576bind_dsv41()→install_compact_topk_dequant()/install_kv_full_dequant()Test plan
pytest tests/runtime_patch/test_compact_topk_dequant_contract.py tests/accuracy/test_compact_topk_dequant_accuracy.py -qpython tests/accuracy/bench_compact_topk_dequant_perf.py