Skip to main content

A Just-In-Time-Compiler for Differentiable Rendering

Project description

About this project

Dr.Jit is a just-in-time (JIT) compiler for ordinary and differentiable computation. It was originally created as the numerical foundation of Mitsuba 3, a differentiable Monte Carlo renderer. However, Dr.Jit is a general-purpose tool that can also help with various other types of embarrassingly parallel computation.

Dr.Jit principally facilitates three steps:

  • Vectorization and tracing: When Dr.Jit encounters an operation (e.g. an addition a + b) it does not execute it right away: instead, it remembers that an addition will be needed at some later point by recording it into a graph representation (this is called tracing). Eventually, it will just-in-time (JIT) compile the recorded operations into a fused kernel using either LLVM (when targeting the CPU) or CUDA (when targeting the GPU). The values a and b will typically be arrays with many elements, and the system parallelizes their evaluation using multi-core parallelism and vector instruction sets like AVX512 or ARM Neon.

    Dr.Jit is ideal for Monte Carlo methods, where the same computation must be repeated for millions of random samples. Dr.Jit dynamically generates specialized parallel code for the target platform. As a fallback, Dr.Jit can also be used without JIT-compilation, which turns the project into a header-only vector library without external dependencies.

  • Differentiation: If desired, Dr.Jit can compute derivatives using automatic differentiation (AD), using either forward or reverse-mode accumulation. Differentiation and tracing go hand-in-hand to produce specialized derivative evaluation code.

  • Python: Dr.Jit types are accessible within C++17 and Python. Code can be developed in either language, or even both at once. Combinations of Python and C++ code can be jointly traced and differentiated.

Dr.Jit handles large programs with custom data structures, side effects, and polymorphism. It includes a mathematical support library including transcendental functions and types like vectors, matrices, complex numbers, quaternions, etc.

Difference to machine learning frameworks

Why did we create Dr.Jit, when dynamic derivative compilation is already possible using Python-based ML frameworks like JAX, Tensorflow, and PyTorch along with backends like XLA and TorchScript?

The reason is related to the typical workloads: machine learning involves small-ish computation graphs that are, however, made of arithmetically intense operations like convolutions, matrix multiplications, etc. The application motivating Dr.Jit (differentiable rendering) creates giant and messy computation graphs consisting of 100K to millions of “trivial” nodes (elementary arithmetic operations). In our experience, ML compilation backends use internal representations and optimization passes that are too rich for this type of input, causing them to crash or time out during compilation. If you have encountered such issues, you may find Dr.Jit useful.

Cloning

Dr.Jit recursively depends on two other repositories: pybind11 for Python bindings, and drjit-core providing core components of the JIT-compiler.

To fetch the entire project including these dependencies, clone the project using the --recursive flag as follows:

$ git clone --recursive https://github.com/mitsuba-renderer/drjit

Documentation

Please see Dr.Jit’s page on readthedocs.io for example code and reference documentation.

References, citations

Please see the paper Dr.Jit: A Just-In-Time Compiler for Differentiable Rendering for the nitty-gritty details and details on the problem motivating this project. There is also a video presentation explaining the design decisions at a higher level.

If you use Dr.Jit in your own research, please cite it using the following BibTeX entry:

