Generate special clear error messages for known common misuses in TorchScript #58122
Comments
If any OSS contributors are interested in taking this on as a way to learn about our codebase, I can be your point of contact. Please email me at ansley@fb.com with any questions I'll leave this up for 30 days, after which point I'll fix the errors myself |
I am new to Pytorch and really want to understand the codebase, can I take up this issue and tell me where to start ? @ansley @gmagogsfm |
@venkateshtata Yes, absolutely! Go ahead and pick one of the three issues listed above to start with. (I think it will be easier to start with one than to try to get all three done at once.) I can help you figure out where to start and answer any questions you might have |
Okay @ansley, Thank you. |
Hey @ansley, I would like to work on one of them. I have a basic knowledge of PyTorch and want to contribute to OSS. |
@Gilf641 Same deal, pick one and I'll help answer any questions you might have! Thanks in advance for contributing |
I'm really excited that we've had so much interest in these issues (thank you, OSS community!). We have three separate problems, so I think we can have three separate people contribute. The issues will be first come, first serve. If you scroll down in the comments on this post and don't see anyone who's volunteered to take the issue, it's yours! Of course, please make sure to leave your own comment so that we all know who's working on what. Don't hesitate to reach out to me at ansley@fb.com with any questions. |
hey @ansley, I'd like to take up the second issue concerning |
Hey @ansley, I'll take up the third issue, related to registering new buffers. |
@ansley
We get this Error Should I change the error message as |
@gmagogsfm will be posting some repros to make this easier for you to start with |
@ansley I would like to work on the second issue if it is already not fixed |
Hey @mzainuddin51 , I'm actually working on the second issue. Just need some help from @ansley and @gmagogsfm. |
Hey @ansley, I have gone through the Torchscript part, understood how it's being used. Now I need some directions to solve the third issue. Can you guide me on this? Thank You! |
There are some common misuse patterns in TorchScript that we should issue clear error messages for instead of generating generic error that doesn't capture root cause of error.
Here are a few examples:
nn.Module
inside TorchScript. This currently errors out because TorchScript would attempt to compile__init__()
method of module, which usually contains a call tosuper()
, which isn't supported. Instead, TS should really recognize that a call to constructor ofnn.Module
is the real problem.torch.*
components that are not scriptable. For example,torch.distributions
currently is not scriptable. If TS sees a call intotorch.distributions
methods, it should warn users about it and prompt them to usejit.trace
instead.nn.Module
. We should also give a better error message here.cc @gmagogsfm
The text was updated successfully, but these errors were encountered: