Closed osylum closed 1 year ago
Hi,
For differentiable volume rendering, you will want to use the prbvolpath
integrator (src/python/python/ad/integrators/prbvolpath.py) instead of the regular volpath
. The prbvolpath
implements the path replay backpropagation algorithm described here: https://rgl.epfl.ch/publications/Vicini2021PathReplay
This should be quite a bit more efficient than the simple volpath, especially as the number of bounces is large.
Hi,
Yes, indeed, for the training I should use that one. Unfortunately it is "only" around 3 times faster. With my current implementation/settings, I would barely be able to train with 7000 samples in a trainset at 128 resolution, which is quite limiting. To get an idea, what is the limit I can expect for differentiable volumetric rendering time? Am I reaching the limit, or there are other means to speed up the calculation (or training)? e.g. NeRF, is using ray casting from purely emissive voxels to learn creating novel views - Should I also write a custom integrator to learn BSSDF parameters in a more efficient way?
Thank you
I don't think there is much else you can do to speedup the computation with your current setup. Maybe, 4k spp is more than necessary? Running a coarse-to-fine scheme should help too. Noisy gradients still have a lot of information, look at how few samples per pixel we use in this tutorial
I'll close this issue as there doesn't seem to be an immediate issue with Mitsuba itself.
Summary
I need to reduce rendering time using volpath and envmap such as to render 7200 images at least at resolution 128x128 over 50-150 epochs. Right now, it takes me on average close to 7s per image sample, which is too high for affordable training.
System configuration
OS: Windows-10 CPU: Intel64 Family 6 Model 165 Stepping 5, GenuineIntel GPU: NVIDIA RTX A4000 Python: 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)] NVidia driver: 517.40 CUDA: 10.0.130 LLVM: 15.-1.-1
Dr.Jit: 0.4.0 Mitsuba: 3.2.0 Is custom build? False Compiled with: MSVC 19.34.31937.0 Variants: scalar_rgb scalar_spectral cuda_ad_rgb llvm_ad_rgb
Description
I am trying to reproduce results from Che2020 to learn subsurface scattering parameters. In total, I have 7200 images in my dataset for training and as much for test. Rendering using volpath and envmap (scene description below), llvm variant, for a resolution of 128x128, sample_count of 4096 and other parameters shown in the scene description below, I get to an average of close to 7s per image sample in the train set, which means around 14h for the whole training dataset, and therefore 25 days for 50 epochs, which I can't afford. Ideally, I would like to render at 512x512, but 128x128 should be ok for training.
I precreate one scene per meshmodel and light rotation and during generation of the dataset update material parameters rendering with mi.render(scene, params)
Number of vertices vary in range [8887, 50000] in the train set. test set has one model with 158708 vertices.
Here are some timings:
default parameters: meshmodel='buddha', sigmaT = 276., albedo = 0.95, g = 0.8, nsamples=4096, rr_depth=5, sampler=ldsampler, resolution=128, variant=llvm reference rendering time: 5.93s
Is it possible to render this scene much faster? If so, how? If not, how to perform such training in affordable time?
Thank you
Steps to reproduce
Below is the scene I used (model and material parameters can vary):
def create_scene(meshmodel='buddha', sigmaT=276., albedo=0.95, g=0.8, nsamples=4096, render_resolution=[128,128]):