Skip to main content

The Quadrants Programming Language

Project description

What is Quadrants?

Quadrants is a high-performance multi-platform compiler for physics simulation being continuously developed by Genesis AI.

It is designed for large-scale physics simulation and robotics workloads. It compiles Python code into highly optimized parallel kernels that run on:

  • NVIDIA GPUs (CUDA)
  • Vulkan-compatible GPUs (SPIR-V)
  • Apple Metal GPUs
  • AMD GPUs (ROCm HIP)
  • x86 and ARM64 CPUs

The origin

The quadrants project was originally forked from Taichi in June 2025. As the original Taichi is no longer being maintained and the codebase evolved into a fully independent compiler with its own direction and long-term roadmap, we decided to give it a name that reflects both its roots and its new identity. The name Quadrants is inspired by the Chinese saying:

太极生两仪,两仪生四象

The Supreme Polarity (Taichi) gives rise to the Two Modes (Yin & Yang), which in turn give rise to the Four Forms (Quadrants).

Quadrants captures the idea of progression originated from taichi — built on the same foundation, evolving in its own direction while acknowledging its roots. This project is now fully independent and does not aim to maintain backward compatibility with upstream Taichi.

How Quadrants differs from upstream Taichi

While the repository still resembles upstream in structure, major changes include:

Platform support

  • LLVM 22, ARM (aarch64) support

CI

  • Kernel-level code coverage — device-side branch coverage in standard coverage.py format, integrated with pytest-cov
  • AI-driven checks for line wrapping, deleted comments, test coverage, and feature factorization

Structural improvements

  • dataclasses.dataclass structs — work with ndarrays and fields, nestable, passable to qd.func, zero kernel-runtime overhead
  • qd.Tensor — unified API over fields and ndarrays with per-tensor layout control, pickle support, and a backend= switch
  • BufferView — safe sub-range ndarray access with bounds checking in debug mode

Removed components

To focus the compiler and reduce maintenance burden, we removed: GUI/GGUI, C-API, AOT, DX11/DX12, iOS/Android, OpenGL/GLES, argpack, CLI.

Performance

  • Reduced launch latency — ndarray CPU performance improved 4.5×; ndarray GPU performance went from 11× slower than fields to ~30% slower (5090 GPU, Genesis benchmark)
  • Fastcache — opt-in source-level cache (@qd.kernel(fastcache=True)) that bypasses front-end AST parsing; reduces warm-cache kernel load from 7.2 s → 0.3 s on Genesis benchmarks
  • GPU Graphs@qd.kernel(graph=True) captures kernel sequences into a graph; qd.graph_do_while runs GPU-side iteration loops (hardware conditional nodes on CUDA SM 9.0+)
  • perf_dispatch — auto-benchmarks multiple kernel implementations and selects the fastest at runtime
  • Zero-copy interopto_torch(copy=False) / to_numpy(copy=False) via DLPack on CUDA, CPU, AMDGPU, and Metal; direct torch tensor pass-through into kernels

SIMT primitives

  • Tile16x16 / Tile32x32 — register-resident 16×16 and 32×32 matrix tiles with Cholesky, triangular solve, and rank-1 updates; 5× faster than shared-memory baselines on blocked linear algebra
  • Subgroup ops — cross-platform shuffle, shuffle_down, reduce_add, reduce_all_add across CUDA, AMDGPU, Metal and Vulkan

Autodiff

  • Autodiff with dynamic loops — computes the gradient of any kernel transparently using reverse-mode differentiation and runtime-based memory allocation
  • Forward-mode AD, custom gradients (@qd.ad.grad_replaced), qd.ad.Tape

Debugging & development

  • Python backendqd.init(qd.python) interprets kernels as plain Python so they can be stepped through in a standard Python debugger

Installation

Prerequisites

  • Python 3.10-3.13
  • Mac OS 14, 15, Windows, or Ubuntu 22.04-24.04 or compatible
  • ROCm 5.2 or newer for AMD GPU support

Procedure

pip install quadrants

(For how to build from source, see our CI build scripts, e.g. linux build scripts )

Documentation

Something is broken!

Acknowledgements

Quadrants stands on the shoulders of the original Taichi project, built with care and vision by many contributors over the years. For the full list of contributors and credits, see the original Taichi repository.

We are grateful for that foundation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

quadrants-1.0.3b1-cp313-cp313-win_amd64.whl (55.7 MB view details)

Uploaded CPython 3.13Windows x86-64

quadrants-1.0.3b1-cp312-cp312-win_amd64.whl (55.7 MB view details)

Uploaded CPython 3.12Windows x86-64

quadrants-1.0.3b1-cp311-cp311-win_amd64.whl (55.7 MB view details)

Uploaded CPython 3.11Windows x86-64

quadrants-1.0.3b1-cp310-cp310-win_amd64.whl (55.7 MB view details)

Uploaded CPython 3.10Windows x86-64

File details

Details for the file quadrants-1.0.3b1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for quadrants-1.0.3b1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 dee56c785f82b6295b47cba91b340b46433e67c4b17429a2f420a2159f5382c5
MD5 7995637561057eb37bda07886e359f15
BLAKE2b-256 6474495921186e8f703ffdff67da106e67318909ae6a96400523ef1b1a92bdfc

See more details on using hashes here.

File details

Details for the file quadrants-1.0.3b1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for quadrants-1.0.3b1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8adc8cbfe0e08f6ee44c7ef96b2ecce05fe45edcb30b3c6a7621dc3aeee4175d
MD5 0fea27efcb420a63e51fd999befc5a69
BLAKE2b-256 e1f822887be0b6b378d4ae017d63f88388c78501addb0c1a7e4d57947908c958

See more details on using hashes here.

File details

Details for the file quadrants-1.0.3b1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for quadrants-1.0.3b1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d329f7575e10e62c9bfe946289b0b4fe58acea0a7b8d5d03c82ccde61e729875
MD5 0448fd33b41d42f53d6d36d695ab06e5
BLAKE2b-256 a90d69cab25f4f3ef8a1be0f0e86c390fad506de527f3d8259749eb2fe8f494e

See more details on using hashes here.

File details

Details for the file quadrants-1.0.3b1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for quadrants-1.0.3b1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2b34119b581667c1a2d293a1b4ad464a7932333bec063adf6d0d960a34f900ff
MD5 689a64e8b4918be77e0f5aa8bf21eab6
BLAKE2b-256 0d440e1ae163eda7de056becaf37562706b8a443c821ba04ed3f9e7ac4bb606c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page