luminal
AGENTS.md3k starsChanged 7 days agoApache-2.0View on GitHub
All other functionality is split into crates in the crates/ directory. For instance, the Cuda compiler is in luminal_cuda_lite and the autograd engine is in luminal_training. luminal_nn has common nn modules. - Spin (working in core / the bufferizer / rewrites): cargo test -p luminal --lib. Nothing else. This is the loop you should be in almost all the time. - Spin + proof of life (the core change must still drive a runtime): add ONE targeted runtime test, e.g.…
Trending
Quiet since July.thin dataabout the whole repository
Who's talking about luminal-ai/luminal
- A Hacker News story“Show HN: Luminal – Open-source, search-based GPU compiler”Hacker News · Aug 20, 2025 · 153 points
- @chris.blue“Ok, can someone explain to me WTF this means? Is this legit or vapor?”Bluesky · Aug 23, 2025 · 3 likes
- @tickfoundry.com“Show HN: Luminal – Open-source, search-based GPU compiler. Automates performance optimization for ML and …”Bluesky · Aug 21, 2025 · 3 likes
- egraphs-good/egglog“Example of manual decomposition leading to large speedup”GitHub · Jul 8, 2026 · 1 reactions
- @pp0196.bsky.social“@josiahparry.com why not build it in this framework github.com/luminal-ai/l... and expose it to R and add …”Bluesky · Nov 7, 2025 · 1 likes
The biggest 5 of 8 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 8
Talked about on Bluesky, GitHub and Hacker News (8 times).
On Bluesky · 4
- Aug 23, 2025Ok, can someone explain to me WTF this means? Is this legit or vapor? — @chris.blue3 likes and reposts
- Aug 21, 2025Show HN: Luminal – Open-source, search-based GPU compiler. Automates performance optimization for ML and HPC by intelligently searching for… — @tickfoundry.com3 likes and reposts
- Nov 7, 2025@josiahparry.com why not build it in this framework github.com/luminal-ai/l... and expose it to R and add an oxidized backend to the R… — @pp0196.bsky.social1 likes and repost
- Aug 20, 2025An open-source GPU compiler is a welcome addition to the ecosystem. More control & transparency for developers could unlock some exciting… — @n-r.hr1 likes and repost
On GitHub · 3
- Jul 8, 2026Example of manual decomposition leading to large speedup — egraphs-good/egglog1 reaction · 3 comments
- Feb 17, 2026Fix custom operators — JuliaSymbolics/Metatheory.jl0 reactions · 2 comments
- Aug 21, 2025HN Top Posts 2025-08-21 — EFLql/hackernews-daily0 reactions
On Hacker News · 1
- Aug 20, 2025Show HN: Luminal – Open-source, search-based GPU compiler153 points · 60 comments
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 6
All other functionality is split into crates in the crates/ directory.
- Distinctive: line 40
If a backend cannot implement the authored semantics within its supported operations or resource limits, compilation must refuse.
- Distinctive: line 42
When outputs are incorrect, first root-cause the failing compiler/runtime path.
- Distinctive: line 43
Avoid narrow special-case fixes.
- Very specific: line 45
Add regression tests at the level where the bug occurred.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Contributor Guide
Structure
Luminal is a core-and-plugin design, where the core crate . contains everything core to Luminal including the graph and the GraphTensor api, the shapetracker, and the primitive ops.
All other functionality is split into crates in the crates/ directory. For instance, the Cuda compiler is in luminal_cuda_lite and the autograd engine is in luminal_training. luminal_nn has common nn modules.
Testing Instructions
- Find the CI plan in the .github/workflows folder.
- Currently running
cargo testin luminal_metal and luminal_cuda_lite require access to an Apple and Nvidia GPU respectively. - PRs must have no clippy errors and
cargo fmtmust be ran before a PR is submitted.
Run only the tests you need (tiers)
cargo test --workspace is a LANDING gate, not an iteration gate. Reaching for it
mid-change is the single biggest waste in this repo — measured: one zoo decode
loop is 185s, luminal_nn's decoder_block_matches_scalar_reference is 98s and
llama_block_forward_rope... is 47s, while genuine unit tests are 1-2s each.
- Spin (working in core / the bufferizer / rewrites):
cargo test -p luminal --lib. Nothing else. This is the loop you should be in almost all the time. - Spin + proof of life (the core change must still drive a runtime): add ONE
targeted runtime test, e.g.
cargo test -p luminal_reference --lib <filter>or a single named-p luminal_cuda_lite --test <file>. Enough to prove the seam, not the corpus. - Landing (about to commit, or the change is done): the full sweep —
cargo test -p luminal,-p luminal_reference,-p luminal_cuda_lite,-p test_runtime,-p luminal_nn, plus device suites where a GPU is available.
The mini model families provide execution-only smoke coverage in the runtime
crates; for example, cargo test --release -p luminal_reference --test
mini_model_smoke. Numerical and cross-runtime correctness belongs in the
operation/runtime suites rather than model examples. A smoke test is ignored
only for a documented blocker; mini_flux_runs records the current adaLN
rejoin-divergence search issue in its reason string.
Debugging and Correctness
- The authored model definition is the single source of functional truth. For a PyTorch frontend this is the PyTorch program, including its captured dtype and distributed-placement semantics; for a Rust frontend it is the recorded
GraphTensormodel. Preserve operation semantics, shapes, dtypes, casts, accumulator and output dtypes, explicit rounding boundaries, constants, aliasing/mutation, sharding placements, collectives, and collective order exactly. - Reduction association and evaluation order are unspecified unless the model explicitly authors an ordered or sequential operation. A backend may reassociate or tree-reduce within the authored operator while preserving its dtype, accumulator contract, explicit casts/rounding boundaries, exceptional-value contract, and other observable semantics.
- The compiler may change only the implementation. Egglog may select kernels, fuse operations, choose layouts, reuse buffers, and reschedule work only when the result is semantically equivalent to the authored model over the complete valid input and dynamic-shape domain. It must never silently introduce mixed precision, quantization, a different accumulator or output dtype, a new cast, resharding, replication, or a different collective topology.
- If a backend cannot implement the authored semantics within its supported operations or resource limits, compilation must refuse. Approximate output, numerical closeness, hardware convention, better performance, or fitting in memory are never permission to change the model.
- Do not change model code, prompt templates, weights, dtype policy, sharding, or example logic to make compilation or execution pass. A model-definition correction is allowed only with direct evidence that the definition itself disagrees with its authoritative source, and the correction must be tested as a model change rather than presented as a compiler optimization.
- When outputs are incorrect, first root-cause the failing compiler/runtime path. Prefer isolating the bad LLIR/HLIR graph, rewrite, op lowering, shape/stride assumption, layout contract, or runtime implementation that caused the mismatch.
- Avoid narrow special-case fixes. A fix should state and enforce the general invariant it relies on, or explicitly document why the affected operation is only valid for a restricted layout/shape and ensure rewrites enforce that restriction.
- For e-graph/search issues, every selectable LLIR graph must be semantically equivalent to the authored model and to every other selectable graph. If two selectable graphs disagree, debug and remove the invalid equivalence; never select around the bad graph.
- Add regression tests at the level where the bug occurred. Prefer tests that compare against a semantic reference such as
ReferenceRuntimeor a small independent reference, and use fixed seeds for any randomized search/fuzz test so failures are reproducible.
Compiler Rewrite Boundary
- All graph pattern matching and op selection must be expressed in egglog rewrites. Do not add Rust-side LLIR graph post-passes that search for op patterns, fuse kernels, select backend ops, or otherwise rewrite extracted graphs after egglog. If a backend needs a fused/specialized op, add the match and rewrite in egglog and let extraction produce that op directly.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

