• Stars
    star
    25,488
  • Rank 823 (Top 0.02 %)
  • Language
    C++
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Productive, portable, and performant GPU programming in Python.

Latest Release downloads CI Nightly Release discord invitation link

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:

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)

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:

# 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
        while z.norm() < 20 and iterations < 50:
            z = complex_sqr(z) + c
            iterations += 1
        pixels[i, j] = 1 - iterations * 0.02


gui = ti.GUI("Julia Set", res=(n * 2, n))

for i in range(1000000):
    paint(i * 0.03)
    gui.set_image(pixels)
    gui.show()

If Taichi Lang is properly installed, you should get the animation below 🎉:

See Get started for more information.

Build from source

If you wish to try our our experimental features or build Taichi Lang for your own environments, see Developer installation.

Documentation

Community activity Time period

Timeline graph Issue status graph Pull request status graph Trending topics

Contributing

Kudos to all of our amazing contributors! Taichi Lang thrives through open-source. In that spirit, we welcome all kinds of contributions from the community. If you would like to participate, check out the Contribution Guidelines first.

Contributor avatars are randomly shuffled.

License

Taichi Lang is distributed under the terms of Apache License (Version 2.0).

See Apache License for details.

Community

For more information about the events or community, please refer to this page

Join our discussions

Report an issue

Contact us

Reference

Demos

AOT deployment

Lectures & talks

Citations

If you use Taichi Lang in your research, please cite the corresponding papers:

More Repositories

1

difftaichi

10 differentiable physical simulators built with Taichi differentiable programming (DiffTaichi, ICLR 2020)
2,449
star
2

taichi-nerfs

Implementations of NeRF variants based on Taichi + PyTorch
Python
726
star
3

games201

Advanced Physics Engines 2020: A Hands-on Tutorial
Python
490
star
4

taichi_elements

High-performance multi-material continuum physics engine in Taichi
Python
486
star
5

awesome-taichi

A curated list of awesome Taichi applications, courses, demos and features.
322
star
6

taichi_three

A soft renderer based on Taichi (work in progress)
Python
223
star
7

voxel-challenge

Python
216
star
8

meshtaichi

MeshTaichi: A Compiler for Efficient Mesh-based Operations (SIGGRAPH Asia 2022)
Python
211
star
9

taichi_blend

Taichi Blender intergration for physics simulation and animation
Python
156
star
10

quantaichi

QuanTaichi evaluation suite
Python
134
star
11

taichi-docs-zh-cn

Taichi中文文档
126
star
12

taichi_houdini

Python
101
star
13

faster-python-with-taichi

Python
76
star
14

taichicon

TaichiCon: Taichi Conferences
71
star
15

taichi_glsl

A Taichi extension library providing a set of GLSL-alike helper functions
Python
70
star
16

taichi-aot-demo

A demo illustrating how to use Taichi as an AOT shader compiler
C++
70
star
17

taichi.js

Run compiled Taichi kernels in JavaScript and WASM
Python
62
star
18

Taichi-UnityExample

C#
54
star
19

image-processing-with-taichi

Python
52
star
20

soft2d-release

Soft2D: A 2D multi-material continuum physics engine designed for real-time applications.
C++
48
star
21

cpp-training-season1

C++ training, season 1
C++
45
star
22

taichi_benchmark

Python
25
star
23

cheatsheet

TeX
24
star
24

taichi_dem

A minimal DEM simulation demo written in Taichi.
Python
24
star
25

docs.taichi.graphics

Home of the Taichi documentation site.
HTML
23
star
26

taichi-unity2

C++
21
star
27

cloth-simulation-homework

Python
16
star
28

community

14
star
29

poisson-sampling-homework

Python
10
star
30

advanced_examples

More advanced Taichi examples
Python
10
star
31

soft2d-for-unity

Soft2D-for-Unity
C#
10
star
32

sourceinspect

A unified inspector for retriving source from Python objects
Python
8
star
33

mls_mpm_88_extensions

Python
6
star
34

test_actions

C++
5
star
35

taichi_elements_blender_examples

5
star
36

public_files

5
star
37

dummy-rdp-client

Keep a live session by RDP, so OpenGL can function.
Rust
4
star
38

docstring-gen

Workflow for generating the docstring website
Python
4
star
39

mpm_3d_exercise

Python
4
star
40

stock_trading_strategy

Optimal stock trading strategy using Taichi
Python
3
star
41

taitopia-status-page

Taitopia status page
Markdown
3
star
42

taichi_assets

Taichi binary assets (submodule of the main Taichi repository)
3
star
43

taichi-release-tests

Python
2
star
44

blogs

Python
2
star
45

voxel-rt2

Voxel Ray Tracer v2 (supersedes https://github.com/taichi-dev/voxel_editor)
Python
2
star
46

taichi-zoo-issue-tracker

This repository is used for collecting user feedback from the community
1
star
47

hackathons

Taichi ❤️ Hackathons
1
star
48

taichi_glad_ready

Ready to use GLAD as a OpenGL API loader
C
1
star