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

Uploaded CPython 3.11 Windows x86-64

drjit-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

drjit-0.3.1-cp311-cp311-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

drjit-0.3.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.3.1-cp310-cp310-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.10 Windows x86-64

drjit-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

drjit-0.3.1-cp310-cp310-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

drjit-0.3.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.3.1-cp39-cp39-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.9 Windows x86-64

drjit-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

drjit-0.3.1-cp39-cp39-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

drjit-0.3.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.3.1-cp38-cp38-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.8 Windows x86-64

drjit-0.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

drjit-0.3.1-cp38-cp38-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

drjit-0.3.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.3.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: drjit-0.3.1-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.1 CPython/3.9.15

File hashes

Hashes for drjit-0.3.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 32d0c7782f02f941db02f3711421a80b69b3aecc138bb630eca3d6d28b58e60f
MD5 467b3021a1e362f64a3a9d41b5d58745
BLAKE2b-256 6518b4cc4c3a57aca9079d5cceac485f4cf216df7ccff6d2b031e2ce7d722640

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a6082a6ba567f85a995aea01f63f58f89a5a8d6d3faa041519a74d6d37590be0
MD5 b4da33cecf4e6af18732e4878493a6c9
BLAKE2b-256 100627187aa2e7bb8689e4e2ebdbe3690259c52df15c11e10d3d11a09ea10757

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5e28db175b95921f2589909d064268aeccc5816eea7b2224b2916f5905d7653e
MD5 1cd74c4d6900936871510b71120531a7
BLAKE2b-256 b7936b55c53f1b1f615039d7c576c19ebf4d1e4029eb09e0727c100fa9263925

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.1-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 8eeb11775899ccae0a2cffa37edceb9a6ebee3ef1f47810dd22e9de345ea8f75
MD5 09b3313870472a35aed0d4484b8aa0ac
BLAKE2b-256 1a9c0dd5a3871415968f2811d764fa45fe9710c6b0b786d487a256195c593700

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.3.1-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.1 CPython/3.9.15

File hashes

Hashes for drjit-0.3.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1b1a6f53b3e6162dec3eec3bc72e70e5059648e7bc78b5c9acbb8bc39ba22ca9
MD5 e395cfb3253a52c361f8114ccc436ba0
BLAKE2b-256 de8ac89df375146621d133d8176c2c8a111044824609118c2dbd2b71b18a9d88

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f301c78377e0ec8a9cf077f32fa16767db1be0cd648a9120217bde4120963b0f
MD5 2e045ab8c925075482adcb6a4c2a0fe8
BLAKE2b-256 7fbd554032e31a80c2fd29b58fd1bd0b18df8985d08c0cb9161d82c2c93e2bbd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e6ae10226bf453efc981ed8713e19b7e4482c16173a451a35f63277ff5ddc91b
MD5 e6d6e6ff66582cc660f3c3b646bc35f0
BLAKE2b-256 e7f722b6fd134b0628e35dce5d8b1e99b24e0f324f24bc5a01b6bfb68ec2a3a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.1-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 d60637a604db6f45b11ffca229f298b1acb9d276485327298d2ee64c71badbdb
MD5 8caf973bf409c7a1d4aa6bca34eb0763
BLAKE2b-256 35833662a66b70c1cfb910dc2d632c99adbbb2bd02f8e7a5479a322c7a3d331e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.3.1-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.1 CPython/3.9.15

File hashes

Hashes for drjit-0.3.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 52a5f2b9324a0a65be2e9be79cacc43940ea483fa34f4a850f3cadf3659dddde
MD5 82363ce4bd69e0e450d04c384fad58d8
BLAKE2b-256 9531a2679c24963da2480c66ee8b3eb3e08abecd3ff811dea3f3519a32afe05b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 be3e7184c7715be57f971af6449de79467f38e2ce5545dd2a3974dd44a6838d6
MD5 275cd8c1e6229ce6247df61232926b33
BLAKE2b-256 85049722371e679bb9b2f852dbae3caecd6b5ec8ddd3f85173d941c98ebc9744

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6eae0d8a9877c201134e37d256866590ba53842176edb6eda2d397accb8f25cd
MD5 7ec9823bf91113e1b45dcca031ff8f91
BLAKE2b-256 0d216cf6e2c96b495cd1250ef93a2236a15a996cd1aba0677c7ab7a8ce39371f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b6499490add2ff3f190264c17277005292da0d21c7266fbad4eb82768f884e51
MD5 7770f4e8b3e5ca02bd2b34a1a6523a28
BLAKE2b-256 49cf74dd6022b5e1ff4ac3d2f8c836717feaf5166b92f4244737d9c8e707e4f1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.3.1-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.1 CPython/3.9.15

File hashes

Hashes for drjit-0.3.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c19d37c27509a82d16f3abd3c0fe06ae28bc676a441dfe17062e973e5269e833
MD5 6528aeef93817441d88c65b2148aa090
BLAKE2b-256 e3ed9120bd2a4c7263db435743cfcb51fd2904804dde18930cc1e0d1679bcbaf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 257b32d3019e3f7de3ebf256be3757d7151e78d62bcfcc7ec15ebaa18732ba5d
MD5 1277bcc4d43e72aebe205a0c71150ff9
BLAKE2b-256 cb6dfd98ddf8e0100faa61bd0895dd362957846445ad08d62953f22ea4f98f20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f20bcf7d640149a4ac8f4033a5ee7c5f53e3a550a07e952a7fcfe0c60cb5aa2f
MD5 b538b6949fb01f5125c632d561dfbdc7
BLAKE2b-256 990a0957cab7ebd387fce1765338c9fec85af8768f6fff8cc84e60fc55fe3919

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b7073265bba46c3f544ede6914df2a6c7c745220ec10ea79efe3f5f79141ac3f
MD5 9182599cc75fabbeab2991009c487400
BLAKE2b-256 8e057e0140506d643e9873babd84c7ca606ac48aee87061cf71f9eecdeb1a947

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