-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Move add_to_queue/get_from_queue to DDPSpawnPlugin #9118
Conversation
for more information, see https://pre-commit.ci
Dear @daniellepintz, Mind sharing why this PR won't be finalised ? I still believe this is important for users to have the ability to access to queue easily to bring anything back if needed like best_score from Model Checkpoint or anything.
Best, |
@tchaton sorry for the lack of communication. My understanding from reading #7671 is that #9126 resolves the problem described, and in a much cleaner way than this PR by deprecating the add_to_q/get_from_q functions. Maybe I am not fully understanding the Optuna issue, is there another place other than #7671 where it is explained? My issue with this PR is that it is a bit messy and complicated - but if it is needed I can reopen and finish it. |
Hey @daniellepintz, Returning callack_metrics should not be enough as for HPO, we are interested by the best value possible and this information is hold by the ModelCheckpoint(s) callbacks. Therefore, we should extend the def objective(trial):
...
trainer = Trainer(accelerator="ddp_spawn", gpus=2, callback=ModelCheckpoint(monitor="val_acc"))
trainer.fit(...)
return trainer.model_checkpoint.best_score IMO, I would prefer to add those hooks to DDPSpawn as I can imagine other use-cases where users might want to bring some information from the spawned processes. Best, |
@tchaton sounds good I will reopen the PR and finish it! |
Hey @daniellepintz. Thanks a lot for your understanding ! We might not have users right now but I have the intuition this simple mechanism to access spawned processes states through the queue might become useful in the future. Optuna was our first real use-case. Best, |
for more information, see https://pre-commit.ci
Codecov Report
@@ Coverage Diff @@
## master #9118 +/- ##
=======================================
- Coverage 93% 89% -4%
=======================================
Files 179 180 +1
Lines 14925 15065 +140
=======================================
- Hits 13866 13373 -493
- Misses 1059 1692 +633 |
Co-authored-by: ananthsub <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ! Thanks.
@daniellepintz Side note, this could be enabled for TPUSpawn too.
@tchaton yes it should work for TPUSpawn as well after this PR |
Co-authored-by: Adrian Wälchli <[email protected]>
for more information, see https://pre-commit.ci
@Borda mind taking a look? |
What does this PR do?
Fixes #8940
Deprecates add_to_queue/get_from_queue from Lightning Module and moves them to DDPSpawnPlugin, since they are relevant specifically to ddp_spawn, and don't need to be on the generic lightning module.
This is part of the initiative to remove trainer reference from Lightning Module #7315.
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