Repository navigation
[Train] Add RAS history to hang detector - #66228
matthewdeng merged 5 commits into
Conversation
Signed-off-by: Mark Towers <[email protected]>
Signed-off-by: Mark Towers <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request enhances the NCCL RAS hang detector in Ray Train by introducing a circular buffer to record a history of ncclras queries and uploading these diagnostics (along with worker stack traces) to the experiment storage directory upon a confirmed hang. It also updates the NCCLHangError message to point users to these diagnostic files and adds comprehensive unit tests. The review feedback correctly identifies a critical discrepancy between the implementation of dump_ras_query_history and its unit tests regarding file naming conventions and empty history handling, providing a code suggestion to resolve the issue.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
Reviewed by Cursor Bugbot for commit 83571fa. Configure here.
Signed-off-by: Mark Towers <[email protected]>
There was a problem hiding this comment.
Thanks! One concern is the memory overhead of keeping a buffer of the nccl ras output. Would be good to test that with a substantial number of ranks, measure that before we merge, and have some results in the PR description. Can we also add tests for the dump_worker_stack_trace function, there is no coverage for it right now.
| _NCCL_RAS_QUERY_TIMEOUT_S: float = 8.0 # the default ncclras -t value is 5 | ||
|
|
||
| # Every diagnostic is uploaded to `<experiment_fs_path>/hang_detector/<tool>/`. | ||
| _DIAGNOSTICS_DIR: str = "hang_detector" |
There was a problem hiding this comment.
nit: this might be better placed in ray/train/v2/_internal/constants.py with CHECKPOINT_MANAGER_SNAPSHOT_FILENAME and VALIDATE_STORAGE_MARKER_FILENAME that also fall into the experiment_fs_path.
Here is a table of the estimated memory usage for a fixed history of 100 polls
zlib will add 5.4ms per poll at 4096 ranks. I would say we keep to the current implementation and look at the zlib implementation if a customer finds this is an issue. |
Signed-off-by: Mark Towers <[email protected]>
## Description The hang detector polls NCCL RAS frequently to check if ranks have different numbers of collectives launched. Currently, we log that data regularly, however, this makes the post-mortem analyses difficult. Therefore, this PR adds a circular buffer for recording a history of the NCCL RAS queries and on confirmation are dumped into the diagnostic folder. To ensure that the history can include RAS queries from before a hang started, the length of the circular buffer is the number of number of polls required for confirmation plus a fixed value. ## Related issues Continuation of ray-project#64928 --------- Signed-off-by: Mark Towers <[email protected]> Co-authored-by: Mark Towers <[email protected]>

Description
The hang detector polls NCCL RAS frequently to check if ranks have different numbers of collectives launched. Currently, we log that data regularly, however, this makes the post-mortem analyses difficult. Therefore, this PR adds a circular buffer for recording a history of the NCCL RAS queries and on confirmation are dumped into the diagnostic folder.
To ensure that the history can include RAS queries from before a hang started, the length of the circular buffer is the number of number of polls required for confirmation plus a fixed value.
Related issues
Continuation of #64928