Skip to content

bugfix: add group_id when creating the HccLProcessGroup to support multiple communication process_group.#999

Open
shan-chen-feng wants to merge 1 commit intojd-opensource:mainfrom
shan-chen-feng:hccl_process_group_bug_fix
Open

bugfix: add group_id when creating the HccLProcessGroup to support multiple communication process_group.#999
shan-chen-feng wants to merge 1 commit intojd-opensource:mainfrom
shan-chen-feng:hccl_process_group_bug_fix

Conversation

@shan-chen-feng
Copy link
Collaborator

…ltiple communication process_group.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a static group_id_ to uniquely identify HccLProcessGroup instances, which is a good approach to prevent naming conflicts. However, the current implementation of the counter is not thread-safe and could lead to race conditions if multiple process groups are created concurrently from different threads. My review includes suggestions to use std::atomic to ensure the thread-safety of the group ID generation, which is a critical fix to prevent potential runtime failures.

@shan-chen-feng shan-chen-feng force-pushed the hccl_process_group_bug_fix branch from 7788d37 to db04471 Compare March 5, 2026 02:50
@yq33victor yq33victor changed the title bugfix: add group_id when creating the HccLProcessGroup to support mu… bugfix: add group_id when creating the HccLProcessGroup to support multiple communication process_group. Mar 5, 2026
// that inidicates the comm name has already exist would occur,
// so for each time when we create a new process group, we should increase
// group_id_ and pass it to c10d_npu::ProcessGroupHCCL::Options
static int32_t group_id_;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't understand the modification. does it means we can not create multiple ProcessGroupHCCL ? How did it work before.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there won’t be explicit error when creating multiple process groups,but when using a second process group with any of the communication operation,the error occurs。 this error was not triggered because only tp process group was used for qwen3next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants