Skip to content
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

[Bug] Latest mitsuba3 failed for prbvolpath #1334

Open
andyyankai opened this issue Oct 8, 2024 · 3 comments
Open

[Bug] Latest mitsuba3 failed for prbvolpath #1334

andyyankai opened this issue Oct 8, 2024 · 3 comments

Comments

@andyyankai
Copy link

The latest version of Mitsuba3 using the new version of DrJit failed when using prbvolpath for backward/forward mode on heterogeneous volumes with NEE.

It seems the issue is caused by performing backward/forward operations in a loop nested within another loop during tracing, which might be related to the latest version of DrJit. Here is the error message:

Traceback (most recent call last): File "C:\xxx\mitsuba\python\ad\integrators\prbvolpath.py", line 271, in _loop_body dr.backward(δL * contrib) RuntimeError: CustomOp::backward(): the reverse-mode derivative of a complex loop (with max_iterations != -1) is not yet implemented!
To reproduce the issue, you can run the code using python validation_heter.py. I have attached a file to help with this: validation_heter.zip.

The issue can be triggered by backpropagating a loss for sigma_t for any heterogeneous volume when using prbvolpath. I have also included a prbvolpath_m1 that supports forward_mode AD in the zip.

Thank you!

@njroussel
Copy link
Member

Hi @andyyankai

We have a (temporary) fix for this in this commit which is part of #1287.

It's still unclear to me why it was necessary and so I'll be looking into that. In the meantime, you can use that patch - we've confirmed that it produces the correct result in reverse-mode AD:

@andyyankai
Copy link
Author

Thanks, I will take a look on this.

@andyyankai
Copy link
Author

My forward-mode AD also works after the fix, thanks!
I will leave this issue open for a while in case there are some other problems.

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

No branches or pull requests

2 participants