drjit
Dr.Jit: A Just-In-Time Compiler for Differentiable Rendering
What it is and what it does
Dr.Jit is a specialized just-in-time compiler designed to handle large, sparse computation graphs typical of differentiable rendering and similar embarrassingly parallel workloads. Unlike general machine learning frameworks, it records arithmetic operations into a computation graph, then JIT-compiles that graph into fused kernels targeting GPUs (Metal on macOS, CUDA elsewhere) or CPUs with vector instruction sets (AVX512, NEON) via LLVM. It optionally computes derivatives using forward or reverse-mode automatic differentiation, with both tracing and differentiation producing specialized code.
The package originated as the numerical foundation of Mitsuba 3, a differentiable Monte Carlo renderer, but is general-purpose and can be used without JIT compilation as a header-only vector library. It supports both C++17 and Python, allowing code to be developed in either language or both simultaneously, with joint tracing and differentiation across language boundaries. Dr.Jit includes a mathematical library with transcendental functions and types like vectors, matrices, complex numbers, and quaternions, and handles custom data structures, side effects, and polymorphism.
Use it for:
- Differentiable rendering pipelines where computation graphs contain millions of elementary operations that would overwhelm ML framework compilers.
- Physics simulations requiring automatic differentiation and GPU acceleration without the overhead of general-purpose ML frameworks.
- Embarrassingly parallel numerical computations that benefit from vectorization and JIT compilation to specialized kernels.
- Research combining Python prototyping with C++ performance-critical code, jointly traced and differentiated.
- Monte Carlo methods and inverse problems where reverse-mode AD is essential for gradient computation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Dr.Jit is a just-in-time compiler for differentiable and ordinary computation that traces arithmetic operations into computation graphs, JIT-compiles them to GPU or CPU kernels, and optionally computes derivatives via automatic differentiation.
Yes, if you are working on differentiable rendering, physics simulation, or large sparse computation graphs where ML frameworks struggle. The active maintenance, permissive license, and lack of known vulnerabilities support adoption. Medium install friction is acceptable given the specialized use case and broad platform coverage. Not recommended for general machine learning; use JAX, PyTorch, or TensorFlow instead.
Install
drjit on PyPI
pip
pip install drjituv
uv add drjitpoetry
poetry add drjitInstalling drjit
Before you install
Medium install friction due to compiled wheels for multiple Python versions and architectures (cp310–cp313, arm64/x86_64/Windows). Active maintenance with a release 7 days old and recent commits; no known vulnerabilities.
License in practice
Permissive BSD license allows commercial and private use with minimal restrictions, making it suitable for research and production deployments.
Quickstart
pip install drjit
import drjit as dr
# Create and trace a computation
x = dr.arange(dr.Float, 10)
y = x + 1
Requires Python >=3.8; GPU support (Metal on macOS, CUDA elsewhere) is optional but recommended for performance.
Verify before relying
- Specific performance characteristics compared to JAX, TensorFlow, or PyTorch for large sparse computation graphs.
- Whether the package is actively maintained beyond the Mitsuba 3 renderer project.
- Availability and quality of documentation beyond readthedocs.io.
- Practical limits on computation graph size and complexity.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — typing_extensions |
| Maintenance | actively maintained — 7 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 207,914/month — #9,539 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: drjit-1.5.0-cp310-cp310-macosx_11_0_arm64.whl; drjit-1.5.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; drjit-1.5.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; drjit-1.5.0-cp310-cp310-win_amd64.whl; drjit-1.5.0-cp311-cp311-macosx_11_0_arm64.whl; drjit-1.5.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; drjit-1.5.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; drjit-1.5.0-cp311-cp311-win_amd64.whl; drjit-1.5.0-cp312-abi3-macosx_11_0_arm64.whl; drjit-1.5.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; drjit-1.5.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; drjit-1.5.0-cp312-abi3-win_amd64.whl; drjit-1.5.0-cp312-cp312-macosx_11_0_arm64.whl; drjit-1.5.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; drjit-1.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; drjit-1.5.0-cp312-cp312-win_amd64.whl; drjit-1.5.0-cp313-cp313-macosx_11_0_arm64.whl; drjit-1.5.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; drjit-1.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; drjit-1.5.0-cp313-cp313-win_amd64.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
numbaNumba is a just-in-time compiler that…
permissive · top 1,000 on PyPI
nvidia-nvjitlink-cu12Provides NVIDIA's JIT LTO compiler library for…
unclear · top 1,000 on PyPI
nvidia-nvjitlinkProvides NVIDIA's JIT LTO compiler library for…
unclear · top 1,000 on PyPI
jaxJAX is a Python library for automatic…
permissive · top 1,000 on PyPI
jax-cuda12-pjrtProvides NVIDIA GPU acceleration for JAX…
permissive · top 15,000 on PyPI
jax-cuda13-pjrtProvides NVIDIA GPU acceleration for JAX…
permissive · top 15,000 on PyPI
nvidia-cuda-nvrtc-cu11Provides NVIDIA CUDA NVRTC (runtime…
unclear · top 5,000 on PyPI
numdifftoolsComputes numerical derivatives, gradients,…
permissive · top 15,000 on PyPI
torch-c-dlpack-extProvides an ahead-of-time compiled module for…
permissive · top 5,000 on PyPI
pystonPyston is a performance-optimizing JIT compiler…
unclear · top 15,000 on PyPI