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

INTERNAL_ASSERT failed #1103

Open Jeff09 opened 1 year ago

Jeff09 commented 1 year ago

RuntimeError: data.find(layerId) == data.end() INTERNAL ASSERT FAILED at "/__w/functorch/functorch/functorch/csrc/DynamicLayer.cpp":251, please report a bug to PyTorch. '

Hi, I have used vmap(jacrev(jac_fn, argnums=0))(*args) to calculate some jacobians, and the above errors appears. Could you help me out? Thank you so much.

zou3519 commented 1 year ago

Could you try the latest PyTorch nightly and let us know if the error goes away? The above code no longer exists in trunk (we refactored it away to fix some problems).

Jeff09 commented 1 year ago

Thank you for replying. Does the latest PyTorch nightly is the same as PyTorch 2.0?

Jeff09 commented 1 year ago

Hi @zou3519 , I have tried PyTorch 1.13.1, it's still the same error.

RuntimeError: data.find(layerId) == data.end() INTERNAL ASSERT FAILED at "../aten/src/ATen/functorch/DynamicLayer.cpp":256, please report a bug to PyTorch.

I can't using PyTorch nightly cause I'm using the library Theseus, which is also from Facebook, which is only support PyTorch 1.13.1, not support PyTorch nightly now. And the bug detail is follows.

image

Any advices is welcome. Thank you so much.

zou3519 commented 1 year ago

Sorry for the delayed reply, I took a long vacation. Is this still a problem? If so, do you have a script that reproduces the problem?