Detect incompatible PyTorch versions by the Elasticsearch
#479 shows that new versions of PyTorch will sometimes be incompatible with older versions. In this case a Torchscript model traced in version 1.12 of PyTorch cannot be evaluated in version 1.11. PyTorch will continue to be upgraded in both the Elastic stack and Eland in order to pick up new features, performance improvements and security fixes, inevitably this means that at some point certain versions of Eland will not work with Elasticsearch.
Currently, a user who has not read the release notes will only discover the incompatibility when they evaluate the model and get an error similar to
Attempted to read a PyTorch file with version 10, but the maximum supported version for reading is 6. Your PyTorch installation may be too old.
We can do a better job of detecting the issue early in the eland_import_hub_model script.
- If the Eland version is >= Elasticsearch version then Eland knows if the PyTorch versions are compatible or not.
- Else if the Eland version is < Elasticsearch version then Eland cannot know if the model it will create is future compatible with Elasticsearch. In which case politely decline to do the work and ask the user to upgrade Eland
This should be done when PyTorch is upgraded to 1.12 or greater.