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

Uploaded CPython 3.10 Windows x86-64

drjit-0.2.2-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.2.2-cp310-cp310-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

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

Uploaded CPython 3.10 macOS 10.14+ x86-64

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

Uploaded CPython 3.9 Windows x86-64

drjit-0.2.2-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.2.2-cp39-cp39-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

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

Uploaded CPython 3.9 macOS 10.14+ x86-64

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

Uploaded CPython 3.8 Windows x86-64

drjit-0.2.2-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.2.2-cp38-cp38-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

drjit-0.2.2-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.2.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: drjit-0.2.2-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.14

File hashes

Hashes for drjit-0.2.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b43e21ecf6b335017554c8080d545ad9861797d134d7148b27afd79d709408ea
MD5 b032f8a86743e129c5ca21c799ca52cc
BLAKE2b-256 a50700ed6115fc36a421b08492a0300874712018ca14df1fa6980493f1c06fec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 37cdb5f4a4b4c56776e09d814bf9ae0626008a850599e75bd1992cdcb8ca7999
MD5 0e6304e566aa5a44d202b05decd228cd
BLAKE2b-256 ef8f206dcb0ce8e7f1fd633329159c2b7744312296f8dd9aab21351a0547a291

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1be415c93c4a5a616964ea5177870748a902eac9e4d991a94e590087c9b9d304
MD5 458e8d9baaea2d39729baf3005408fdc
BLAKE2b-256 74ff767316c473f55e840fed11e0693acaf9a6ab23e2811b067c2c9cbf030530

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.2-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 89a4b605f15929a0101fdd0f725e30c4d27e4a888c445f180e161279af52930c
MD5 2fe06b372f353b8e2caa25cd4041163b
BLAKE2b-256 a0275b2fe5cfe1fb12ad2df3d5275e2e1609d0932df48c0335535c72de684db5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.2.2-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.14

File hashes

Hashes for drjit-0.2.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 802e159e9d19a497ee04a952f760d5dd58634c92a7fcb7e241a2fcdd5391cb53
MD5 9f56fdecf807ad17f50b8d9283552d92
BLAKE2b-256 d19b69ab295b6acb807ca35a4cccc478dfec893e593137be0b57bae781e054de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d49ef61e39672c4de06b2e8b2fe7cb71f5baddbe9937fb281c091ab7d6963762
MD5 fbb274b6b4a2c9ffe1450c67aa1e4826
BLAKE2b-256 0caa17298226eed7f17a7e86bdb42541e36d98d88073d5a6616d84f94814805d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 94e790c5e218f6244ee773590c8de462283d7747299fa89039bdc25fa0d018d3
MD5 7de956f45bf85ee9bbdf444c973c8c3a
BLAKE2b-256 ce8b886e87a2e80a7fcfb9d0a952b1f9f91519caf649c2ce1699934c7003f8b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.2-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 c02753a2b4e7a2dfc7bbe179b7867711dbf40e260b0f4c8eb71caba020eb369d
MD5 2d8374d1c232360a05cf5e26511695bb
BLAKE2b-256 6e698832815c12c7af69a5cf329a3f249d36551c56291533baaf62ea9057a48c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.2.2-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.14

File hashes

Hashes for drjit-0.2.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e439c72114fe03da1b7c6672de71a206c02a5cf9ee6e24b34fea968c6539594c
MD5 fe8f2f7524c5760a658d4757fe5ca450
BLAKE2b-256 1fcdf5ae7599194091e9490af3985aa4bf7bac9ab0dc9676191e8c9ff3f4f00f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dfd428d062bf28fdaa28263268547d65a496b676922b895a4c5a2f1f083648b0
MD5 0a2d8a2a9bfb079cf061d6babb65f4be
BLAKE2b-256 1bd502103b888f1f9a660083c20a0cef2d4c6a636770b03a52e1e124da7517d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.2-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 610c458f43f7b422029d26af112fbb38e21863f5b725c892f10f21d4834f58d9
MD5 6fe4f06dab2deec73e05f7be5b22e269
BLAKE2b-256 3335f10113cf7892e9c6fbce5d3e8c8a174e543ad593c61cd8c5a0bc00744f8a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 4a5f04957b72403d4318bbfbc894fccfc33809d7af8de90e283ae147252408d7
MD5 a32f5e4357ae77911641f131b3170211
BLAKE2b-256 bce3655170730640ebd00b2d63c9534033eaa5a3716e179746fefd6bb78318f0

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