diff --git a/src/python/python/ad/integrators/common.py b/src/python/python/ad/integrators/common.py index a8fdbba24..313704415 100644 --- a/src/python/python/ad/integrators/common.py +++ b/src/python/python/ad/integrators/common.py @@ -103,7 +103,6 @@ def render(self: mi.SamplingIntegrator, # Explicitly delete any remaining unused variables del sampler, ray, weight, pos, L, valid - gc.collect() # Perform the weight division and return an image tensor film.put_block(block) @@ -212,7 +211,6 @@ def render_backward(self: mi.SamplingIntegrator, film.put_block(block) del valid - gc.collect() # This step launches a kernel dr.schedule(block.tensor()) @@ -226,7 +224,6 @@ def render_backward(self: mi.SamplingIntegrator, # We don't need any of the outputs here del ray, weight, pos, block, sampler - gc.collect() # Run kernel representing side effects of the above dr.eval() @@ -619,11 +616,6 @@ def render_forward(self: mi.SamplingIntegrator, del sampler, ray, weight, pos, L, valid, aovs, δL, δaovs, \ valid_2, params, state_out, state_out_2, block - # Probably a little overkill, but why not.. If there are any - # DrJit arrays to be collected by Python's cyclic GC, then - # freeing them may enable loop simplifications in dr.eval(). - gc.collect() - result_grad = film.develop() return result_grad @@ -725,11 +717,6 @@ def splatting_and_backward_gradient_image(value: mi.Spectrum, film.put_block(block) - # Probably a little overkill, but why not.. If there are any - # DrJit arrays to be collected by Python's cyclic GC, then - # freeing them may enable loop simplifications in dr.eval(). - gc.collect() - image = film.develop() dr.set_grad(image, grad_in) @@ -790,7 +777,6 @@ def splatting_and_backward_gradient_image(value: mi.Spectrum, del L_2, valid_2, aovs_2, state_out, state_out_2, \ δL, δaovs, ray, weight, pos, sampler - gc.collect() # Run kernel representing side effects of the above dr.eval() diff --git a/src/python/python/ad/projective.py b/src/python/python/ad/projective.py index 1b8397291..a2bf8b96d 100644 --- a/src/python/python/ad/projective.py +++ b/src/python/python/ad/projective.py @@ -269,12 +269,6 @@ def init_indirect_silhouette(self, elif parent.guiding == 'octree': self.init_indirect_silhouette_octree(scene, sensor, seed) - # After cleaning up, only necessary guiding distribution storage should - # exist in the device memory. This usually occupies dozens of MBs for - # octree, and ~0.75GB for grid based guiding with default settings. - gc.collect() - gc.collect() - # TODO this should happen automatically @dr.syntax def init_indirect_silhouette_grid_unif(self, scene, sensor, seed):