Quadrants#
Quadrants is a high-performance parallel programming framework for GPU and CPU computing. Write Python-like code that compiles to optimized GPU kernels for CUDA, Metal, and Vulkan backends.
import quadrants as qd
qd.init(arch=qd.gpu)
@qd.kernel
def hello(a: qd.types.NDArray[qd.i32, 1]) -> None:
for i in range(10):
a[i] = i * 2
a = qd.ndarray(qd.i32, (10,))
hello(a)
Features#
Simple: annotate Python functions with
@qd.kernelto run on GPUFast: automatic parallelization of top-level for loops across GPU threads
Portable: supports CUDA, Metal, AMD, and Vulkan backends
Flexible: ndarrays, fields, structs, atomics, shared memory
Quadrants
- User guide
- Getting started
- Supported systems
- Tensor types
- Scalar tensors
- Matrix and Vector
- Per-thread matrix and vector operations
- Per-thread linear algebra
- Tensors
- Compound types
- BufferView
- qd.static
- Sub-functions
- Parallelization
- Numpy and Torch interop
- Shared Metal command queue (PyTorch MPS)
- Automatic differentiation
- Atomics
- Block primitives
- Grid primitives
- Math
- Subgroup primitives
- Tile16x16: register-resident 16x16 tiles
- Algorithms
- Fastcache
- Graph
- Streams
- Performance Dispatch
- qd.init options
- Kernel code coverage
- Python features in kernel scope
- Python backend
- Debug mode
- Quirks
- Troubleshooting
- Contributing to quadrants
- Building the CUDA graph conditional fatbin
- API Reference