Generate replicas when fitting models in parallel#1261
Merged
scarrazza merged 6 commits intoJun 23, 2021
Conversation
|
Greetings from your nice fit 🤖 !
Check the report carefully, and please buy me a ☕ , or better, a GPU 😉! |
Member
Author
|
Perfect also for full fits https://vp.nnpdf.science/h2_Zz2ySRU6BnqaOjgGiOg==/ (done all 100 replicas in ~3.5 hours in 2 GPUs, so about 5 minutes per replica per GPU, 11-12GB of memory each.) |
Member
|
I have had a look into this and have been playing with it and did not notice any issues. On a single rtx 2060 with 6 GB of memory, it took about 10 hrs to perform the exact same fits, and the results are exactly the same as @scarlehoff reported. The changes LGTM and the comments I added both here and in #1251 are very minor (nothing conceptual). |
99000fb to
67a22b2
Compare
a510d7c to
b6426c9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As the title says, this enables using
genrep=Truewhen fitting models in parallel.Since we already have the mechanism for generating more than one replica (with the replica range) I've changed the
parallel_models: inttoparallel_models: booland the replicas are given with the replica range. In this way running in parallel is the same as running sequentially in terms of seeds and data.The process is:
-r)parallel_models: Truethen all replicas are exactly the same (sametrvl, samefktable, sameinvcovmat)(n_replicas, n_data)instead of(1, n_data))(1, n_data)so that this could be implemented easily and it worked out! :) )For reviewers: this is implemented in the first commit in
n3fit/src/n3fit/model_trainer.py. Most other changes are changes of variable names to use the plural form (likeseed->seeds) plus some typos I found (quite a few inchecks.py)Working on top of PR #1251 (which is smaller than this PR and the changes are even less impactful so please go to that one first)
A draft for now since I'd like to know how reproducible results are between running sequential / parallel / one by one and add that to the docs.