Skip to content

Frozen Functions Auto Opaque #361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 30 commits into
base: frozen-functions
Choose a base branch
from

Conversation

DoeringChristian
Copy link
Contributor

@DoeringChristian DoeringChristian commented Mar 7, 2025

This PR adds the following improvements to the frozen functions feature:

  • An auto_opaque flag is introduced to the dr.freeze macro. If this flag is set (by default), the arguments of a frozen function are analyzed and if compatible only changing literal variables are made opaque. This significantly improves performance and memory usage of frozen functions.
  • The opaque_width feature from drjit-core is used in the dr.mean function to determine the number of elements. This enables us to call dr.mean() inside a frozen function while keeping using the correct width when the input width to frozen functions changes.
  • Improvements to logging, including a function to print "paths" to nodes in the PyTree if literals changed or when errors during traversal occurred.

@DoeringChristian DoeringChristian force-pushed the frozen-functions-auto-opaque branch from e7959aa to 9a7115e Compare March 7, 2025 12:01
@DoeringChristian DoeringChristian force-pushed the frozen-functions-auto-opaque branch from 9a7115e to 6bf85ea Compare March 13, 2025 13:10
@DoeringChristian DoeringChristian force-pushed the frozen-functions branch 6 times, most recently from 3c02e8d to 037ebbb Compare March 15, 2025 19:40
@DoeringChristian DoeringChristian force-pushed the frozen-functions-auto-opaque branch from 6bf85ea to 8394a1d Compare March 16, 2025 14:42
@DoeringChristian DoeringChristian force-pushed the frozen-functions-auto-opaque branch 4 times, most recently from 9088b73 to 311766b Compare March 20, 2025 16:17
@DoeringChristian DoeringChristian force-pushed the frozen-functions-auto-opaque branch 7 times, most recently from 3788ee3 to 5423c59 Compare March 25, 2025 12:36
@DoeringChristian DoeringChristian force-pushed the frozen-functions-auto-opaque branch from 5423c59 to 101b9eb Compare March 26, 2025 10:50
@DoeringChristian DoeringChristian force-pushed the frozen-functions-auto-opaque branch 3 times, most recently from 5407807 to b3fd365 Compare March 26, 2025 20:18
@DoeringChristian DoeringChristian force-pushed the frozen-functions-auto-opaque branch from 2370547 to de3135f Compare May 6, 2025 21:41
@DoeringChristian DoeringChristian force-pushed the frozen-functions-auto-opaque branch 2 times, most recently from 5e8be1c to 2f3a144 Compare May 7, 2025 10:22
@DoeringChristian DoeringChristian force-pushed the frozen-functions-auto-opaque branch from 2067ed1 to c3073cc Compare May 7, 2025 12:35
@DoeringChristian DoeringChristian force-pushed the frozen-functions-auto-opaque branch 2 times, most recently from f7b690d to 89226d7 Compare May 7, 2025 21:01
@DoeringChristian DoeringChristian force-pushed the frozen-functions-auto-opaque branch from 0256452 to 9bf6811 Compare May 19, 2025 11:56
@DoeringChristian DoeringChristian force-pushed the frozen-functions-auto-opaque branch from 21fb2e4 to c851eab Compare May 22, 2025 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant