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

Unit Test Error When Testing vmap With Missing Module "autograd_function_db" #1098

Open sunmorgan opened 1 year ago

sunmorgan commented 1 year ago

When running pytest test/functorch/test_vmap.py, the error

image

ModuleNotFoundError: No module named 'torch.testing._internal.autograd_function_db'

comes up. This issue is only prevalent with test_vmap.py, all the other unit tests in functorch works just fine.

kshitij12345 commented 1 year ago

autograd_function_db was added fairly recently and should be available only by installing nightlies or building from source. Unfortunately none of the stable release has it.

cc: @zou3519

zou3519 commented 1 year ago

@sunmorgan what are you trying to do?

sunmorgan commented 1 year ago

@zou3519 I tried running

pytest test/functorch/test_vmap.py -v -k "test_op_has_batch_rule_tril" (as well as triu)

and received

ModuleNotFoundError: No module named 'torch.testing._internal.autograd_function_db'

Is the above line the expected error? (built from source)

zou3519 commented 1 year ago

That is not expected, what commit hash are you at? (git log will tell)

sunmorgan commented 1 year ago

13b3d862dd35cef133e09bdbc62ee9891999209f

zou3519 commented 1 year ago

Can you verify that you do not have a PyTorch binary installed in your environment that is interfering? What does import torch; torch.__version__ say?

sunmorgan commented 1 year ago

2.0.0a0+git13b3d86