New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[jit] requires_grad in JIT constructor/factories #19393
Comments
I believe it was due to lack of mutability of tensors, and the fact that you will have to update the requires_grad propagation pass appropriately given alias annotations. |
i did the initial implementation of torch.tensor, i can do that |
Another reason for this is the schema for factories doesn't actually include |
Is this still a problem? I tried following code and seems to be working fine by using
Output:
|
@pritamdamania Could you comment if this is still blocking #28786 ? |
@gmagogsfm This is still an issue and the code to repro is:
Note that this only fails when |
Sorry for not being clear enough. What I am really offering is a work-around that seems easy to use, is it sufficient to unblock your issue? |
@gmagogsfm The workaround isn't a great user experience and especially when we use it in the RPC framework to invoke an op remotely:
The workaround would involve multiple RPCs to the same node, one for actually creating the tensor and another for setting the requires_grad field. Another alternative would be to create a custom user function to this and just call RPC on the remote end, but this isn't a great user experience since the user has to create a custom function each time they want to create a Tensor remotely. |
Something like:
fails with:
We also can't do:
I assume this had to do with lack of mutability annotations before? @zdevito are there any other difficulties you could see?
cc @ezyang @gchanan @zou3519 @bdhirsh @jbschlosser @gmagogsfm @suo
The text was updated successfully, but these errors were encountered: