-
Notifications
You must be signed in to change notification settings - Fork 42
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
[NewFeature] Support Patch mechanism #174
Conversation
patch/common.py
Outdated
return repo | ||
|
||
|
||
def crete_tmp_dir(dir_path=None, tmp_str=None): |
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.
is tmp dir needed to be saved for display? Is not, you can use tempfile to manage.
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.
OK ,I will try the tempfile in next commit.
patch/common.py
Outdated
@@ -0,0 +1,95 @@ | |||
import re |
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.
rename this filename as utils.py
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.
Thanks.
patch/patch.py
Outdated
|
||
|
||
def _add_auto_generate_args(): | ||
"""Set input argument.""" |
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.
put the argparse in utils.py
or create a new file argument.py
?
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.
Because the argument is not too much , we didn't create a new utils.py or argument.py.
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.
Put this patch dir into tools. Add a README.md in patch dir, and copy this pr's description to the readme file.
@@ -13,6 +13,7 @@ ray >= 2.9 | |||
matplotlib | |||
py3nvml | |||
graphviz | |||
gitpython |
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.
Is it better to place this tool into file requirements-dev.txt
?
This is a brand-new patch mechanism aimed at helping manufacturers and users better utilize the FlagScale framework for training and inference.
Homogeneous scenarios
Under this mechanism, manufacturers use the tools provided by FlagScale to automatically adapt the code between the base-commit-id and the current-commit-id, generating a compliant patch, automatically commit the code. The sample command is as follows:
If manufacturers or user want to unpatch the code adapted, the sample command is as follows:
If you want to push the patch code, each commit overwrites the previous patch, so there will be only one patch file at a time. Therefore, we recommend using the following command for pushing:
Notice: If you have iterated development based on the same base_commit_id, you may need to resolve conflicts before pushing, because the same patch file has been modified. We recommend using rebase to resolve them.
Heterogeneous scenarios
Heterogeneous scenarios are as simple as homogeneous scenarios. You only need to add the manufacturer's name to the --device-type option. The sample command is as follows:
The input parameters have the same meaning as in homogeneous scenarios. However, it is important to note that the manufacturer's name and base-commit-id must exist in patch/hetero.txt. The format in patch/hetero.txt is as follows:
If manufacturers or user want to unpatch the code adapted. The sample command is as follows: