Closed
Description
I am trying to compute full jacobian using jacrev
or jacfwd
from torch.func
. Part of the loss function uses _PointFaceDistance
. Out of the box, pytorch3d
does not support torch.func
. The closest references I can find so far are #1636 and #1533.
The problems I am having are
- With
jacrev
, it throws an exceptionRuntimeError: Cannot access data pointer of Tensor that doesn't have storage
at the line of_C.point_face_dist_backward
.
- I followed "RuntimeError: Cannot access data pointer of Tensor that doesn't have storage" when using autograd with knn #1533 and implementedvmap
for_PointFaceDistance
, butjacrev
still hits the line of_C.point_face_dist_backward
first, so same error. "RuntimeError: Cannot access data pointer of Tensor that doesn't have storage" when using autograd with knn #1533 happened in the forward path, so actually same error but different cause. - with
jacfwd
, it throws an exception of missingjvp
method.
- I don't quite know how to implementjvp
as I have not found much info on what exactly should go in to this function.
The only working method is to call torch.autograd.functional.jacobian(vectorize=False)
which is very slow. And when turn on vectorize=True
, it runs into the same issues as above.
My questions are:
- is there a plan to officially support
torch.func
? If I can get some guidance frompytorch3d
team, I am happy to collaborate on this. - Any idea how to make this work? Any workarounds?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels