Repository navigation
support tp>1 #241
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
support tp>1 #241
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,7 +55,8 @@ def retry(self, ft_request: FaultToleranceRequest): | |
| if self.dp_size > 1: | ||
| old_cpu_group = get_dp_group().cpu_group | ||
| stateless_destroy_torch_distributed_process_group(old_cpu_group) | ||
| port = params["new_stateless_dp_group_port"] | ||
| world_size = self.worker.parallel_config.world_size | ||
| port = params["new_stateless_dp_group_ports"][self.worker.rank % world_size] | ||
|
Comment on lines
+58
to
+59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using world_size = self.worker.parallel_config.world_size
num_workers_per_dp_rank = world_size // self.dp_size
port = params["new_stateless_dp_group_ports"][self.worker.rank % num_workers_per_dp_rank] |
||
| get_dp_group().cpu_group = stateless_init_torch_distributed_process_group( | ||
| self.data_parallel_master_ip, | ||
| port, | ||
|
|
||
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.
Generating
world_sizeports is redundant and incorrect. In a multi-TP/PP setup, the data parallel group is formed by ranks that share the same TP/PP/PCP indices. Therefore, there areworld_size // data_parallel_sizeindependent DP groups, and we only need one port per DP group. Generatingworld_sizeports and indexing them byself.worker.rankwill cause different ranks in the same DP group to use different ports, preventing them from connecting and causing initialization to hang.