shader-slang / slang

Making it easier to work with shaders
MIT License
1.78k stars 159 forks source link

Investigate slow-down in reverse-mode with nested loops in Bezier curves PR #4020

Closed saipraveenb25 closed 1 month ago

saipraveenb25 commented 2 months ago

There appears to be some slow-down when using reverse-mode with multiple nested loops. See bezier_curvefit.py in slang-torch PR#1.

Filing this in the main repository because its most likely an issue with recompute/checkpoint policy creating unnecessary intemediates.

saipraveenb25 commented 1 month ago

No compiler changes needed. Fixed by updating user code to take advantage of recomputation. See for more details: https://github.com/shader-slang/slang-torch/pull/6