-
Notifications
You must be signed in to change notification settings - Fork 1k
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 on_main_process decorators #488
Conversation
The documentation is not available anymore as the PR was closed or merged. |
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 for your PR! I think it would be great to have those as methods of the Accelerator
object (your code refers to a `self`` that does not exist otherwise).
Hi @sgugger , sorry for the delay, hope this is better now |
@ZhiyuanChen could you run "make style; make quality" to solve the Quality Check issue? 😃 Thanks! |
Sorry, I thought I have fixed it but somehow didn't pushed... |
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 a lot for iterating! Almost ready to merge, I just left some comments on the docstrings and a suggestion to group the decorators on_process
and on_local_process
together. Let me know your thoughts!
|
||
return wrapper | ||
|
||
def on_process(process_idx): |
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.
def on_process(process_idx): | |
def on_process(process_idx, local=False): |
Maybe we could group this one and the text in one decorator since it's one that takes arguments?
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Thank you very much tor your comments and suggestion. For the docstrings, i have accepted rll suggestions. For the group... I think its rather important to ensure api in a similar organisation, and grouping in this way break the consistency with |
Let's roll with your choice and we'll see what users think then. We can always add aliases in the future :-) Thanks again for your contribution! |
Haha, sure thing~
No worries~ |
#366