Export Cake KNN build plan-runtime suite (112-shape geomean 2.41x, 111-shape 1.2x floor passes)#6
Open
yyihuang wants to merge 2 commits into
Open
Conversation
Plan-based launch runtime with per-signature CUDA graphs (LaunchPlan cache, TMA variant-bank pointer rebinding, graph-replay hot path) exported and validated on 4x NVIDIA GB200: 112/112 correctness and ordered route parity, hot public synchronized-E2E speedup vs live flashlib.flash_knn geomean 2.2427 across all 112 contract shapes, declared 105-shape publication floor min 1.2017 / geomean 2.3704 with 0 rows below the 1.2x floor. The 7 excluded rows are GPU-bound kernel-evolution scope, reported fail-closed in VALIDATION.json all-shape diagnostics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Re-exported from Cake main 42070e96d, which consumes the GPU-bound residual wave (vectorized row-norm kernel) and re-declares the publication floor over 111 of 112 shapes. Validated on 4x GB200: 112/112 correctness and route parity, all-112 hot public E2E geomean 2.4107 vs live flashlib.flash_knn with a single row below 1.2x (rag_online_common_d4096_b1_q1_m65536_k10 at 1.129, was 0.668), and the 111-shape 1.2x floor passing with 0 below (min 1.2505, geomean 2.4272). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
This PR re-exports Cake KNN build through the new plan-based launch runtime with per-signature CUDA graphs and is the direct successor of PR #14. Same reusable two-stage public API:
The committed artifact was generated and validated from exact merged Cake main
42070e96d0734cb580854baef60f17625ba33bb5, which includes the full plan-based export runtime arc (Cake MRs 293/299/300/301: per-signature resolvedLaunchPlan+ plan cache, prepacked argument buffers, TMA variant-bank pointer rebinding, multi-kernel route capture into per-signature CUDA graphs) plus the GPU-bound residual wave (vectorized row-norm kernel), which cleared 6 of the 7 previously GPU-bound residual shapes. Exact provenance is embedded inmanifest.json.What changed vs PR #14
PR #14 measured geomean 1.30x GPU-span wins that inverted to 0.823x public E2E: the frozen interpreted host stack spent ~0.18 ms/call (guard cascade, ctypes marshalling, per-call TMA descriptor encode, host-synchronous repair certification) — ~83% of FlashLib's entire E2E budget — before the GPU saw the last launch, and 91/112 shapes missed the 1.2x publication floor, so that run failed closed. This export compiles the dispatch instead: every contract signature resolves at export time into a static launch plan whose route chain is stream-captured once into a CUDA graph; all 112 signatures take the graph hot path (fail-closed check), host enqueue drops to ~50–90 us, and host-submission gaps leave the GPU timeline entirely. The residual kernel-evolution wave then cleared the GPU-bound rows the runtime could not reach.
Correctness and scope
cuda_graphhot path enforced per shape)sm_100a)flashlib.flash_knn, same session, CUPTI timing everywhereHot steady-state synchronized E2E vs PR #14
Official metric:
flashlib.flash_knn / runtime.compute, synchronized host end-to-end (raw inputs, default output allocation, route-required norms, slot lookup/rebinding, launch work, GPU execution and gaps, terminal synchronization).<1.0x<1.2xEvery shape now beats FlashLib hot. The single floor-exempt row (
rag_online_common_d4096_b1_q1_m65536_k10, 1.129x — was 0.668x before the residual wave) is GPU-bound kernel-evolution scope, pinned by a regression-armor test and fully visible inVALIDATION.jsonall_shape_diagnostics(fail-closed).Modeled amortized synchronized E2E
Cold init-once median 478 ms and first
compute()median 71.5 ms remain NVRTC-dominated; prebuilt cubins (plan-runtime design steps 4–5) are the queued follow-up, so the including-init table still loses at small N by design.Validation contract
VALIDATION.json, per-shapeBENCHMARK_RESULTS.json, human summaryVALIDATION.md.🤖 Generated with Claude Code
Mirrors yyihuang/flashlib#18 onto the FlashML-org upstream.