-
Notifications
You must be signed in to change notification settings - Fork 5.9k
improve dist.all_gather to support 0-size tensor all gather #77152
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
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
|
/re-run all-failed |
| def all_gather_object( | ||
| object_list: list[_T], obj: _T, group: Group = None | ||
| ) -> None: | ||
| def all_gather_object(object_list: list, obj, group: Group = None) -> 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.
怎么能直接删掉类型呢?公开 API 必须添加类型
| >>> dist.init_parallel_env() | ||
| >>> object_list = [] # type: ignore | ||
| >>> object_list = [None for _ in dist.get_world_size()] # type: ignore |
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.
| >>> object_list = [None for _ in dist.get_world_size()] # type: ignore | |
| >>> object_list = [None for _ in range(dist.get_world_size())] # type: ignore |
明显的错误,类型提示都检查出来了
|
改好了 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #77152 +/- ##
===========================================
Coverage ? 100.00%
===========================================
Files ? 2
Lines ? 14
Branches ? 0
===========================================
Hits ? 14
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/re-run all-failed |
ForFishes
left a comment
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
PR Category
Communication Library
PR Types
New features
Description
Now dist.all_gather supports 0-size tensor, not raise a bug.
pcard-73145