round 34 track b: hc-down tail narrowing #
decision #
ship a single 96-column tail tile, not serial 64+16. patch: /tmp/sol_r34_prompt/sol_r34_prompt.patch. git -C vendor/strata apply --check exits 0. tracked vendor files were never edited.
production hc-down tiles improve roughly 5% at t=512, 6–7% at t=1024, 6–7% at t=1983/2048 in short paired a/b measurements on apple m5. all requested bitwise checks pass. hc-up and swiglu-up stay unchanged: their attempted guard/pointer optimization did not establish a win.
this computes nominal 128+128+96 = 352 rather than 384 columns (-8.33%), not the proposed 336 (-12.5%). minimizing nominal arithmetic alone lost badly. no full-model performance claim is made.
design and scope #
only original metal/kernels/prompt.metal lines 559–589 change. extracted the existing GEMM/register epilogue to one inline template; the existing entry point selects width 96 only when TN=128, hc=4, and the tile contains exactly 64 remaining down columns. all other shapes use the existing width. no ABI, host grid, buffer layout, allocations, arithmetic, or output guards change. no duplicate epilogue. tests already covered the required cases, so no test changes ship.
final visual review used view_diff and view_code over the full modified helper and entry point. searched for existing helper equivalents; none found.
reproducibility #
- vendor head at snapshot:
296b59d2f73c8f04a805df29c2fa97655adace78; baseline is the actual working-tree file, not assumed identical to head. - isolated scratch tree:
/tmp/sol_r34_prompt/strata, baseline committed in its local git repo. - exact baseline:
/tmp/sol_r34_prompt/baseline-prompt.metal, sha25686adff9cfdbdf1af34ecfbdab0bef8b9e0668b3884a577469ac7bc58140f13a3. - final source:
/tmp/sol_r34_prompt/candidate-final.metal, sha25697a3391e86fc1fa0ba5089263e4d5bdb15e6ef4b4c2b5c375f3da5e859013921. - evaluator: existing
vendor/strata/build-metal/comb_fold_parity, sha256ba877816cf682d912ebdcd5fcd30e83dfcdcb9ff024b06ff58c8ad3d9547bf30; C++ evaluator unchanged. - every run sets
STRATA_METAL_KERNELS=/tmp/sol_r34_prompt/strata/metal/kernels; no math override. - no children spawned, no port 8080 access, no full-model CLI runs. every test invocation completed under 6 seconds, with timeouts 10 or 20 seconds.
- baseline check:
comb_fold_parity 256 epipassed before edits, logbaseline-256-epi.log.
correctness #
all final runs exited 0 with bitwise PASS:
| command arguments | log basename | elapsed seconds |
|---|---|---|
1024 |
final96-main1024.log |
4.98 |
0 epi |
final96-epi.log |
0.94 |
256 hcup |
final96-hcup.log |
0.05 |
512 ab /tmp/sol_r34_prompt/baseline-prompt.metal |
final96-full-ab-512.log |
1.35 |
1024 ab /tmp/sol_r34_prompt/baseline-prompt.metal |
final96-full-ab-1024.log |
1.93 |
2048 ab /tmp/sol_r34_prompt/baseline-prompt.metal |
final96-full-ab-2048.log |
3.74 |
all logs reside under /tmp/sol_r34_prompt/. 0 epi sweeps t=1,7,64,256,512,1024,1983,2048 and seven tile shapes against separate plain GEMM + epilogue. a/b additionally compares the old fused implementation directly, using a different random seed family. hcup tests mixed both bound and unbound.
measured performance #
existing a/b evaluator: 12 alternating samples, 8 repeated dispatches per sample, swaps output buffer placement; reports median paired ratios. lower is better. exploratory metric/evaluator was held fixed; confirmation repeats use fresh invocations, not new inputs.
final single-tail96 confirmation ratios (final-confirm{0,1,2}-ab-T.log):
| t | production tile | repeat 0 | repeat 1 | repeat 2 |
|---|---|---|---|---|
| 512 | 32_128_4 | 0.9489 | 0.9535 | 0.9518 |
| 1024 | 64_128_4 | 0.9290 | 0.9268 | 0.9097* |
| 1983 | 32_128_2 | 0.9367 | 0.9360 | 0.9281 |
| 2048 | 32_128_2 | 0.9325 | 0.9337 | 0.9408 |
representative first confirmation candidate/baseline ms: t512 0.2739/0.2890; t1024 0.6261/0.6739; t1983 1.1007/1.1754; t2048 1.1366/1.2152.
*timing contamination is visible, not suppressed: t1024 repeat 2 had 1.7585/1.8084 ms and ratio sample range [0.8752,1.1092], unlike normal ~0.63/0.67 ms. final full-a/b t2048 also gave a regression ratio 1.0411 [1.0041,1.1757] while unchanged hc-up jumped from ~1.13 to ~2.0 ms. this is evidence of changing shared GPU conditions, not proof of its precise cause. three immediate t2048 rechecks returned 0.9315, 0.9360, 0.9739; last recheck remained noisy [0.9429,1.0189]. retained in final96-recheck{0,1,2}-ab-2048.log. the win is supported by repeated stable short tests, but loaded-system/full-model confirmation remains the parent's job.
rejected experiments #
snapshots and logs are retained; nothing below ships.
candidate-down-v1.metal: fast interior helper plus serial 64+16 (or 16-only for TN64), including full-row guards. all0 epichecks passed, but direct fused a/b at t512 failed bitwise and latency ratios were 1.4482, 1.2021, 1.5143 at t512/1024/2048. do not infer decomposition bitwise safety from one seed family. the exact source of the bitwise difference was not isolated.candidate-up-sw-v1.metal: full-row guards and pointer/index hoisting. a/b parity passed. hc-up ratios 1.0042/1.0058/1.0041; swiglu-up 1.0541/1.0218/0.9906. rejected for no net win. rawup-sw-v1-ab-T.log.candidate-down-v2.metal: single width80 TN128 tail, width16 TN64 tail. parity sweep passed. production TN128 ratios 0.9472/0.9346/1.1276. SG2 width80 regressed.candidate-down-v3.metal: width80 only for SG4. confirmed SG4 improvements and SG2 neutrality; superseded by width96 to recover SG2 gains without differing tail widths.candidate-down-v4.metal: SG4 width80 / SG2 width96. t1983/2048 ratios 0.9268/0.9324.candidate-down-v5.metalswitched both to width96, matching SG4 latency within noise, leading to the simpler final selection.
application #
git -C vendor/strata apply /tmp/sol_r34_prompt/sol_r34_prompt.patch
no unrelated vendor lines or files are in the patch. report and immutable scratch evidence are the deliverables; parent owns integration and any full-model measurement.
parent subsequently confirmed tracks a/c ran GPU parity concurrently during the late timing spike; parent plans an exclusive-GPU integration confirmation.