pytorch / functorch

functorch is JAX-like composable function transforms for PyTorch.
https://pytorch.org/functorch/
BSD 3-Clause "New" or "Revised" License
1.38k stars 102 forks source link

wrapper->level().value() <= current_level INTERNAL ASSERT FAILED at "../aten/src/ATen/functorch/ADInterpreters.cpp":39 #1131

Open ElegantLin opened 1 year ago

ElegantLin commented 1 year ago

I met this issue when I use jacrev function to calculate the Jacobian matrix using a VisionTransformer. The exception occurs when I move the VisionTransformer to GPU.

RuntimeError('wrapper->level().value() <= current_level INTERNAL ASSERT FAILED at "../aten/src/ATen/functorch/ADInterpreters.cpp":39, please report a bug to PyTorch. escaped?') special variables: function variables: args: ('wrapper->level().val.... escaped?',) special variables: function variables: 0: 'wrapper->level().value() <= current_level INTERNAL ASSERT FAILED at "../aten/src/ATen/functorch/ADInterpreters.cpp":39, please report a bug to PyTorch. escaped?' len(): 1

Could you please help me with this?

Thanks!

zou3519 commented 1 year ago

Do you have a script we could use to reproduce the problem?