Skip to main content

Structured vectorization and differentiation on modern processor architectures

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 macOS 11.0+ ARM64

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 macOS 11.0+ ARM64

drjit-0.2.0-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.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: drjit-0.2.0-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/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13

File hashes

Hashes for drjit-0.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 263b374ea3db6141c0c37b7a3287eebbe670807daeeca2ad49494ab2416bc4ba
MD5 d6132263238a809747405a49f684923c
BLAKE2b-256 2e4f015dc0cd91aea44830507ed99f1ad324bf704b62745c1edc28b600158e40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 20b9e88245ddfd5891769cb0b61e5483f593dcd6bd8971efa05047d39ba1ffe8
MD5 110c2b89cf30ae73bfe741591e88e07a
BLAKE2b-256 ab902690d75fd068362eedbffa52097fc45dfc3b41581e9c2b83fa035d15e1ce

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.10, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13

File hashes

Hashes for drjit-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fffdc3bc399fb1744cc056b0dc86740a75d48b325d7b85c728ffc4c3383b3524
MD5 68a5b8a14d20beb0f96747a58bcb26bc
BLAKE2b-256 7d6806694afd1b418a7c1cafccb84019e1f154c7defd5f09f44496780f086bcb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.2.0-cp310-cp310-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: CPython 3.10, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13

File hashes

Hashes for drjit-0.2.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 31dfbb45fcf29771c3490f91f951ff12c793ad2e6b24b89b958225710b2c851c
MD5 ab35b43eca673c8f113c70d084fe7afa
BLAKE2b-256 d94c82a4a3c784c5abee5a5b0797ce824df4d63557e2cd16a61ba4177aabcad3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.2.0-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/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13

File hashes

Hashes for drjit-0.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 87fcf024305112b7265fa5b1fb63a40d66d566bb5fee08e51e4d15abaaf0ec66
MD5 70a1249d1424e38f3c46fec3dc8c495f
BLAKE2b-256 ccf083321b9ff46f6c2e5f75179503cbb2e6f537e478dc9a2ee883ee664476a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 526a018dfc2c3af3c9755c6b44ea405ab23c3ae7470cbb9816c157680174a016
MD5 c6ff765e5e24e651df7ad5f74e8c2389
BLAKE2b-256 163fa155cec607c3d3ed2451a056724688630472227d663a2e871c5eef167f46

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.2.0-cp39-cp39-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.9, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13

File hashes

Hashes for drjit-0.2.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 07a230f2baffadda426b05ba5b7e543a65884cb9d2db69cf5c7be641b9a575ee
MD5 fa8567f4bc00c7de5116839a8988ca73
BLAKE2b-256 6906eb72c2e7a8d54369311be1bd35c801311d64672b0f5e3fe645f91beb8aa3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.2.0-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13

File hashes

Hashes for drjit-0.2.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 fbc9871c11978b544c435c7d8fab382a86752718a01c5cae4013e72f7fa52631
MD5 828caf651db162f9e8d5480393f18cdf
BLAKE2b-256 8b213ffb12ffc426febdba2ed6b8a2cfcb5cf1c12c38fa7d7269292947392ccc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.2.0-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/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13

File hashes

Hashes for drjit-0.2.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 32b9641e92e5beeb801dba4eeb2bd78e8e4b3cd77411b1f50e0dd818bfe3fde5
MD5 2b91639b3b523b0a4b8e8841d5ea2986
BLAKE2b-256 90bafba07769ca326ef18257379956988fdc48df3ee720a58bd2886a1fedc43a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 214a89c15ce4e8fc7c64ba758007e74ba34500be420594ace85c879b71c3cbb6
MD5 cb176d04f8fd597e9ee30c3e859cd7b8
BLAKE2b-256 fc126cce4f7a087e312083f35cb2a3ae7379db6cd7bc6b94cd951f2cbd4f9414

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.2.0-cp38-cp38-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.8, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13

File hashes

Hashes for drjit-0.2.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 87e3cb75cb13f83c0d748a961a9a02896591f781e049a988f362a9533a30c70d
MD5 743a831baff384ea02520f73a9bea3f5
BLAKE2b-256 dccccaad511ccc37ea23e26bed11f6b7d95408e996b8f0cb28c667e38be29692

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.2.0-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13

File hashes

Hashes for drjit-0.2.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b8e3a4897cf004548fbdeb176ec796e6d333be50d52a0ce4c5e0b0e576e7c6ba
MD5 12f21d91ea4ef2c77d5fe30663d2120f
BLAKE2b-256 a7a1412a0b19a7901718eb2b378bb63b65275296c8c05b0d1cf65c91d626b4de

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