-
Notifications
You must be signed in to change notification settings - Fork 73
Minor cleanup to Communicator #5750
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
base: main
Are you sure you want to change the base?
Conversation
|
!test |
Description
|
| Relevant files | |||||
|---|---|---|---|---|---|
| Enhancement |
|
PR Reviewer Guide
Here are some key observations to aid the review process:
| 🧪 No relevant tests |
| 🔒 No security concerns identified |
| ⚡ Recommended focus areas for review |
Functional Logic Change
|
Greptile SummaryThis PR performs minor cleanup to the Communicator and evaluator code:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant HostIrEvaluator as HostIrEvaluator<br/>Constructor
participant Validate as validate()
participant Communicator as Communicator
User->>HostIrEvaluator: Initialize with<br/>communicator_
HostIrEvaluator->>HostIrEvaluator: Set my_local_device_index_<br/>(now: explicit nullptr check)
HostIrEvaluator->>HostIrEvaluator: Set device_index<br/>(now: no is_available check<br/>still safe)
HostIrEvaluator->>Validate: Call validate()
Validate->>Validate: Check GPU count
alt Multi-GPU Scenario
Validate->>Communicator: Check is_available()
Communicator-->>Validate: Return availability status
Validate->>Validate: Validate world size and<br/>local size
else Single GPU
Validate->>Validate: Return early
end
Validate-->>HostIrEvaluator: Validation complete
HostIrEvaluator-->>User: Constructor complete
|
| (communicator_ != nullptr && communicator_->is_available()) | ||
| ? communicator_->deviceId() | ||
| : 0; | ||
| communicator_ == nullptr ? 0 : communicator_->deviceId(); |
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.
deviceId() returns 0 when the communicator isn't available:
Fuser/csrc/multidevice/communicator.cpp
Line 179 in d395676
| rank_(0), |
No description provided.