Manual
Write a pass whose contract you can explain
A useful pass needs more than a matching instruction sequence. It must explain which inputs it admits, which values and effects it preserves, how it publishes valid code, and what its tests establish. Start with one transformation and explicit refusals; broaden it only when the new cases have their own evidence.
1. Build the current tool
Use the real CMake settings, existing tables, upstream MLIR, and serial host checks.
2. Establish the baseline
Inspect and optimize a cubin, or intercept an application and apply MLIR passes as its kernels load.
3. Learn the compiler contracts
Understand the obligations exposed by predication, encoding, asynchronous ownership, layout, and launch failures.
4. Follow a shipped pass
Walk through FMA admission, SSA binding, checked replacement, analysis lifetime, and focused validation.
5. Understand the evidence
Use control flow, physical liveness, uniformity, and symbolic analyses without carrying stale results across edits.
6. Respect physical constraints
Keep SSA values, register groups, encoding limits, and postallocation dependencies consistent.
Keep the command reference nearby
The current sass-mlir commands, ordered pipeline, output contracts, and runtime plugin boundary.
What good looks like
Four questions for every transformation
- Why is this site eligible? Name the architecture, operand forms, numerical policy, control-flow assumptions, and unsupported effects.
- What changes together? Keep structured instruction fields, actual SSA sources/results, predicates, old destination values, and scheduling evidence consistent. Remove stale raw encoding authority when content changes.
- Can the result be published? Use shared encoding and layout machinery; reject unencodable words, unresolved remaps, and invalid metadata ownership.
- What has been proved? Host tests establish structure and encoding. GPU comparisons establish the tested numerical behavior and progress. Timing follows correctness and names the exact workload and artifact.
The FMA walkthrough answers each question against the shipped implementation and shows how to check the affected contract. It is the starting point for writing passes in this tree.
Beyond the first pass
Capture and research case studies
Capture and lift
Runtime ABI plugins and offline cubin inspection feed the same host workflow.
Kernel policy experiments
Admission, replacement, and deployment constraints for targeted kernel policies.
Attention research routes
Follow source-program reconstruction and the bounded execution study.
On-device integration
Target-specific runtime integration and validation constraints on Jetson platforms.