Repository navigation
experiment: attribute the losing case's cost to a plan decision, not to a layout - #98
Merged
Merged
Conversation
…to a layout `experiments/openblas-kernel` gained `src/bin/traversal.rs`: one contraction - the campaign's worst losing TCCG case, `abjc-cbka-kj` f64 16 MiB, effective GEMM 92160x40x48 - under four operand layouts, the case's own plan-recorded "corpus" strides against compact column-major matrices, for `A` and the output independently. Same family, same blocking, same thread budget. The result inverted the question the binary was written to answer. All four variants run in 11.4-34.3 ms, and the two that carry the *campaign's own layouts* run in 11.6 ms - while the campaign's plan takes 38.1 ms on that case with the identical family (`avx512.f64.real.24x8`) and blocking (264/1536/256). Comparing the plans explains it: this binary's plan folds the `m` group into two axes, the campaign's keeps three. So on this problem a plan-level traversal decision is worth 3.3x, and the layout swap the binary was built to measure moves nothing (11.62 against 11.41 ms). Two caveats, both in the README: the `residual` column compares permuted buffers, so it is not a correctness check; and the layouts and dimensions are faithful to the plan's record while the *plan* built from them is not the campaign's, so this attributes a decision, not a measurement of a published cell. Results and manifest in `results/2026-10-10-traversal/`.
shinaoka
force-pushed
the
exp/traversal-attribution
branch
from
October 10, 2026 09:48
db290c5 to
b59e135
Compare
This was referenced Oct 10, 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.
experiments/openblas-kernelgainedsrc/bin/traversal.rs: one contraction — the campaign's worst losing TCCG case,abjc-cbka-kjf64 16 MiB, effective GEMM 92160×40×48 — under four operand layouts. The case's own plan-recorded "corpus" strides versus compact column-major matrices, forAand for the output independently. Same family, same blocking, same thread budget; only the layout changes.Result (1T, best of 5, 1500 ms per variant —
results/2026-10-10-traversal/)corpus-a-corpus-dcorpus-a-compact-dcompact-a-corpus-dcompact-a-compact-dIt inverted the question the binary was written to answer. The two variants carrying the campaign's own layouts run in 11.6 ms, while the campaign's plan takes 38.1 ms on that case with the identical family (
avx512.f64.real.24x8) and blocking (264/1536/256). The plans differ: this binary's plan folds themgroup into two axes (PlanStats.m_axes), the campaign's keeps three. So on this problem a plan-level traversal decision is worth 3.3×, and the operand-layout swap the binary was built to measure moves nothing (11.62 vs 11.41 ms).Two caveats, both in the README
residualcolumn compares differently permuted buffers, so it is not a correctness check — ignore it.Why this matters for the design question
Everything else a reader would blame has been measured and excluded: the micro-kernel (a production kernel in our driver is 1.4–2.0× slower on every shape), the blocking model, the blocking values, the orientation, the partition, the write-back mode, the output alignment (forcing
align_c_lines=trueleaves 38.17 vs 38.24 ms), and the row-block shape (mr=8gains 5%). What is left is the packed route's traversal, and this binary shows a 3.3× spread that comes from the plan rather than from the data layout.