-
Notifications
You must be signed in to change notification settings - Fork 15
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
Potential pytorch incompatibility #37
Comments
Mmmmm this is a good point - I can see it being an issue if someone uses newer features of pytorch in their model, but then implements FTorch linked to an older version of LibTorch without those features. I can't immediately think of an easy way around this other than recommending that users ensure that their LibTorch version is at least as new as the one their model was built with. I don't think we need to change anything code-wise, but it would be interesting to know what the error raised would be so that we can recognise this in future should users come across it. |
In terms of LibTorch, I don't think users can go too far back, as I get errors when trying to build FTorch of the form:
when running For versions between 1.8 and 1.10, I can build FTorch successfully, but encounter errors when going through the example of the form:
I think versions 1.11+ work ok all the way through. (This is testing against torch==2.0.1 installed with pip, python 3.9.18) |
Interesting. The first error is cuda related which suggests that torch is trying to use some GPU routines somewhere, and you used the CPU only binary(?). Perhaps this is just an out of date issue and we require libtorch >= 1.8 On the latter, the advice here seems to be 'use the latest' -_- Perhaps most relevant suggests it may be an issue when saving the model to TorchScript with one version of LibTorch, and then running from Fortran with another. This is something that could definitely be tested and would be useful to know - if so it would need going into a readme and perhaps mean the 'preferred' approach is to link FTorch to a venv-installed LibTorch. |
This came up when I was doing work that led to #100 It should be documented somewhere that we should have libtorch and pytorch versions matching. |
This should be added to the troubleshooting and/or FAQ documentation. |
After discussion with @TomMelt we should put a note in troubleshooting to ask users to use consistent versions, or point them to where to examine this if they have issues. We will tackle this as a small issue in an upcoming hackathon. |
This is not an issue I've encountered, but having followed the FTorch build instructions, the version of libtorch/pytorch installed may mean that FTorch is incompatible with the model saved in the examples, as this pip installs torch in a (new) virtual environment.
This would only lead to errors if breaking changes were made to the TorchScript format between the versions, and in many cases the same pip-installed torch would be used anyway.
The text was updated successfully, but these errors were encountered: