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

Uploaded CPython 3.11 Windows x86-64

drjit-0.3.2-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.2-cp311-cp311-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 macOS 11.0+ ARM64

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 macOS 11.0+ ARM64

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

File metadata

  • Download URL: drjit-0.3.2-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.10.8

File hashes

Hashes for drjit-0.3.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 93cf6010a2e06dad1a39738020239b1b55b611fcc3e60d67040f1d9571562457
MD5 2b2ee18cdfeb3abb3a53cdc93c3ad11a
BLAKE2b-256 539febf8e9db07529a82909ddc19239a34f1ae00263090e48d29eaad4196b958

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1c3f3e53660abd2d22a5e21f5dedda703092ef4b4ebc66f07c1799b2421812ea
MD5 c8624daec9f80e4914ebebe3559a45db
BLAKE2b-256 857af72e3275888f4341122488af938cfceecca457b24488b30fb52af33dd9fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 598bfdb8ed7c65ed3107b4e6f3c861bfce8bff3984b92c82b824a5cbf972a462
MD5 b102861abdabb54e089d86b8cf27dbec
BLAKE2b-256 d51445eb960acef5ea18e3d9d0b87d194dbcfd17bd46135a5f0d2b9de22c7490

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.2-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 395c489a1fedded571dda057e28032917aa9cf9c6d797e7d8d8b1dc38a03b70b
MD5 6c593f189b0485b206e18f456c3a4e2f
BLAKE2b-256 cf35bc347b6f61b72c6d307a7cdfdc644d8f8ead56c985fda915bcb035341352

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.3.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.10.8

File hashes

Hashes for drjit-0.3.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f638cf47f762c1b976c74dc7fe1e507b34a24b1b215a3ba651eca873157805ad
MD5 4e5267a8fb25c50d16d75135b583f036
BLAKE2b-256 54f5282fae8d71565b1daa5c0a6e53b1c438765289e9199389ea942fc0c2cc07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d1431e57e92a9648e332199ca54a99f7e5b4d1e31de9e256b5da19c4d917073f
MD5 782bc81185a048cbca7de650e00f061d
BLAKE2b-256 11524551fc5e0dc56fb9c47f3a8927e5bbcb917c4b120975fbe242e831d0c918

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d2841056d915f28000b5117bb82d1346dd9902c29210c61e230d244b851151d8
MD5 55a9cc4cee27a12e48c2aef72ea93f4f
BLAKE2b-256 b7617b6b6cc9d55c1aa6cdf79999f1c9c4500199019b3a947ddd6f523387fb68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.2-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 3eb9b490b0db906e6daade55dd219cda08369b41eac1d8ec16d0c0ff4ba8bb4b
MD5 95b812dc012ac53e01004194dd427285
BLAKE2b-256 1c6ea2b5ee9dee82ce1dbd974e55c09e6e838ba1e7468fc9c46992e3b52291c9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.3.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.10.8

File hashes

Hashes for drjit-0.3.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 dd71e0b95748c65c3844dfe9774b4134b3d52d930b63ca63166d45474e06c6ed
MD5 d9b4df4727897f69a98e22c0f423b317
BLAKE2b-256 f1ca5c1bc2b93c9741524a202f77105727f33bce3edf1cbe9edaa84b2a6def35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 29e8870cee15ae548f8c713535aeca2a3b388b78b94b805acd4621e9114258b1
MD5 7c8f9788974b72235a02be6b22e385b3
BLAKE2b-256 01a47641abf38e00af075be56b3e4706bb2c432806543b9e86da3ab9f843aaa5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3cee9e10a2cacbbb963609d70feadaea8814e705692726c7484ea67c5a422565
MD5 478cf039f8982b0208a05f67e80f9a6e
BLAKE2b-256 ccecf60985812b1e4c2897e48d1e13348f9a497d52b3ab8581de00afda8f94c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.2-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 aaf7de9dff253306d0e31f73f8c0d2113795a613a78d245761a94fc5845f7cad
MD5 d993ecb3f0f43c0e675e6615bbd6f7f3
BLAKE2b-256 f3c6dc2224a3e88d35cee206fbde5163f4de625ecc1c6e01fb990f5d4fd8dc86

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.3.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.10.8

File hashes

Hashes for drjit-0.3.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 0fe24ee598da65dbe9388b6c3d516fa33d9991e1cd92fc63334fb05c7648cbd1
MD5 644ad34d04a72b0d3a11fcf54a740078
BLAKE2b-256 6c64a5dc998e4dfe1f85bb9cac819ba0f1b77724267b1f6f72e7456841094dd1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3f9c009af7503b1f3040483dbd01534b5a749c3e887757bde6c0efc387004c4d
MD5 7697f097e57f0712f0fa71cc57a65947
BLAKE2b-256 364f785a0f4dee7abedd2e60a559c278dd1a22bea82f1737d3b9d9d87518d43b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.2-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 23a742b6a1ffa5e6e9401982a103b13a9ecae3e5784bb05bc3e733e8e8fecef3
MD5 febf51830f06a75f5785820f3273d140
BLAKE2b-256 eaf61a7fb285e0b1f70add9b2d7faae3ca058d4f066a5bd6391a97b102b05c4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 96d2e17cda23bf9173b98bcddb4b2161fe0df93d0ee4d7835a3d433a1344b4eb
MD5 0f221cec8a9c81916be83ea41a4535b7
BLAKE2b-256 ef78ba55000d5228558f67f21c2e3ab6a403a9419031952baea4cb9e55853d64

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