-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add version hyperparameter to the checkpoints. #288
base: main
Are you sure you want to change the base?
Conversation
Check version when loading a model.
@peastman could you please review this one? |
@stefdoerr I merged #291 here so that it is intertwined with the checkpoint version functionality. |
I've never used versioneer, but from their documentation it looks like it does basically the same thing your code did? When you're doing an official build by cloning the repository it should work, but if you're doing a local build in a repository you've been using for a long time the recent tags will be missing and it will get the version number wrong. The only ways I can see to reliably keep the version number in the code in sync with the tag on github are 1) update it by hand, or 2) have something that runs on github to automatically update the code whenever you create a release. In OpenMM we update the version number by hand, but then check for consistency in the recipe to build conda packages. If we forget to update the version number, the conda build will fail until we fix it. |
I don't understand why it's an issue. If you (htmd) sdoerr@yoga ~/Work/moleculekit main ipython
In [1]: from moleculekit import __version__
In [2]: __version__
Out[2]: '1.8.21+3.g9f6320d' |
It only pulls tags if you specify the
|
Are we on different git versions? For me git pull works fine pulling tags |
This also slipped past me because I use magit, which pulls tags explicitly. What about this? https://github.com/marketplace/actions/auto-release |
Really, I don't see the issue. Git pull pulls the tags fine as I show above. If the issue only happens on forks (?) then make an alias if you want for |
Still, if we make the version depend on the git info, local installs could register things like "v2.5.3+some_hash-dirty" into checkpoints. |
Why would that cause an issue though? It is the exact version of that commit. If you prefer not to have the hash-dirty parse it out in torchmd-net when it does the version checks between ckpt and current version |
Git does not pull tags as I show above! :) I can't explain why it works one way for you and a different way for me. But we clearly can't assume it will. I just checked my local torchmd-net repository on a different computer, and that one has no tags at all. |
Can you check |
On my laptop:
And on a server:
|
Did you perhaps clone the repository from the master torchmd-net repo rather than a personal fork? |
But you are on a fork, correct? So I assume you are also running git fetch upstream? |
Yes I'm not on a fork. On a fork I assume it requires a few more steps to get everything in sync. |
Whenever I want to pull the latest code I do
|
It affects anyone who creates a fork. Possibly this really indicates a deeper issue with this PR: do we really not intend to provide any backward compatibility at all for models? If I train a model and post it for people to use, is it really expected that my model will only work with the exact version of torchmd-net I trained it with and no other? |
About the backwards comp I don't know. The reason I'm arguing against hard-coding versions is that it's a chore and people forget to do their chores. If it takes one more command to fetch tags and it only affects developers I think it's better to not switch to hard-coded versions. Considering it's already two commands to pull from upstream, might as well make it three and throw them into an alias :) |
Its not like we do not want to provide backwards comp. The code in this PR only prints a warning. Some default behaviors might change, some bugs might be fixed or names changed... Its intended to be simply informative. |
I will release version 2.0.0 soon, from which point we will be using semantic versioning, so we can relax the version comparison then. Perhaps not even printing a warning if a checkpoint with 2.1.0 is loaded in any 2.x.y version. |
I want to train a model and post it online for other people to use. Is that supposed to be a supported use case? A few years from now, will people who want to use it be expected to install obsolete versions of torchmd-net and all its dependencies? Will that even be possible? (New GPUs will require new versions of CUDA, which will require new versions of PyTorch.) |
Check version when loading a model.
Print a warning if the checkpoint is loaded with a version different to the one used to create it.
Closes #291