Repository navigation
aot: a launch's 1 may take the runtime-parameter variant after every folded candidate - #1020
GustavBlack wants to merge 2 commits into
Conversation
|
Thanks @GustavBlack for the runtime-one fallback and your 1,379-passing-test receipt, and @cwschroeder for the mixed-specialization example. We're taking this with fixes for 1.1.1. Both preferred selection passes retain priority before the runtime-1 fallback. Review added protection for Posted by Ash's AI Assistant Synthena |
|
2A evidence is posted on #1003: #1003 (comment) On |
# Conflicts: # zig/tests/cuda/main.zig
|
PR conflict cleared. I merged main
|
|
Checks finished on the merged head: That job is new in main ( |
Closes #1003, with @cwschroeder's mixed-specialization case from that thread as a test.
What this changes
find()'s second pass may now serve a launch's1from the variant that reads the argument at runtime — thefallback #1003 proposes, in the shape Ash preferred there: only after every candidate that specialized the
launch's 1s has had its own pass, so a constexpr-1 variant always wins when the capture holds one. The
matcher's guard narrows to the exact pass (
fit == .exact), and the general pass splits in two:constexpr-1 candidate wins even though the runtime variant also matches under the general rules;
(
aot: <fn> runs variant <hash>, its 1 read at runtime (the capture holds no folded variant of it)); the loudMissingTritonVarianterror and its argument dump are unchanged.The rule
aot.zigopens with ("each launch picks the variant Triton itself would have picked") holds in theexact pass and in the new first pass; the second pass is the fallback this issue argued for, and the one our
fork's GLM port exercises on every two-rank boot (the captured set's drafting session never records
_merge'sone-row launches).
Tests
Host (
aot.zig, no GPU — the set parses without its cubins):the folded variant wins when the set holds it (was: refused "in either pass");
main(
9ccf4727) withMissingTritonVariant, passes here;one is picked — passes on
maintoo, kept as the guard against the naive single-guard narrowing;div16) leaves the launch to the runtimevariant.
Device (
tf-cuda-test aot-fallback <dir>, new):zig/tests/cuda/aot_fallback_kernels.pycompiles one tinykernel's two specializations on the running device (R=1 folds, R=2 stays a runtime parameter) into an aot set;
the check runs the launch from the full set and from the set with the folded variant removed, and compares the
outputs byte for byte.
Receipt
0d12a6f7on9ccf4727; the build and the device check on a GB10 (sm_121,CUDA 13.3, the nvcc container pytorch 26.07); the host tests in the same container without GPUs.
zig build test(the three-phase build's second phase): 1379/1386 passed, 7 skipped (the GPU-gated ones, ontheir usual skip), none failed.
tf-cuda-test aot-fallbackon the GB10: PASS, the fallback's log line firing on the fallback launches, thefolded variant's bits byte for byte.
python3 tools/zig/lean_check.py: 517 problems, identical to the same run on9ccf4727(517); the onefinding in
aot.zig(a///line past 120 columns) is inherited and shifted.zig fmt --checkclean.Checklist
already launches for that variant's other launches.
check's fixture needs Triton in the image; the host tests parse aot.json text with no GPU and no cubins).