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.3-cp311-cp311-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.11 Windows x86-64

drjit-0.4.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.11 macOS 11.0+ ARM64

drjit-0.4.3-cp311-cp311-macosx_10_14_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.11 macOS 10.14+ x86-64

drjit-0.4.3-cp310-cp310-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.10 Windows x86-64

drjit-0.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

drjit-0.4.3-cp310-cp310-macosx_10_14_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

drjit-0.4.3-cp39-cp39-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.9 Windows x86-64

drjit-0.4.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.9 macOS 11.0+ ARM64

drjit-0.4.3-cp39-cp39-macosx_10_14_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

drjit-0.4.3-cp38-cp38-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.8 Windows x86-64

drjit-0.4.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.8 macOS 11.0+ ARM64

drjit-0.4.3-cp38-cp38-macosx_10_14_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

File details

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

File metadata

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

File hashes

Hashes for drjit-0.4.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4dc5e1fa38654fb694b881261823317bca3a17fe2f57e4df45e5ff9b5f269afb
MD5 15f7d2db20ddbf94ba9a775575055123
BLAKE2b-256 b967b9649ea31df5268252306ec3aaf838a6fd7d1123f8a0e9c51051c30e006a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 16c629569200d1fbc31d9606eb1de3b31cee2e2cac7f79df33fd521e09fca946
MD5 e18ec0f513384178ecc3b51325e7f58d
BLAKE2b-256 a810499086368c6974e2338e73b884019fb56f7adc264f52f91ae8cf7adb1b7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 80305896f92e9fc9842a8eb6f310f534a9de12ff3b0a2ca04580e5b61c14d758
MD5 66d8ae858a8ffcb206f2bc761c9ccfa6
BLAKE2b-256 d899387fd4efe4acdcc6ee45f2d543ea716f2b28b04a4b6f01b3e35701ed0873

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.3-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 222ad53037a6aea011830b0054f0c10c1ce2b567feea22b9f300e6ad02b511a2
MD5 5c6e743572bd7898e0f727b0a82c3e90
BLAKE2b-256 3f664ef6ad827657984df84249ee87d97ed7783752566b36a432e0b6bb9d8fb6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for drjit-0.4.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 17972208b120c0fd24530771ad3ee4085f4611e82818a96b3084d64aeceae333
MD5 68d136377b682568e60019374140f424
BLAKE2b-256 f42ad8cf179ee57148845d1f2f446d449a5b4f117057a1f5ab65ccc7018de076

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 17b6e283f92a01fc740eef3fd034cc97f47ac8ddca37005818a1308fec79bdb1
MD5 8f57bbdd13b9ce451bf89c0cd47f6f8c
BLAKE2b-256 db8c2c083b24eb1799ca2e85bffdce936ed2b829f2b6607cddc2a7d2e87a1272

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 701a879052e7ab6362b77dae18e89bbe2f9bee67d090072ccb6cb3ea7252d75c
MD5 f81ad8395269a88cf2662e7a27d223b9
BLAKE2b-256 a793eb6c1e657d01a0047b3f48796cc5f5a14b9f888caf486449c2a64d61c710

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.3-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 7e54d806f6bf95e71bac1185fb98aaa5cfa084a54db386fd3ebe19e88fcba574
MD5 ea53cd549e2b8229825af38ea1bbc965
BLAKE2b-256 0adfa6651190869477799b2be171044b2771053ab833af4ea6dd0e2d81124f84

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for drjit-0.4.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 1c5be4ccab5daa472ce4f31f5adc0426012f77985fb4138e147a5ffc1c96af62
MD5 657169f27776bad6da45b6e76d328501
BLAKE2b-256 980f08316b2016a72368ab34cdf3c135be85f9378e500c89157914eac9799096

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d0058e60aa3aadc16f12dcecd4cac967cb20c54153a77499a005efd6e76f30fc
MD5 3fedb15ea7b67278836328bbb720248c
BLAKE2b-256 f1cc2100350ae7501d16fd203c722be0b86efc5e9794dff64d3d18fe440b7b03

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 43fccc324d9f455d2378acfe90e3bc6c4f78444d3dda174a0ec18c54c7237961
MD5 60f1fea372402eb52f73fd14f6aa2138
BLAKE2b-256 1f731d9e474b01ec89c543b44da9c047f3cae9d42eaaba50b2475f77bdf3fb63

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.3-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 d44462d116ceb42e55f4a6d6b554841ba05c8240f93361c092409ae31ce8f3c6
MD5 81d08762d170670dcd5a068135469126
BLAKE2b-256 158e5f5d518bb01b113b72d2c91f93314074196bd63f4bfa92d471ba86869b88

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for drjit-0.4.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e0a2f021830cd455a206b126b143a8c4040cb639b26d9791c815bc233849fae4
MD5 b33a968081847194404138cd1b0b4e23
BLAKE2b-256 6042b623d54320056294a37d1c0fff106bf9556f78bf5d3c4982b38ff22d5f7e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 72c3a66c31f1d5cd234bf28f98d4a59eae2e88b9ab8e381ee320b90111dbf611
MD5 e40ad7ff1ea3e057248d27e05563e8f4
BLAKE2b-256 769a4acacfbd0f2b6ed63a0fd2e4475e10c5891abb752ff5b8c797cd50245914

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.3-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0e7593a18841092a2416900ff84c0bb5cd68eb35ca3bec21885685b6e1acf0ab
MD5 65f9953597e7c269eb578a6e3f5e0ae4
BLAKE2b-256 4c2f558a71243040db8709add0ee4cccd80e5e4c98a72b6df5c9d89fa1bcf687

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.3-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 0d61578490d63ffa686828f51f68b90710ac50502c09117c9f93dfd3e2b4e8d5
MD5 8d604cfaf2717833b7e12c29e91c9341
BLAKE2b-256 f90e696328eb142ac90ce62bf88f6b6833721bd6df17bd0fa8702808d2116176

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