Repository navigation
[llvm][Skill] Add an LLVM kernel-tuning and verification skill - #1154
Merged
Merged
Conversation
Phil-amd
force-pushed
the
phil/llvm-skill-only
branch
2 times, most recently
from
September 20, 2026 02:06
2108e96 to
ab09b20
Compare
Phil-amd
force-pushed
the
phil/llvm-skill-only
branch
2 times, most recently
from
September 20, 2026 02:12
2672f3d to
87616b4
Compare
Phil-amd
force-pushed
the
phil/llvm-skill-only
branch
2 times, most recently
from
September 20, 2026 04:52
66e138b to
6bf71b0
Compare
Nothing in the tree could answer "which LLVM knob do I turn, and did it apply?" -- a grep of all 17 SKILL.md files finds no -mllvm, llc, opt or mlir-opt recipe anywhere. That gap is what let the four inert knobs removed in #1153 sit there unnoticed: a knob that silently does nothing looks exactly like one that works, since an unknown hint still forces a recompile. So the skill leads with verification, not with the knob list. Every recipe pairs an artifact grep with a mandatory negative control: misspell the key, and the assertion must fail; if it still passes, the instrument is dead. Ships per-arch references for gfx950 and gfx1250, whose occupancy knobs are not interchangeable, and two scripts proven against both controls. Cross-references added to the four sibling skills that lead here; nothing discovers a skill automatically. flydsl-kernel-authoring also had two mis-attributions about the dead opts= lane, corrected in passing.
Phil-amd
force-pushed
the
phil/llvm-skill-only
branch
from
September 21, 2026 12:07
6bf71b0 to
0f4a2a1
Compare
coderfeli
approved these changes
Sep 22, 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.
What
A skill for tuning a FlyDSL kernel through LLVM — picking the compile hint,
function attribute or backend flag — and, crucially, proving the knob reached
codegen before believing any result.
Why a skill, not a doc section
The tree is knob-rich and instrument-poor. A grep of all 17
SKILL.mdfilesfinds no
-mllvm,llc,optormlir-optrecipe anywhere: nothing couldanswer "did this knob apply?". That gap is exactly what let the four inert
knobs removed in #1153 sit unnoticed — a knob that silently does nothing looks
identical to one that works, because an unknown hint still forces a recompile.
So the skill leads with verification, not with a knob list. Every recipe
pairs an artifact grep with a mandatory negative control:
The assertion must now fail. If it still passes, the instrument is dead — stop
before recording any result. Claims are artifact greps, never timings: gfx950
carries ±14% clock noise, and a knob that changed nothing in the IR cannot have
changed the runtime.
Key points
Per-arch references, because occupancy knobs are not interchangeable.
amdgpu-num-vgpr=64yields 128 registers on gfx942/gfx950 (silently doubled viahasGFX90AInsts) but exactly 64 on gfx1250; max occupancy is 8 waves/SIMD onCDNA versus 16 on gfx1250. Each file leads with that arch's silent failure — for
gfx1250,
-mattr=+wavefrontsize64emits a zero-instruction object with exitcode 0 and no diagnostic.
Two scripts, each proven against a positive and a negative control:
llvm_knob_check.pyseparates cl::opt from function attribute from missing, soa flag is checked against the LLVM that will actually compile;
llvm_ir_attrs.pytabulates or diffs per-kernel attributes from an IR dump.
Documented as correct, not as a limitation: FlyDSL raising on gfx1250's
legacy
s_waitcntis right — that intrinsic abortsllcthere (rc=134) whilecompiling fine on gfx950.
Cross-references added to the four sibling skills that lead here; nothing
discovers a skill automatically.
flydsl-kernel-authoringalso carried twomis-attributions about the dead
opts=lane, corrected in passing.Testing
Every
[source]claim re-verified line by line against the pinned LLVM(
e2a39f504), and every[measured]one by runningllc— each with apositive control established before any negative was recorded. Both scripts
re-run against their controls after every edit.
check_repo.py(including theAPI-drift gate) and the style gate pass on this branch.