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

Uploaded CPython 3.11 Windows x86-64

drjit-0.4.0-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.0-cp311-cp311-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

drjit-0.4.0-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.0-cp310-cp310-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.10 Windows x86-64

drjit-0.4.0-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.0-cp310-cp310-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

drjit-0.4.0-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.0-cp39-cp39-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.9 Windows x86-64

drjit-0.4.0-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.0-cp39-cp39-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

drjit-0.4.0-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.0-cp38-cp38-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.8 Windows x86-64

drjit-0.4.0-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.0-cp38-cp38-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

drjit-0.4.0-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.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: drjit-0.4.0-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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bccac516c9b1ca80327afedb33907f2cf0b3fdd7400d8ed72e7bf0617da62949
MD5 d7d3b4ed4780e4b91c9cc019d25d62f8
BLAKE2b-256 3a4990f46cf2b2eedeae14e0c57f89f58b8f9a70707b544518644bb8b04333c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 57592cfa12113288d68a400c4f997fb8ab175ef384986aef4f7c62523c089e71
MD5 b7781e267983d6ff80b4d1a185ff7661
BLAKE2b-256 64137d5eebf3d40473ea019a486e9e6ae2479901241d93a7b4fc99a3e9db1430

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 66203ca1d6f58d83c45c03dcf89b12d05492acd9b3660cb4b83c369390f8b7f1
MD5 8188c9584a36934622d15da5ec8c1254
BLAKE2b-256 cd12fbcffc7103fa53cfada37db6dd98a35280bc947236e9a3c079525c9d2874

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.0-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 f750e12c9c051af20beb5fc2ebb086ef4f9a72302042acbd9029db614370c8cb
MD5 18e9c47ba5aa67bc6bcd805cd39aaa62
BLAKE2b-256 c19ecd64c63fa859861f04b679d6f197133e29bcba4c3042776a84cd0f403faa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.4.0-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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e0a5551e50fbcefe36af80cc2fac76ee5f83d988d60d9588e81701d054c9bd61
MD5 8091fef151c893579d8d7c4aff3eac09
BLAKE2b-256 265cfd2ebeb73da162b127e91572006692422c0d249b3826191fa16806c8f060

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 33323f298067de6db1f17975356e2e37548f8f119631f2d458597f6bb7475e17
MD5 88488e737a2d6573e02af59fba3f31a8
BLAKE2b-256 030e72fca703e00313908c81ca5fc6acc222050b88c5aaf43c5215ad7e40b2d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3bd29cf1a7ab8f947d1fef639f183739445ef88a6cffd7ea869c486841dda4d3
MD5 f659d757338b2b5487c60299eeaf6ebe
BLAKE2b-256 64a2b95a6cabf25151d7fa78b9c0f57b14db51ffdffd983f3bb9a0bf49ca1caa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 9eb121fab3a98c22f41c08091afa7341c7357991df18ad293903e24dbcbf03de
MD5 f67f1d971a25c8e9d523d775437fcbaf
BLAKE2b-256 23c2106ae0b6c7c295d692757696693e977921cb19873287542430f59e5acfe5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.4.0-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.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 be5076658159564d33266fb9a86f4295c5b499716c6d67d6998e4ef42cf5eb49
MD5 27705934543f49b8390a869cfc63472e
BLAKE2b-256 4f84e06e035605d5d9e03be53947e3947b22577ce41e37cdf532939930b26165

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d9d916f48c5b53e288223ff7c78584185dd89293b16c70ee7b3ae1a3e14a759d
MD5 a5ffc7ace6689609d426ed15e52f1423
BLAKE2b-256 abc866f814f6e2ce292f645af690f909b83f3cadf9af2c9cf151a4a821924b19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4589d1b8e4334170be0c7b2c25d8089b7f090d7e4ff94956fbd82ebb0c6acf7f
MD5 534445354a1016e125aed3e92d407a2c
BLAKE2b-256 1e3083e6374d3634f9ac7ffafa3942a278e1dae0bdba81f96b50faae4a2607f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 7eed0cd7a93f0e286d5b35449c9da8a8844a16661b25efdf0d3f7a10d5681989
MD5 cfb72ef0d323eeb9a250fccdab690347
BLAKE2b-256 597f06ede5b8cdd3297e77b41b07670983e9c66a17eb405ca44060ea7b8d1941

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.4.0-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.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 98ce8e402dbb55ff18e3ac35e577277ba05b5b4e6f6dee075e6d9951f665ea0a
MD5 765e3929d6cf1dc815d5b04745812645
BLAKE2b-256 ea0b98bd2caadf019807f564aef323eb6cc311e710ab17d56d51e39fe10f502b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 13b59c19f4055c3287be4a38d6010cb1bcdd13406f33a7969318b31e43b17be8
MD5 1958b8b3707017ff5d350bf296f30eaa
BLAKE2b-256 bc214cc26bba112e8d1d2a0676ee64f0b566390d955aebd7d120ed76ee7d1cb0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1900dc6d9f63cad50a72e2d88e1dbe1f2e08801731c7b1ef8f2034c739ac72ce
MD5 c6c18917676fc82e3851eaf6bab15b4d
BLAKE2b-256 9b66baa047c5e475fe222283277181ad962ca1b133b4cf3f25b0d0e6818c030f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 06b6a30db10a5b41b067c6e722eeea5b069dc22a01f0c3ad155fb5597bfbbe7b
MD5 4731723422fea3dc95a299ff531b99f4
BLAKE2b-256 ae9a613bb6129f10d8ef4cb35a82b967e11d5c52c7a01d34b94de3552cb9c99c

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