Repository navigation
[train] Add log line before launching training function - #62911
Conversation
## Why are these changes needed? There is currently no log signal indicating when `train_func()` is about to be invoked on a worker. The last framework-emitted log line before the user's training function runs is "Setting up process group..." from `_setup_torch_process_group`, which happens *before* `init_process_group()` completes — a potentially long collective barrier. This makes it impossible to distinguish (from logs alone) whether a worker is stuck at `init_process_group` or has entered the user's training function but hasn't logged yet. This one-line change adds an INFO log right before the training thread is started, providing a clear marker that the training function is about to execute. Signed-off-by: YQ <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request adds a log message to signal the launch of the training function in the Ray Train worker. The review feedback suggests enhancing this log by including the worker's rank to improve observability in distributed environments and notes that the newly added blank lines contain trailing whitespace which should be removed.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: YQ <[email protected]>
Signed-off-by: YQ <[email protected]>
|
This pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
Signed-off-by: Mark Towers <[email protected]>
pseudo-rnd-thoughts
left a comment
There was a problem hiding this comment.
Thanks for the PR, I agree with the intention. I've just changed this to debug to minimise logs as I suspect this is a debug level only piece of information.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 0bacc0c. Configure here.
| # Create and start the training thread. | ||
| logger.debug( | ||
| f"Rank {get_train_context().get_world_rank()}: Launching training function." | ||
| ) |
There was a problem hiding this comment.
Log level is debug instead of intended info
Medium Severity
The PR description states this change "adds an INFO log" to provide a clear console-visible marker before launching the training function, but logger.debug is used instead of logger.info. The console handler applies TrainLogLevelFilter which defaults to INFO level, so this DEBUG message won't appear in console output — only in the system log file. Since the "Setting up process group" message it's meant to pair with uses logger.info (for rank 0), this message is effectively invisible in the primary debugging surface, defeating the stated purpose of the change.
Reviewed by Cursor Bugbot for commit 0bacc0c. Configure here.
…62911) ## Why are these changes needed? There is currently no log signal indicating when `train_func()` is about to be invoked on a worker. The last framework-emitted log line before the user's training function runs is "Setting up process group..." from `_setup_torch_process_group`, which happens *before* `init_process_group()` completes — a potentially long collective barrier. This makes it impossible to distinguish (from logs alone) whether a worker is stuck at `init_process_group` or has entered the user's training function but hasn't logged yet. This one-line change adds an INFO log right before the training thread is started, providing a clear marker that the training function is about to execute. --------- Signed-off-by: YQ <[email protected]> Signed-off-by: Mark Towers <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Mark Towers <[email protected]>
…62911) ## Why are these changes needed? There is currently no log signal indicating when `train_func()` is about to be invoked on a worker. The last framework-emitted log line before the user's training function runs is "Setting up process group..." from `_setup_torch_process_group`, which happens *before* `init_process_group()` completes — a potentially long collective barrier. This makes it impossible to distinguish (from logs alone) whether a worker is stuck at `init_process_group` or has entered the user's training function but hasn't logged yet. This one-line change adds an INFO log right before the training thread is started, providing a clear marker that the training function is about to execute. --------- Signed-off-by: YQ <[email protected]> Signed-off-by: Mark Towers <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Mark Towers <[email protected]> Signed-off-by: Alexandr Plashchinsky <[email protected]>


Why are these changes needed?
There is currently no log signal indicating when
train_func()is about to be invoked on a worker. The last framework-emitted log line before the user's training function runs is "Setting up process group..." from_setup_torch_process_group, which happens beforeinit_process_group()completes — a potentially long collective barrier.This makes it impossible to distinguish (from logs alone) whether a worker is stuck at
init_process_groupor has entered the user's training function but hasn't logged yet.This one-line change adds an INFO log right before the training thread is started, providing a clear marker that the training function is about to execute.