@article{Jakob2022DrJit,
  author = {Wenzel Jakob and S{\'e}bastien Speierer and Nicolas Roussel and Delio Vicini},
  title = {Dr.Jit: A Just-In-Time Compiler for Differentiable Rendering},
  journal = {Transactions on Graphics (Proceedings of SIGGRAPH)},
  volume = {41},
  number = {4},
  year = {2022},
  month = jul,
  doi = {10.1145/3528223.3530099}
}

Logo and history

The Dr.Jit logo was generously created by Otto Jakob. The “Dr.” prefix simultaneously abbreviates differentiable rendering with the stylized partial derivative D, while also conveying a medical connotation that is emphasized by the Rod of Asclepius. Differentiable rendering algorithms are growing beyond our control in terms of conceptual and implementation-level complexity. A doctor is a person, who can offer help in such a time of great need. Dr.Jit tries to fill this role to to improve the well-being of differentiable rendering researchers.

Dr.Jit is the successor of the Enoki project, and its high-level API still somewhat resembles that of Enoki. The system evolved towards a different approach and has an all-new implementation, hence the decision to switch to a different project name.

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

drjit-0.4.1-cp311-cp311-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.11 Windows x86-64

drjit-0.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

drjit-0.4.1-cp311-cp311-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

drjit-0.4.1-cp311-cp311-macosx_10_14_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.11 macOS 10.14+ x86-64

drjit-0.4.1-cp310-cp310-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.10 Windows x86-64

drjit-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

drjit-0.4.1-cp310-cp310-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

drjit-0.4.1-cp310-cp310-macosx_10_14_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

drjit-0.4.1-cp39-cp39-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.9 Windows x86-64

drjit-0.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

drjit-0.4.1-cp39-cp39-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

drjit-0.4.1-cp39-cp39-macosx_10_14_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

drjit-0.4.1-cp38-cp38-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.8 Windows x86-64

drjit-0.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

drjit-0.4.1-cp38-cp38-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

drjit-0.4.1-cp38-cp38-macosx_10_14_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

File details

Details for the file drjit-0.4.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: drjit-0.4.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for drjit-0.4.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c9e91bf977fcb07db87e51d4631ff21cbb07dba597984bd9b11dbb4f6dfd64a3
MD5 435d242205f0c0ecc7509e5a9b730929
BLAKE2b-256 ce44e8ab7565369c48a444bdc0eb84eafe0b68da753776cc6bb4078c95dc9e41

See more details on using hashes here.

File details

Details for the file drjit-0.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for drjit-0.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 237b654a0623a8210177a9be1c77ec4feb1f1bbb938c525840b4a324b413000a
MD5 8352829859e8821706141bfa03ba1dbd
BLAKE2b-256 0180b3f488f961e881c482362fe75e4897eac591d8a1acf2ed028184dcd05563

See more details on using hashes here.

File details

Details for the file drjit-0.4.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for drjit-0.4.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4352b11ff27bf5586d3fa8427c1dc258916048c63100cf6e62ea7c15b31e6098
MD5 5c5a55257046ca29ecef47bbe366acf4
BLAKE2b-256 c9fadfddbadc911fe643188733ac38ac5f9ae430d668bf3e4242b39c653483b3

See more details on using hashes here.

File details

Details for the file drjit-0.4.1-cp311-cp311-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for drjit-0.4.1-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 21f200c7351995876329c721ad8211e5e627f2f5f50c455e0179c858e8cb0b98
MD5 354883c5bf068a153f98ae9a00b7c77c
BLAKE2b-256 a4fc440b44bd5ffd7dc9e982d1ca12d431a5d46dec57a1f8c9d06259a9536f8d

See more details on using hashes here.

File details

Details for the file drjit-0.4.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: drjit-0.4.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for drjit-0.4.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2ecd70256298a70c0500461c5f818f014515bf648e384a2d888743eabdb4a827
MD5 724ed45384c5d6f1c6fbdae46a6143d8
BLAKE2b-256 e011f92cb93a08b3c556093a7fede4012f87ecfc18965e6dae4391b450833729

See more details on using hashes here.

File details

Details for the file drjit-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for drjit-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4112524158b1209dab708fb1b62334945f0a8c6a011121d441502a7c5fd973ea
MD5 499e54ad732873eee61e5f209f3679d2
BLAKE2b-256 88d681f880d2b8d8b8f2164675bd2238d187e1c7829bc112d3b54a756f7753f8

See more details on using hashes here.

File details

Details for the file drjit-0.4.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for drjit-0.4.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d8178000ce19b5b07faa2eb4b8f66aacbc801837485894ca334ac6f92f7a777b
MD5 b391a1e9cd290d22f80bfe6813f5c04d
BLAKE2b-256 f0c19face1b1a84db1f2c6fe4960d93ac710566b18439b385dc2fc28fb850362

See more details on using hashes here.

File details

Details for the file drjit-0.4.1-cp310-cp310-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for drjit-0.4.1-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 82029ca23212a31301f48014b64d34e982affb639bbddc76e33e8b0578ad9723
MD5 0678a35be5ac86b31f2582c7445394ea
BLAKE2b-256 c38cc12f1508285aa925e3a8dda57fc31f44ceb14f90b451ee3a08fc8ee4ed00

See more details on using hashes here.

File details

Details for the file drjit-0.4.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: drjit-0.4.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for drjit-0.4.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 48cf03303151d925b3cce4266c9c577a26a0d95146311a802d4daec2d248942d
MD5 5f39f8364fa5536e099b96a6cb819336
BLAKE2b-256 33ec62276eedf4e21b2d2dfc9230807d934ff6383f9184d15a9a1cc11488fde2

See more details on using hashes here.

File details

Details for the file drjit-0.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for drjit-0.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aaa6a8418b7cd96f12ffdfd6b742e6019409c3944217c2e7c37764cd4a5927f6
MD5 cc995b30f19191f4d7a28453e410e5e5
BLAKE2b-256 674f06464aa8883c0235656f9547e3b4521a19d4eb05acd4fbe69dad9cc2320d

See more details on using hashes here.

File details

Details for the file drjit-0.4.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for drjit-0.4.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c5c336ebe5cb82ed8f4a8695db9b8f7acd283899ed9f30cb2d201ee6fa7bff86
MD5 c59460643018aaacb92a9cf91c224c6c
BLAKE2b-256 ae2f7ddeeb104b0ea5d6f04b48dfc018ded5003a403b25462e2c5f6002313aa0

See more details on using hashes here.

File details

Details for the file drjit-0.4.1-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for drjit-0.4.1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 11b4772c0c4ab1f66f2cd2290ef3747354e7e3929ff6f0d735a31f230d3d78ba
MD5 64b4fcbfe3e5f59b5677f62792867ec8
BLAKE2b-256 4b3494282dc222c4b775ad3b3be370d5face968ab9447e07ae000ab23e058e9a

See more details on using hashes here.

File details

Details for the file drjit-0.4.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: drjit-0.4.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for drjit-0.4.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c75058353d3293d52aa6a688634471cb5dd164e0e5c8f6beb823e4c33c7d076b
MD5 d4dccd13b21ab014c79552e0d1ff0a0a
BLAKE2b-256 47bdcbd673c835e2d57617a947f1de36159b6e2b051b75a5580e7ac8fd8fa08a

See more details on using hashes here.

File details

Details for the file drjit-0.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for drjit-0.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 281409fd80bac63a3783199d59c34a240722177001e70ccae7fa1db1f2e05a02
MD5 4edb762a6e5aaf1895d47bf76b182dea
BLAKE2b-256 803d729c70e8f576ae0ae884c90847076488962512279af9ded06274b4315dd2

See more details on using hashes here.

File details

Details for the file drjit-0.4.1-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for drjit-0.4.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9d62a2307b842132bd97a33f4bd8348977d695f55a4b5e174e05b802cc2d9cd6
MD5 a952ba1beeb5ca4bf540abb70c7c7768
BLAKE2b-256 f85bec77fcc44920209d42d61fc5c849e13329ae2dcf367dabdf3dd2c46f5e07

See more details on using hashes here.

File details

Details for the file drjit-0.4.1-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for drjit-0.4.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 6294e71429e6779d7fffbf8bd54a0dd6abe0912bb31a4f26d838b4ae37bfa769
MD5 d8ee9d3c9e3779a9d0a00eb7211e056c
BLAKE2b-256 dbe5b0cd0015bb04a441eb61710b12318cf0f02ef9025bb548c9992a49c20206

See more details on using hashes here.

Supported by

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