some accelerator enhancements
See original GitHub issueHi,
My main code base have been switched to be based on accelerate for a while, it works grate! Thank you guys so much!
There are a few things I think it’s a common need.
The first is .distsibuted
attributes, which is basically .num_processes > 1
. I mean, it’s not a lot of works but … I’m an extremely lazy person.
def distsibuted(self):
"""
Runs in distributed mode
"""
return self.num_processes > 1
Besides, these two decorators are often used in my code when saving models and downloading datasets, I think it could be useful.
def on_main_process(func):
"""
Run func on main process
"""
@wraps(func)
def wrapper(self, *args, **kwargs):
if self.is_main_process or not self.distributed:
return func(self, *args, **kwargs)
return wrapper
def on_local_main_process(func):
"""
Run func on local main process
"""
@wraps(func)
def wrapper(self, *args, **kwargs):
if self.is_local_main_process or not self.distributed:
return func(self, *args, **kwargs)
return wrapper
Issue Analytics
- State:
- Created a year ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
How To Increase Throttle Response - Best 2022 Upgrade
Some people have the misconception that throttle response is a car's engine or air volume. This is not true, and I'm going to...
Read more >Accelerators Allow Experts to Increase Efficiency
Any system that will be repeatedly used should cater to both new users and ... Because accelerators are enhancements to the interface, ...
Read more >A Power Efficiency Enhancements of a Multi-Bit Accelerator for ...
A Power Efficiency Enhancements of a Multi-Bit Accelerator for Memory ... part without any further training on the original network.
Read more >Data enhancements in education accelerator
Version 4 of the education accelerator features enhanced data model ... with the education accelerator are available to any Microsoft Power ...
Read more >Accelerator New Features and Enhancements
You can now add comments to any guide or article page. To provide feedback and suggestions, log in with your Informatica credentials. Then,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t mind having wrappers on the Accelerator for those. As long as the naming is clear, it’s not a bad thing to have multiple properties/methods/context managers for different use cases 😃
I believe everything has been merged now, so I’m gonna close this issue.
Thanks again for this grate work!