nntools icon indicating copy to clipboard operation
nntools copied to clipboard

unroll_scan=True can cause maximum recursion depth error

Open craffel opened this issue 9 years ago • 2 comments

In https://github.com/craffel/lstm_benchmarks, if unroll_scan=True is used on all layers, Python dies when computing the gradient because RuntimeError: maximum recursion depth exceeded while calling a Python object. This shouldn't be terribly surprising; there are going to be a lot of nodes in that graph! But, it would be nice to know ahead of time as I imagine it would be confusing/frustrating to users to get this error when they think they are going to be speeding up their computations.

craffel avatar Jul 23 '15 22:07 craffel

If I increase the maximum recursion depth, it can proceed without an error, but left overnight it still hasn't compiled any functions yet. I think it's worth adding some kind of note about it not being worth it to use unroll_scan when the computational graph is reasonably complex.

craffel avatar Jul 24 '15 16:07 craffel

Same issue here. Might be worthwhile to warn about this in the documentation.

bdhingra avatar Dec 04 '15 17:12 bdhingra