Conversation
kvark
marked this pull request as ready for review
September 19, 2026 22:40
Base automatically changed from
perf/native-projection-fusion-2026-09-19
to
perf/attention-autotune-2026-09-19
September 20, 2026 01:50
Owner
Author
|
Superseded by #200 as requested: one simplified PR against current main with focused commits. The existing branch and measured revisions remain available for reproducibility. Closing this PR so review can continue in one place. |
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.
Stacked on #194, which includes the merged #195.
Implementation
Resolve each dispatch's pipeline variant after compilation, tuning, attention-sequence replacement and tuning swaps.
step()uses the installed choice instead of allocating candidate lists and rehashing generated kernels. Profiling keys report that same choice.Commands and descriptors are freshly recorded, with current buffers bound on every step. No command replay, new API, dependency, test executable or device/model threshold. The runtime change is 26 added / 20 removed lines.
Pipeline-selection results
Three fresh processes per arm and GPU, rotated order, on the matched SmolLM2-135M diagnostic. Intel recording falls from 1.347 to 1.283 ms and decode from 4.696 to 4.640 ms (about 1.2%; all three pairs improve). NVIDIA decode is mixed: 2.398 to 2.415 ms with overlapping process ranges; no decode gain is established. Both prefill medians improve about 1%. This is a small cleanup, not the main explanation of the gap.
Separate scheduling finding
The source-only sweep on
experiment/submission-overlap-2026-09-19changes only the existing submission count, keeping kernel choices fixed within each process. With three processes per GPU and forward/reverse sweeps, eight freshly recorded chunks give:Nsight confirms GPU work starts before the final chunk is submitted in all 320 captured eight-chunk decode steps. Prefill becomes 7.279/19.903 ms versus llama.cpp's 7.120/15.639 ms. Intel prefill remains a substantial gap.
All thirteen settings produce bit-identical saved logits within each process; all 84 saved sets including llama.cpp retain 33/33 independent CPU-reference next-token choices. This is batch-one decode, with unchanged readback and arithmetic, not a batched-throughput result. Clocks were not fixed. More chunks eventually regress; this PR does not hard-code eight or change the one-submission default. A bounded scheduling search on representative work is still needed; the sweep is not an automatically selected held-out result.
Revisions, full tables, limitations and reproduction.
Verification
452 library tests pass. All four existing opt-in GPU tests pass on both GPUs, including repeated attention-sequence replacement and swaps that preserve distinct training states. The 18 pipeline-comparison logit sets also pass. All kernel comparisons qualify within unchanged budgets. Formatting and all-feature/all-target Clippy pass.
Implementation CI passes all six jobs, including Metal, Windows, MSRV and coverage. Rust host line coverage is 83.7% overall (81.1% in runtime.rs); WGSL is not instrumented. The final commit is documentation only. The known Naga Workgroup ArrayStride warning remains.
Raw timings, logits, native captures and binaries remain outside Git. The submitted paper and frozen Inferena cohort are unchanged.