-
With current version of mitsuba 3, is it possible to call pytorch code in recorded loop? This is useful for e.g. performing sphere tracing on SDF represented with a pytorch neural network. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @KoykL You'll want to take a look at this thread too: #586 In short, the answer is no, it is not possible to call pytorch code in a The only workaround is to disable all recording features with: dr.set_flag(dr.JitFlag.VCallRecord, False)
dr.set_flag(dr.JitFlag.LoopRecord, False) or to use plain Python loops. |
Beta Was this translation helpful? Give feedback.
Theoretically it seems possible to weave a function pointer into a computations graph, I agree. However, in practice, the Optix/CUDA kernels we launch have certain limitations. We cannot arbitrarily insert any function into such a kernel.
The workaround is to split the kernels: have it stop right before the pytorch/tensorflow/etc. function and start again right after the function returned. This is what "wavefront mode" does and it is enabled by disabling recording features with the two lines I mentioned above.
No, that is incorrect. Recording has no influence on the result of any computation, it is simply a performance consideration. With recording features, we are able to generate a sing…