You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thread 'autograd::tests::test_add_grad_decreasing_idx' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/tinyvec-1.6.0/src/arrayvec.rs:681:26:
index out of bounds: the len is 0 but the index is 0
stack backtrace:
..
3: tinyvec::arrayvec::ArrayVec<A>::remove
at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/tinyvec-1.6.0/src/arrayvec.rs:681:26
4: luminal::shape::tracker::ShapeTracker::remove_dim
at /workspaces/coursera-deep-learning-specialization/luminal_original/src/shape/tracker.rs:58:21
5: luminal_training::autograd::add_grad
at ./src/autograd.rs:208:13
6: <luminal_training::autograd::Autograd as luminal::compiler_utils::Compiler>::compile
at ./src/autograd.rs:113:21
..
For what I've noticed, the add_grad function may assume that the fwdshape.indexes is always increasing, but in this case, thanks to how the a.permute axes were defined (LAxes3<2, 1, 0>), the indexes may end up decreasing [0, 2, 1] - to note, if the axes were defined as LAxes3<2, 0, 1>, the indexes would not decrease and there would be no error. Since this shape also has two fake axes (the fake is [false, true, true]), at the last axis iteration, the previous fake axis removal changes the axes length, and so the last iteration goes out of bounds.
I'm not sure how to solve this as I'm still learning how the shapes works in overall, but I'll try to experiment more.
I've also linked a PR which shows the example and error.
The text was updated successfully, but these errors were encountered:
Hi, I've found a runtime error and made this minimized example:
The error:
For what I've noticed, the
add_grad
function may assume that thefwd
shape.indexes
is always increasing, but in this case, thanks to how thea.permute
axes were defined (LAxes3<2, 1, 0>
), the indexes may end up decreasing[0, 2, 1]
- to note, if the axes were defined asLAxes3<2, 0, 1>
, the indexes would not decrease and there would be no error. Since this shape also has two fake axes (the fake is[false, true, true]
), at the last axis iteration, the previous fake axis removal changes the axes length, and so the last iteration goes out of bounds.Relevant code section:
luminal/crates/luminal_training/src/autograd.rs
Lines 202 to 211 in f61d53f
I'm not sure how to solve this as I'm still learning how the shapes works in overall, but I'll try to experiment more.
I've also linked a PR which shows the example and error.
The text was updated successfully, but these errors were encountered: