taichi-dev /taichi
Productive, portable, and performant GPU programming in Python.
★ 28,461⑂ 2,391👁 384⑃ 5,915● 2,762▤ 118
+0
Daily
+7
Weekly
+47
Monthly
28,461
stars
2,391
forks
384
watchers
5,915
prs
2,762
issues
118
releases
README
---
shell
pip install taichi Install Taichi Lang
ti gallery Launch demo gallery
What is Taichi Lang?
Taichi Lang is an open-source, imperative, parallel programming language for high-performance numerical computation. It is embedded in Python and uses just-in-time (JIT) compiler frameworks, for example LLVM, to offload the compute-intensive Python code to the native GPU or CPU instructions.
The language has broad applications spanning real-time physical simulation, numerical computation, augmented reality, artificial intelligence, vision and robotics, visual effects in films and games, general-purpose computing, and much more.
...More
Why Taichi Lang?
- Built around Python: Taichi Lang shares almost the same syntax with Python, allowing you to write algorithms with minimal language barrier. It is also well integrated into the Python ecosystem, including NumPy and PyTorch.
- Flexibility: Taichi Lang provides a set of generic data containers known as SNode (/ˈsnoʊd/), an effective mechanism for composing hierarchical, multi-dimensional fields. This can cover many use patterns in numerical simulation (e.g. spatially sparse computing).
- Performance: With the @ti.kernel decorator, Taichi Lang's JIT compiler automatically compiles your Python functions into efficient GPU or CPU machine code for parallel execution.
- Portability: Write your code once and run it everywhere. Currently, Taichi Lang supports most mainstream GPU APIs, such as CUDA and Vulkan.
- ... and many more features! A cross-platform, Vulkan-based 3D visualizer, differentiable programming, quantized computation (experimental), etc.
Getting Started
Installation
Prerequisites
- Operating systems
- Windows
- Linux
- macOS
- Python: 3.6 ~ 3.10 (64-bit only)
- Compute backends
- x64/ARM CPUs
- CUDA
- Vulkan
- OpenGL (4.3+)
- Apple Metal
- WebAssembly (experiemental)
Use Python's package installer pip to install Taichi Lang:
bash
pip install --upgrade taichi
We also provide a nightly package. Note that nightly packages may crash because they are not fully tested. We cannot guarantee their validity, and you are at your own risk trying out our latest, untested features. The nightly packages can be installed from our self-hosted PyPI (Using self-hosted PyPI allows us to provide more frequent releases over a longer period of time)
bash
pip install -i https://pypi.taichi.graphics/simple/ taichi-nightly
Run your "Hello, world!"
Here is how you can program a 2D fractal in Taichi:
py
python/taichi/examples/simulation/fractal.py
import taichi as ti
ti.init(arch=ti.gpu)
n = 320
pixels = ti.field(dtype=float, shape=(n 2, n))
@ti.func
def complex_sqr(z):
return ti.Vector([z[0]2 - z[1]2, z[1] z[0] 2])
@ti.kernel
def paint(t: float):
for i, j in pixels: Parallelized over all pixels
c = ti.Vector([-0.8, ti.cos(t) 0.2])
z = ti.Vector([i / n - 1, j / n - 0.5]) 2
iterations = 0
Top issues
#4857Polish and officially release quantized types42 comments · 2022-04-26#412AMDGPU backend35 comments · 2020-01-30#6434Add support for AMDGPU31 comments · 2022-10-26#1483IDLE still doesn't work for me31 comments · 2020-07-13#711[OpenGL] Sparse data structure support26 comments · 2020-04-05#4631[RFC] [SIMT] Add CUDA warp-level intrinsics to Taichi25 comments · 2022-03-25#5436Using Taichi from Julia22 comments · 2022-07-16#3781[RFC] Taichi on Javascript22 comments · 2021-12-12
Discussions
#8798Squarenet gridification as a bridge between unstructured point clouds and Taichi stencil kernel0 comments · 2026-07-20#8782LPBF Melt Pool Simulation0 comments · 2026-01-29#8776Struct function get_ch_S0_to_S15 not found.1 comments · 2025-12-05#8771I have a data_oriented class, when I profile my test, I found one kernel function in this class is compiled hundreds of time, why is that?0 comments · 2025-11-04#8766Is SNode layout mutable at compile/runtime? Any ongoing work on automatic SNode layout optimization?0 comments · 2025-10-25#8679Redeem my cpu & Apple Cash contributions0 comments · 2025-04-21#8665Are dynamic fields as a struct member supported?1 comments · 2025-03-23#8642Multiple Layers of For-Loops1 comments · 2025-02-24
Latest release
v1.7.4 v1.7.4 2025-07-31Warning: tag sparse matrix undefined in the "details" dict. Please include the tag into "details", unless the tag is a typo.
Highlights:
- Build system
- Revert "Drop OpenGL build (8751)" (8753) (by Proton)
- Drop OpenGL build (8751) (by Proton)
- Use brew clang compiler on mac (8704) (by Hugh Perkins)
- Update VMA and Vulkan-Headers to support Vulkan 1.3 (8680) (by Antonio Ferreras)
- Examples
- Factorize cpp examples into separate executables (8709) (by Hugh Perkins)
- GUI
- Support ndarray input (8661) (by 白定)
- IR optimization passes
-