get started

Docs & glossary

Install it, run it, then pick your reading path: the quick tour, the from-zero story, or the source itself.

git clone https://github.com/arpitsinghgautam/nano-triton
cd newt
pip install -e .              # needs torch + an NVIDIA GPU + CUDA toolkit
python -m pytest tests -q     # 176 tests (GPU ones self-skip without CUDA)
python examples/01_vector_add.py

reading mapWhere to read next

layoutSource map

newt/language.py           the nl.* DSL surface (mirrors triton.language)
newt/compiler/types.py     dtypes, pointers, promotion, broadcasting
newt/compiler/codegen.py   AST -> CUDA C++ (the compiler, ~2.5k lines)
newt/runtime/cuda.py       ctypes NVRTC + CUDA driver bindings
newt/runtime/jit.py        @newt.jit, specialization cache, launch
newt/runtime/autotuner.py  @newt.autotune / @newt.heuristics
deuteron/language.py       dt.* surface + eager (PyTorch) implementations
deuteron/codegen.py        tile-DSL AST -> newt kernel source
deuteron/runtime.py        tracing, oracle, autotuner, config cache
tests/                     176 tests, both frameworks, one suite
examples/                  vector add -> softmax -> layernorm -> matmul -> attention
benchmarks/bench.py        newt vs triton-windows vs torch

referenceGlossary

termmeaning
kernela function that runs on the GPU across many parallel workers
thread / warp / block / gridone worker / 32 lockstep workers / a cooperating group with shared memory / all blocks in one launch
SMstreaming multiprocessor: the GPU's core cluster; runs whole thread blocks
DRAM / HBMthe GPU's large, slow main memory
shared memory (smem)small fast per-block scratchpad, organized in 32 banks
coalescingadjacent threads touching adjacent memory, so reads combine into wide transactions
bank conflict / swizzlethreads colliding on one smem bank / the XOR index permutation that prevents it
tensor corededicated matrix-multiply hardware inside each SM
WMMA / mma.sync / ldmatrixNVIDIA's high-level tensor-core API / the raw PTX instruction / the cooperative fragment loader
cp.asyncbackground copy from global to shared memory, bypassing registers
PTX / SASS / cubinportable GPU assembly / real machine code / the compiled binary container
NVRTCNVIDIA's C++ compiler, usable as an in-process library
AST / JIT / constexpr / DSLparsed code structure / compile-on-first-use / compile-time constant / a small embedded language
autotuningautomatically searching configuration knobs, keeping the fastest correct one
memory-bound / compute-boundlimited by bandwidth / by arithmetic throughput (the roofline model)