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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 macOS 11.0+ ARM64

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 macOS 11.0+ ARM64

drjit-0.3.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.3.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: drjit-0.3.0-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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7a1ffe4f5890afc6d1dba71de9d1f2d907e576f9ef10c3bf2e933aaca8f2ddbd
MD5 57a5be11c6a50e9c2f84ea2ddc3d1b73
BLAKE2b-256 b8c3b7089f00ddf7720787331a0d24cc5dac8539c5e1ce992e884d5b9ce8c941

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5d4a19ce9e327f31c7c99fe0fa6e79f8be5cbb78740030178fc9e1642432d1b1
MD5 b98ac9693d7e771b7815959376836c0a
BLAKE2b-256 1ee9ea7c0a16b2b8b4702534d744edb90fb0a75b2804a57e90d769a893fcabc4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6ece59b57aa021f6437e0c5746f250093f9f619ad946dcde2cbd35aaab41f095
MD5 90466336e94ba5915f33bbdd882f6689
BLAKE2b-256 3aad179e9355a4b40adb0a6606cb3172665a3349fe27183a72035e3275cb3855

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 134408cdd100dca87b914531edff7534ad82d57b23b9a36798a69b8dac2544da
MD5 6bd5371d75d84db6a1114c7c22a3f73c
BLAKE2b-256 89a8573b756465663d25200687290ccd3c3dc56f975792fe507e93cb04365462

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.3.0-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.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 879bc43742cf9b8be03a4566d890ac833109b18b14ff0520c2b47731e96f710d
MD5 6398738908db550837029749ea91bd0c
BLAKE2b-256 1c8d15349a589a750cf43717cb994337b09c04908895acbdf0667ca4662e0886

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 837e3e376a49d3d8a828d7ed12be3b63ddf0d90a6c1be5db59d3f9c73ca56722
MD5 3fad3a78fe6b62886ff78f8d639b62e6
BLAKE2b-256 8785ebe762b81bb1e085c5f6b0d6c5ddc17a3affba9d970fb709e322314f8b42

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 db2326a8131175d17af4a17d225190b6fa9ca955a834176f9ded00784227e02f
MD5 192dac8ea2c0604741598fd711110c67
BLAKE2b-256 d5a040c956b22be79ced596fc555f277ce31279329aca9d1ef4c0c5e903ec34c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 778de161de9476fee4e3065b13540e587cf47b6cbbb52da5225b14e9f246183d
MD5 c98edb07756532d58e4d1593bc7f2e3c
BLAKE2b-256 003a790127f38c0e678e9564cbb1bdea89d0ce6e9ba7323cf7ade8ed20480fa4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.3.0-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.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 0c3530d6a4fb44100f2c3e4ec9560415e137cfaed92a79d1035485a7b17867de
MD5 96cb4f742ff4ecc750e4f09592afb9d7
BLAKE2b-256 92d8fd69d0668298087f442fada33a4cc16a0d8ca98aa955fdf5021eec68aec7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3082eb1dacc642f49ea97000d6a3e0ae25057e0f25d901556ad4a7623898cca2
MD5 6f99422766829257f9215d70ef448e78
BLAKE2b-256 66d0898ad4c538bb6944fbc4078679409b9d2fcbda81c08dbfa900fe71aa6f3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e30591fd01dea70ca96447e0986bd70fbbed11c7e67aa37577076ed453fa1e2d
MD5 f1313eb93834803008d58c8850c45fda
BLAKE2b-256 43b5d02a91be2d6ec947a42974f4839c311217deeb1c14adb0ee1620b5d18bd9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.3.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 6989cf8d32c59da0b99e7f1f6b7bbb1646ec52cf8ae6a31a1d5ef2e08bdb70cf
MD5 908801b0eef7bea464f2d6a06c41cc3c
BLAKE2b-256 9a688fb021d4a79ab210344c88adb4aa02264f1b01385ed5ac2d5523b43a3bee

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