Repository navigation
▐██████ ▐██████ ▐██████ ▐██████ ▐██████ ▐██████ ▐██████ ▐██████ ▐██ ▐██ ▐█████▄ ▐██ ▐██████ ▐██████ ▐██████ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐███▐███ ▐██ ▐█ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██████ ▐████ ▐██ ▐██ ▐██████ ▐██████ ▐██████ ▐████ ▐██▐█▐██ ▐██████ ▐██ ▐████ ▐██████ ▐██ ▐██ ▐██████ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐██ ▐█ ▐██ ▐██ ▐██▐██ ▐██ ▐██ ▐██ ▐██████ ▐██ ▐██████ ▐██ ▐██ ▐██ ▐██ ▐██████ ▐██████ ▐██████ ▐██ ▐██ ▐█████▀ ▐█████ ▐██████ ▐██ ▐██ ▐██████ ▐██ ▐██
Released: 2026-12-03
License: Apache 2.0
Target: NVIDIA A100 (SM80)
Python: 3.12+ (Linux and macOS)
OpenAssembler is a native SM80 compiler that turns supported PTX, typed Python @kernels, and CUDA C/C++ into OA-owned SASS and cubins — without Triton, Inductor, ptxas code generation, or cuBLAS fallback in the production route.
Installation
Homebrew (recommended):
brew tap lucialuka/openassembler https://github.com/lucialuka/OpenAssembler
brew install lucialuka/openassembler/openassembler
openassembler --versionUpdate OpenAssembler:
Starting form this version, updating openassembler is abled. You MUST install the newest version before you tap update the first time (as older version do not support openassembler update. Once the OpenAssembler version v0.4.0 is installed, you can just tap update for any further version.
openassembler update --check # is a newer version available?
openassembler update # install itPerformances and Key Changes
Performances Against Inductor
OpenAssembler now beats Inductor/Triton on 19 of 20 comparisons on one A100 (train and inference for the 10 supported corpus cases). At the start it ran at 0.07–0.86× of Inductor. The full local test suite passes (5,164 tests), and graph replay matched direct launches bit-for-bit in an 8-step A100 check. Nothing is committed yet; everything is on branch claude/openassembler-analysis-optimization-c629ab.
A100 results (Inductor time ÷ OA time, so above 1 means OA is faster):
| Case | Train (small / standard) | Inference (small / standard) |
|---|---|---|
| residual_regression | 4.99 / 3.48 | 3.57 / 2.14 |
| cnn_energy | 4.10 / 2.44 | 4.52 / 3.22 |
| gated_forecaster | 4.55 / 4.33 | 3.13 / 2.84 |
| causal_decoder | 2.76 / 1.32 | 3.10 / 0.95 |
| geometric_attention | 3.79 / 2.81 | 3.40 / 2.21 |
Key Changes
Performance:
- One general matrix-multiply kernel and an implicit-GEMM convolution now replace the old fast kernels that only applied to individually measured shapes.
- Fixed a register-allocator bug that had pushed the large matrix kernel to 192 registers; it now uses 128.
- Repeated launch sequences replay as CUDA graphs, and an unchanged forward pass replays its graph directly. This cut Python launch overhead per forward pass from 155 µs to 52 µs.
- Embedding indices and cross-entropy labels are now checked on the GPU instead of forcing a CPU sync on every call. A bad value turns its result rows to NaN, and the error is raised at the next runtime call.
Over-defensive limits removed:
- Any Linear, batched matmul, permute, concat or LayerNorm with more than 65,535 rows was rejected. These now accept any row count.
- Softmax, LayerNorm and attention now accept rows wider than 1,024.
- The per-tensor limit went from 16M to 2^28 elements.
- Dispatch tables no longer disable themselves after a compiler change.
- CUDA-graph training now accepts token-index inputs and cross-entropy.
New operator coverage:
tanh, exp, log, abs, pow, clamp, LeakyReLU, Softplus, the default nn.GELU(), Hardtanh/ReLU6/Hardswish/Hardsigmoid, max/average/global pooling, BatchNorm and Dropout in eval mode, and unsqueeze/squeeze/expand.
Each has a forward kernel, a gradient and a reference implementation, and is checked against PyTorch. A smoke test also trained three models using these ops on the A100 and matched the reference.
Notable limitations (SM80 only)
This is an A100/SM80-targeted bounded compiler. The following are not supported in this release:
- Architectures beyond SM80 (each needs its own encoding and hardware evidence)
- f16/f64 scalar arithmetic in Python kernels; classes, runtime containers, recursion, arbitrary library calls
- General CUDA-emitted PTX: aggregate parameters, partial-warp collectives, all memory-ordering/atomic widths, a real call ABI, cross-module device linking
- Training-mode BatchNorm, dropout with
p > 0, grouped/depthwise convolution, comparisons/masked_fill/where, learning-rate schedules, parameter groups, distributed/multi-GPU training - Whole-model fusion or cross-kernel cost models; each operation is its own kernel
- Vendor GPU fallback is disabled — unsupported forms fail with a source-location diagnostic
Performance: same-source ptxas remains faster than OpenAssembler on all 42 measured GEMM contracts. The gap is extra address/control instructions and weaker overlap, not tensor work. Tuned policies improve OpenAssembler's own reference by 1.03–2.46× on measured shapes.
Try it
# From a source checkout
compile examples/vector_add.py --backend local --out-dir output/first-kernel --verify
run output/first-kernel --spec examples/run_spec.json --backend modal
# Native model
cnr examples/native_model --frontend model --verify --backend modal
run examples/native_model --backend modal --verify-application
# Tuned GEMM
gemm --m 1024 --n 4096 --k 1024 --dtype f16 --autotune modal --out-dir output/gemmFull command reference: docs/COMMANDS.md. Kernel input contracts: docs/KERNELS.md. Model configuration: docs/MODELS.md. Current status and gaps: docs/STATUS.md.
OpenAssembler reverse-engineers NVIDIA's SASS encoding and ptxas behavior by black-box observation only (compiling probe kernels, diffing nvdisasm/cuobjdump output, bit-flip fuzzing, and comparing against real GPU execution). No NVIDIA source code, headers, or binaries are included or redistributed.