[Kernel][SM70] Port actual FlashInfer CUDA decode to sparse QSA (prototype) - #513
Draft
yangzhuxinyzx wants to merge 2 commits into
Draft
yangzhuxinyzx wants to merge 2 commits into
yangzhuxinyzx wants to merge 2 commits into
Conversation
Instantiate pinned upstream decode and cascade kernels through an ordered sparse KV adapter. Keep serving dispatch unchanged pending GPU correctness and performance validation. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Warm all benchmark arms before paired timing, report hardware telemetry, and record component gains without promoting the B1-regressing prototype to serving. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
This was referenced Sep 5, 2026
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.
Purpose
Begin a real FlashInfer CUDA source port to Volta, starting with sparse QSA.
Instantiate the actual upstream paged-decode and cascade kernels through an
ordered virtual-page adapter; no forwarding to Triton or Flash-V100. This is
an experimental benchmark entry, not a serving/default change.
755baae1d075ee04fa9096b23fc0225b23589a86(main).6b2f4ad8e9c1ddebf375bb1ea163dc2b5891ced4.6c14bbd5ff34210404d5d4b5f6ff3b4b2527f59f, unmodified headers.16bd510c9b712e82b0ab6cbb630d8e29ba1f7116.upstream FlashInfer CUDA computation, not another existing native-FA route
or a changed Triton launch heuristic. Issue [Perf][SM70/SM75] Pre-Ampere tuning findings from a mixed Volta/Turing rig — QSA #441's older prefill dispatch
fix is already on main and is not repeated here.
Implementation: FP16 D256, variable batch/page/selection width, GQA 1/2/4/6/8,
ordered selections including duplicates, 64-bit KV offsets, invalid-slot zero
loads, FP32 partials/LSE, persistent per-instance buffers and graph-compatible
GPU preparation. Upstream's existing pre-SM80 synchronous-load fallback is
used. The global FlashInfer hardware gate remains unchanged.
Test Plan
sm_70compilation and library loading.strided tensors, alignment guards and poisoned-buffer CUDA Graph replay.
B1/4/8/16, with index preparation and merge included.
runtime admission. No model speed claim from component or compile results.
the fixed 70 tok/s single-request denominator.
Test Result
cuobjdump: nativesm_70, GQA6 72 registers/thread, zero stack/local.5 passed, 9 skipped; GPU skips are not GPU passes.mypy, shellcheck, Markdown and repository-specific checks).
racecheck 0 errors / 0 warnings. Older system sanitizer failures were
not counted as passes; see worklog.
8192 context / 2051 sparse slots / page784, 11 samples x 100 calls:
The FlashInfer arm includes preparation + decode + merge; best splits are
from an exploratory 16/32/64 sweep. Auto boost, post-sample 1530/877 MHz,
driver 580.173.02. Maximum observed relative L2 versus FP32 = 0.00021144.
No E2E/model-quality acceptance or default change; B1 regression explicitly
prevents global admission. GPU processes exited and memory released.
Commands and contract:
docs/design/sm70_flashinfer_qsa_port.md.The benchmark-only test is run with
--confcutdir=flashinfer-sm70/tests; nonew wheel is required. Generated build/test artifacts remain unversioned.
Risks: SIMT may be slower than the existing tensor-core route; numerical
reduction order differs and task quality is not proven by an FP32 unit oracle.
FP8 KV, prefill, fused gate, GDN/conv and TP integration are later stages, not
claimed supported by this prototype. Keep Draft until GPU gates and human
review are complete.
This work is AI-assisted (Codex); human maintainer review is required before
promotion or merge. All commits carry DCO sign-off and AI attribution.