Skip to content
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

[Train] Improve loggings for Train worker scheduling information #40536

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions python/ray/train/_internal/backend_executor.py
Copy link
Contributor

Choose a reason for hiding this comment

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

@scottsun94 can you leave your thoughts? Originally we wanted to keep it succinct but found that it is not sufficient for users to debug certain issues.

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM. Since it only shows up once (unless there are location changes), it's fine to be a bit more verbose.

Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,6 @@ def start(
trial_driver_ip = self._trial_info.driver_ip if self._trial_info else None
self.worker_group.group_workers_by_ip(trial_driver_ip)

worker_locs = [
f"{w.metadata.pid} ({w.metadata.node_ip})"
for w in self.worker_group.workers
]
logger.info(f"Starting distributed worker processes: {worker_locs}")

try:
if initialization_hook:
self._initialization_hook = initialization_hook
Expand Down Expand Up @@ -429,6 +423,16 @@ def _create_rank_world_size_mappings(self) -> List[Dict]:
node_ip = worker.metadata.node_ip
local_world_size_map[world_rank] = ip_dict[node_ip]

workers_info = "\n".join(
[
f"- (ip={w.metadata.node_ip}, pid={w.metadata.pid}) "
f"world_rank={i}, local_rank={local_rank_map[i]}, "
f"node_rank={node_rank_map[i]}"
for i, w in enumerate(self.worker_group.workers)
]
)
logger.info(f"Started distributed worker processes: \n{workers_info}")

return local_rank_map, local_world_size_map, node_rank_map

def start_training(
Expand Down
Loading