Skip to content
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

Refactor launch for greater extensibility #1123

Merged
merged 4 commits into from
Mar 1, 2023

Conversation

Yard1
Copy link
Contributor

@Yard1 Yard1 commented Feb 27, 2023

This PR refactors commands.launch to break up the logic into smaller functions, allowing for the environment preparation logic and actual launch logic to be decoupled. Therefore, a developer can now prepare an environment dict (and command list, where applicable) without having to launch any processes.

There have been no changes to the logic - this is purely a refactor of an existing structure.

As discussed offline, this will unblock Ray Train and other distributed frameworks which launch their own jobs.

Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Feb 27, 2023

The documentation is not available anymore as the PR was closed or merged.

Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your PR! This looks great to me. Mind having a second look @muellerzr ?

Can you just solve the merge conflict @Yard1 ?

Copy link
Collaborator

@muellerzr muellerzr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG2M, great work! Once the merge conflict is fixed we can go ahead and bring it in 🤗

Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
@Yard1
Copy link
Contributor Author

Yard1 commented Mar 1, 2023

@muellerzr Thanks, should be good now!

@@ -23,8 +23,9 @@

from ..commands.config.config_args import SageMakerConfig
from ..commands.config.config_utils import DYNAMO_BACKENDS
from ..utils import DynamoBackend, PrecisionType, is_torch_version, merge_dicts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally it should be imported from ..utils and not using the direct path to .other, following the same mechanism used for all other utils, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That results in a circular import, unfortunately

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, then LGTM.

@muellerzr muellerzr merged commit bdd93cd into huggingface:main Mar 1, 2023
@Yard1 Yard1 deleted the refactor_launch branch March 1, 2023 17:38
@LouisCastricato
Copy link

FYI @natolambert this was the PR that i had mentioned to you ages ago. It'll be useful if you guys plan to do sweeps in TRL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants