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

Uploaded CPython 3.11 Windows x86-64

drjit-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

drjit-0.4.2-cp311-cp311-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

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

Uploaded CPython 3.10 Windows x86-64

drjit-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

drjit-0.4.2-cp310-cp310-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

drjit-0.4.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.4.2-cp39-cp39-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.9 Windows x86-64

drjit-0.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

drjit-0.4.2-cp39-cp39-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

drjit-0.4.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.4.2-cp38-cp38-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.8 Windows x86-64

drjit-0.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

drjit-0.4.2-cp38-cp38-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

drjit-0.4.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.4.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: drjit-0.4.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for drjit-0.4.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d976c339e622e2db9370970689682fd4ea261fb8548fbe8f2f7c8231e78fd77b
MD5 5ee7c7964e0526b88dedb8c25aee748b
BLAKE2b-256 b9cf01a22d59c39047282a0d02bf8948fc4c88451fcb7fdf83600ea8c5a84336

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 47a73a41fc546343434e64ba597c2cec98c89697075e23a50fa022f75aab4934
MD5 19fe90a948cdf7f34682c79261dbd927
BLAKE2b-256 5a349af0b2b2c36b2160bdc9671d514eb580e99a6cd569a884a98a08ec17ce32

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 74f9fd2ea1f38f153b799dc13d936cec36a802c0aba5fd4a022e0ad89e168948
MD5 16f04b74ec67220f4c06eee45073a68f
BLAKE2b-256 67c0fdf6257966f60e05b75847ce788b5ca4598d72cced844ef84ef466c874af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.2-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 cfb23246a907784cd2fd0509e9212cc5d4414a1c1e7fbee98aed57f7b69d4803
MD5 ffbe39eacb39499ad9c7532c5d5a4937
BLAKE2b-256 6a299e8ef7414b715056ec3534ba15e639bb76dc907534023f84b938296128b5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.4.2-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.2 CPython/3.9.16

File hashes

Hashes for drjit-0.4.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 61f8eaa5717535ce680dfc037e5605b8994931be0251038f418d22470d7b8563
MD5 4298a244dbad00d9c3cee23ff77d0667
BLAKE2b-256 f00629caed5067eb2ec28e022877b919cce9b1a684aeb9ea399e526681dd07af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e40e4afd60d4d00c5fe4d02c49898bd8acf8f8d86d5bbb8662baacd3605b2544
MD5 1c35c7f33add44b88123952065bd1176
BLAKE2b-256 2393d8a9c269b62c737690418af3a7f90e1188f800a17d49c998e25ac5fa7202

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b971e1fc7e4b985e9f2bef60b185e55c0c11d539e5cebf79f16e20d76a537a90
MD5 7a58f6df09b140b0802e68484ffc4b34
BLAKE2b-256 fe2af2159cf1bfd4ed6ce09f2004991bacf2bc52a981645aea395cb83f0ee03a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.2-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b7fe2eb2a1ed6395840d0d1c5fb90526d509891452be4c8f069064af730cee2c
MD5 ec14754408d3f0cb856cc9eadc2d726c
BLAKE2b-256 601018a7a963a2dcee2e2f865765b2d0b570bfd72ce0624e84ebc4ee8a73cc6f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.4.2-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.2 CPython/3.9.16

File hashes

Hashes for drjit-0.4.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e8819f03e27bada3e74d049f4e9c9230b20f6ad146592213e4d50e6989453236
MD5 b5f91f102e8d0c9973f2a2112dba6926
BLAKE2b-256 205a0657c9c2237d09dbf73919181598138dbaef87c05fabfb3421ec53e0c095

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6ad9f3f2f8d71e7da9213cf6e2509087c227567d713334e354b90a3d120c1c17
MD5 c30ad5c1f30cb0fc5907adec43738489
BLAKE2b-256 88763e9a26ee3c0296f1761f6666a70357219e86036de2d1e6f1e7e5832b09df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6411d98c9b5851fd22dffe145707e39f53fa877f891329dc996692a652bb1fa8
MD5 870807af0808ab610b76901e7f62ba7f
BLAKE2b-256 54bcf17f60aa8029625187fd126a876ff85ba7846496c4a9d60efeea6c7c10c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.2-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 cb51765adfb8968f7a836fc4c80b3d5cbfe35c5a577af30de7a7b9cb14620a61
MD5 2db46f5e4debf8f9ecf3708c9e931661
BLAKE2b-256 9e74cf621da6915ef6963fb39e35b0f88c7d8560ef23c0490ee44ed60409a4a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.4.2-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.2 CPython/3.9.16

File hashes

Hashes for drjit-0.4.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6901eaafa3ade56fc2bdccb4efec2ed74108aade4c85e5faa05b993ad4be9f05
MD5 1f376fe3ac157af417ce8fd4dc895bf3
BLAKE2b-256 cb7c9bcebfa2d45360237770d8badeb851dd717a929a8893d8e299f69bf6c800

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6610150fefbf42063adc0fcdf117f332960b74380662f5623a586e5c57fc6a12
MD5 3a8c09ad16861cc097e399c45dbc1d90
BLAKE2b-256 1a82c2545e8d4f332185fa4e83658595680c76e474d1d5f111ea2849eae4d559

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.2-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3363076b97e90b05377bb789be4c0c480322f0688449b4ba4073bed7321240ce
MD5 ad89f2965206ccffb8e606649c0d18f8
BLAKE2b-256 317cd1568081713c80e3da6f96bc8566552874a990b372a8def854c02bc035eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.4.2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 85d5a249ceb5a11f08f6eb7158d8a58e5aa1afadd2b38d992c51ab47a1deeb7c
MD5 72124bcf646aad737820958d3457a5e8
BLAKE2b-256 a38c15893fc19d03914258eab1a57123b2e7223639917a2bc0f70a891cc96792

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