Compile customized GPU kernels and Python model graphs to native NVIDIA SASS and cubins.
OpenAssembler targets A100 / SM80. Its native backend selects instructions, allocates registers, schedules dependencies and encodes GPU machine code. Production execution loads OpenAssembler-owned cubins through the CUDA driver.
Install with Homebrew and authenticate Modal once:
brew tap lucialuka/openassembler https://github.com/lucialuka/OpenAssembler
brew install lucialuka/openassembler/openassemblerIf you are using Modal
If you do not have access to real NVIDIA hardware, you can use Modal for A100 and other Nvidia hardware. Just enter:modal setupStart OpenAssembler from your terminal:
openassemblerThe logo appears each time you open the interactive shell. At its prompt, enter
commands directly. In your own ML repository, omit the path to use the current
directory: inspect, compile --backend modal --verify, then
run --backend modal. Your ML environment can stay active; OpenAssembler uses
its installed compiler runtime. See getting started.
From a source checkout, try the vector-add example on Modal:
compile examples/vector_add.py --backend modal --out-dir output/first-kernel --verify
run output/first-kernel --spec examples/run_spec.json --backend modal
exitChoose one backend: modal, local, or an SSH destination such as user@host.
Local Linux supports compilation and execution with the required CUDA toolkit,
driver and A100. macOS supports local compilation through Colima; use Modal or
SSH for GPU execution. Type help, help compile, or press Tab for completion.
Type exit or press Ctrl-D to return to your terminal.
If an old Python environment shadows the Homebrew executable, run deactivate
in your terminal, then launch openassembler again. The
getting-started guide covers local Linux, macOS/Colima
and SSH setup, the first kernel and model, and troubleshooting.
Note
For more detailed installation guide and some of the experimental runs, plz visit Getting Started
| Input | Compilation route |
|---|---|
| PTX | OpenAssembler parses admitted PTX and compiles it with the native backend. Best for customized MMA (Matrix Multiplication and Addition) operation |
| Typed Python kernels | Customized Kernel MUST use @kernel at the start. The supported @kernel subset lowers to PTX, then uses the native backend. |
| CUDA C/C++ device sources | nvcc emits PTX; OpenAssembler compiles the admitted PTX. Better for routine ML tasks. |
| Python model repositories | Static discovery or an explicit model contract captures supported CPU PyTorch graphs and generates native kernels. |
| Generated GEMM and rowwise kernels | Dedicated generators compile bounded shape and policy contracts. |
These are bounded compiler contracts. Arbitrary Python programs, unsupported operations, host launch rewriting and architectures beyond SM80 are not supported. Unsupported GPU operations fail explicitly. The production route does not use Triton, Inductor or vendor GPU fallback. See MODELS.md for supported PyTorch operations and KERNELS.md for the kernel-language subsets.
Note
Make sure that all of the customized kernel (python) should start with:
@kernel
If you'd like to adjust (trust me, it is just a simple process and it will not take you long, just follow the instructions) your own arbitary (make sure it is bug free, tho OpenAssembler can also detect the bugs for you) ML repo so that it can be compiled and ran successfully by OpenAssembler, please visit Guide for Engineer.
If you do not want to do the work, you can let your agent do the adjustment work for you, the prompt are in Prompt for Your Agent.
After starting openassembler, use the same repository path across the workflow:
inspect /path/to/repo --json
compile /path/to/repo --backend modal --verify
run /path/to/repo --backend modal
Use cnr to compile and run in one command. The compile step writes a manifest, cubins, and readable SASS listings by default. Model bundles also save their graph plan, weights and launch metadata. Run loads saved artifacts and does not recompile. See the command reference for flags, defaults, outputs and launch specifications.
For Python models, MODELS.md covers discovery, configuration, supported operations, training and the Python API.
PTX, typed Python and CUDA source converge on PTX before OpenAssembler's SM80 backend. PyTorch models are captured on the CPU with torch FX, differentiated, and lowered to OA-generated kernels. NVIDIA tools parse CUDA C/C++ and supply the cubin container; every executed instruction is OpenAssembler's. See ARCHITECTURE.md.
On an A100, compiled PyTorch models train and run inference faster than TorchInductor/Triton in 19 of 20 measured cases (1.3–5.0×; one case is 0.95×). At the single-kernel level, same-source ptxas still produces faster tensor GEMMs. See STATUS.md and the whole-model results.
Start at the documentation home.
| Reference | Use it for |
|---|---|
| Getting started | Install, backends, first kernel and model, troubleshooting |
| Models | PyTorch model compilation, training and runtime |
| Kernels | PTX, CUDA C/C++ and typed Python kernel support |
| Commands | CLI syntax, options and outputs |
| Status | Current results and known gaps |
| Development | Contributor setup, tests and rules |
The compiler and runtime live in openassembler/. Examples are in examples/, regressions in tests/, and experiments with their raw results in exp/ and compiler_exp/.
Licensed under Apache 2.0. See NOTICE for attribution.
