-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binary not operator causes crash when Jit module is executed on different device #17970
Comments
Thanks for the report! we are looking into this |
@eellison i'll take a look! |
We recommend tracing for CPU and GPU and keeping both versions:
https://pytorch.org/docs/master/jit.html#frequently-asked-questions
|
Thanks for tracing the issue. Is this something that might be fixed in the future or is it a more fundamental issue? Our specific use-case is, that we train a model on GPU with pytorch and would then like to deploy it on robots using libtorch. The latter we achieve through JIT tracing, as suggested in the docs. The problem is, that we don't know a priori whether a GPU is installed or not, so we need to be compatible to both CPU and GPU. Shipping and maintaining two copies of the same model is not ideal for this. |
@lorenwel would it be possible for you guys to convert your model to TorchScript with @suo Michael could you please weigh in on this question?
|
We can probably fix this particular case when tracing, but you shouldn't expect |
Alright, thank you both. I guess we can close this issue then, since the JIT tracing behavior is described in the FAQ link you posted? |
馃悰 Bug
When the binary not operator
~
is used in a module, which is then Jit traced, it causes a crash when the resulting Jit module is moved to and executed on a different device type (e.g. CPU -> GPU).This crash only occurs in the Jit module, but not in eager mode.
Using
1-tensor
to negate the ByteTensor does not show the same issue in Jit.To Reproduce
The error console output is:
Expected behavior
It should not crash.
Environment
Please copy and paste the output from our
[environment collection script]:
python setup.py install
Additional context
The same issue also occurs when loading the failing jit module into libtorch and executing it there.
cc @suo
The text was updated successfully, but these errors were encountered: