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

Uploaded CPython 3.10 Windows x86-64

drjit-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

drjit-0.2.1-cp310-cp310-macosx_10_14_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

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

Uploaded CPython 3.9 Windows x86-64

drjit-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.9 macOS 11.0+ ARM64

drjit-0.2.1-cp39-cp39-macosx_10_14_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

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

Uploaded CPython 3.8 Windows x86-64

drjit-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.8 macOS 11.0+ ARM64

drjit-0.2.1-cp38-cp38-macosx_10_14_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

File details

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

File metadata

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

File hashes

Hashes for drjit-0.2.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a6a7b0b2c2a082e8291d8fe3c25e1f1ff5d54af1b290bd512c95a96c766ec768
MD5 4a6add17ea09597461239e03447c05be
BLAKE2b-256 aa28aeceb2f16165529bec97149941233a6de543f7e7c3ee420bcf0bbb7fd186

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 18e6f71bf97d68c8c710ada184de7fc1dbd7cfabfdcf3ac8869485f56702c591
MD5 7404b481fc0c6aad0179391d50886c5a
BLAKE2b-256 fd8731e25e44d0415947c46564c5593e013bee23a0380e55bdf9ec6c36cf7e25

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 53c8ca135d2ad35fc5d7171e87066b6d06836c1a35551bd5932a3e2115c439ee
MD5 437b96aeb2f5506904016c7a299d74f5
BLAKE2b-256 b12be5090cdcbf41ed386675962b0a001b2aa0de59ec4a546312b365281eeb88

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.1-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b28ebca1ebc7c3943250aefd5aed8fbc9e83cf2a5a435f0c7d3201695400f199
MD5 2f5fc8ab9115a13f5faa1f7be1aec89d
BLAKE2b-256 decc0c28d961eb8c15db940aaae3f2c2e4093e56d8b8c3020176da59d5f6492f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for drjit-0.2.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 2799b023ffba180fa3e21bf83984de0648d35aa9e7da69a3d5a03cac2f358fe6
MD5 9587fc1d8b61c17dec51ae0b26280f5c
BLAKE2b-256 99d04778f0a2493afc531c353d6337f6de7c00604c3a36963412be93ca20c848

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 54f49efefa35d9b10784a634db2468b20ec9e45ade68c2e2302ffccc98d22f86
MD5 f4843d7af3d597686709baa6d95c9dfd
BLAKE2b-256 4545c1566a9939a674fa409ef865e560df6bcbee41ad88919bd6ae0d29d427aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bf24843f7bc928ee774c278585312378b0766b0dcee6a1246cd6192f68d059ce
MD5 e17c37edd76b0887fb189b4d9f008644
BLAKE2b-256 c63977c24738c2632fb4c861249fa5475c98677e911d7bbc805a91a6125c57eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 71f122ddffbef2311fb1149aa7f0a2332aa7cbafd1d46941995cf66c511f18bd
MD5 94a63cbe84039ac20a3ae62336281e09
BLAKE2b-256 64687ccb8dfd216f9e7655066181e4e9e86386766dd365ccdb757898dcb179e0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for drjit-0.2.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 49ef146f3be506dee419f1b0c1a3227b4e357c7a2ac843224d9c1006344d3ab9
MD5 1f7a951c61016effd8479554fe72083d
BLAKE2b-256 3c34fa0cbc04904e439cd8263c1cfadaf20c43e9f95b59780503410e7614a273

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ed88185007ab68bad2d3599588ddd7d01757270db87e8eb2ca82548235d28423
MD5 0c5371f8a8040fe87ffdd6e085bdcdf6
BLAKE2b-256 0d848a44cef52990101b14c79f42c726fc8b02b4a724f962cfc24949e5bb5bdd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 45fa4f0dec7418ee6a51f3732665fc6f217e8c2d2c9684714f1757b6e542a8b0
MD5 90b974cde20774047afb31f3cd66a564
BLAKE2b-256 f71f0e113be6d282c9c1554a5b5928a4b4c540649c85cbcbd5db06a9d48795be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 3703a17c5ccf05f36b96bd4ae0906f0fedd2a5b0e879fa8216d50e8fcd796386
MD5 913fc0df5d8893748c1bd0cc653beb3f
BLAKE2b-256 def8385456285bcc09c26cc4cdfba26e976ed82d081e057197ce7da2e64e63ef

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