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

Uploaded CPython 3.10 Windows x86-64

drjit-0.1.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.1.0-cp310-cp310-macosx_11_0_arm64.whl (2.6 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

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

Uploaded CPython 3.9 Windows x86-64

drjit-0.1.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.1.0-cp39-cp39-macosx_11_0_arm64.whl (2.6 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

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

Uploaded CPython 3.8 Windows x86-64

drjit-0.1.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.1.0-cp38-cp38-macosx_11_0_arm64.whl (2.6 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

drjit-0.1.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.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: drjit-0.1.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.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f7a92d5aa53d2a8e6112d4499d76451211bc7cdf2500ab50ed5bfaac02cd072f
MD5 63a680d43f5f24310cc7dc9a53c03bd1
BLAKE2b-256 feb2b4d9c8101a3816f65cac61eeb5c824b74ea2f1d5e8b8f42c7e434abb3876

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 677213de3cce3a1d81c4a0b297e993410a4a519852fe4dfee39dc37be5a0c2d2
MD5 f91bfdbca6c4944f62edf63cffb1f8ec
BLAKE2b-256 6e87655bd7f42a99d4901d74f7e356dac12aac2c2089ab9036225b9512f8735b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 2.6 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.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7f3d7497b68a67b007a48d78cbc6f6695b003684e88d940302a84f396d99865e
MD5 77a81aab2dc0767d45139f774cf9dfeb
BLAKE2b-256 af9b4ee39c2c76f7a7934c91daabd4f6141ad696882e7addd2399c3339ac7a02

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.1.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.1.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 045d9dfe7722313592ebc5368351aae1cb1e85ea4c3cdaa29cb5ba836b20da33
MD5 8ac50617109923d05e027167acdb8a44
BLAKE2b-256 1887e132182b8870924202b72c5d138bda69c1dfcf4ff351c6f94ee1f5a496d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.1.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.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 579b1d517ac58739141ed1474d75afa05e6977f69ca4078f4305e0ce4035ee25
MD5 763082f375bfcecc939e1ae741165885
BLAKE2b-256 9181b8cd24ad500b9865ce7128f717649250ae73d9c367c082a02f2dcce73c73

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 14541840ac0cd0b5a4c038368560055ca1df18e96ecc54680b26cee37d734d3f
MD5 ff7131194f078138c6c50518b8ad9c2c
BLAKE2b-256 985484087c70abab6622c827780a8a93ca7062542ea730aac7f1c66e1e41bce1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 2.6 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.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2ce7b44f0aa347224213faaf55d7729d91ca38308d639299adcffba751129c84
MD5 61747f5128b1c3adb6dccf6d5f2af7dc
BLAKE2b-256 ed5ba6da2eeac7358150fc075a42892486438eee369da6bffa29e09aa2181845

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.1.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.1.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 0e91070e58f50d4bdc3e6ec159667a254c64af7b8295630b25987bc10b507241
MD5 012637eeefe2c6fdedcf1cf5a1d0dedb
BLAKE2b-256 237209cdbfe1af9563e6811595140717334abb20bc8db88fc7f2a1ea583e87e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.1.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.1.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 2cbc44cd7d158e53db0d3ad0bfa168f34a864e0a8f727ae49032848818ce8ce7
MD5 b974a0f3100acd55503b3125dd4fa62b
BLAKE2b-256 a9b395caa99c6275dddd6106ed179a2e4ee99d393f6cf0198834b03f95ad29a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for drjit-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e0f8695cc0bed1728ecc46ad23e76186c6a478a886d656c543b1a3323770b42f
MD5 593760d45ed9b704eb40acd1ef4ec9a4
BLAKE2b-256 f33598dbfc11650ea96a282fe455e83798398dd4cc90303099dc2f75d0b1118e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.1.0-cp38-cp38-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 2.6 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.1.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 20ad42ea8654ed84643eacc4d0adf159d0401f6f374be6d2ea4e9bf7f4b052c9
MD5 00960a2c85381ef188d8caa0c4a0c5f2
BLAKE2b-256 df24f37cefa8b6c9c598ecc8f3fd3812dd4909c5b096cc0f08622cb60a77b32d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drjit-0.1.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.1.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 69f191a0d535b41973374a35e2f7c6421987be2b2510feb9c93a17f2ed2be1e7
MD5 40c104f6f97a8ac7c0c5778b4e07a882
BLAKE2b-256 c00ecc05ab53d2036f2130961058201819d09d3cf56826b3956cfee5fb12c421

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