Update to Python 3.9 and PyTorch 2 #420
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Inspired by #203 , I wanted to modernize CellRanger a bit, but with Python 3.9 since it is now the minimum version supported by PyTorch.
The issues with Pyro mentioned in #203 have already been fixed, so the (hopefully) only remaining hurdle is #212. A workaround for the weakref issue was mentioned in #386, but this breaks deserialization. I though I was going to have to extensively refactor the model, but it turns out that this can be fixed by simply using dill instead of pickle. Additionally, some changes to report.py were needed, I think because of changes with pandas and/or numpy.
I increased the version numbers as in #203, but there were several other changes that I was not sure about that I did not include here.
Making these changes, I have all tests passing with Python 3.9 and 3.12 using PyTorch 2.7.1 on an RTX 5060 Ti. It will presumably work on other PyTorch versions >= 2 , but I don't think I can test them with my hardware.