Skip to content

[Train] Add user-guide for the NCCL hang detector - #67068

Merged
pseudo-rnd-thoughts merged 2 commits into
ray-project:masterfrom
pseudo-rnd-thoughts:hang-detector/user-guide
Oct 16, 2026
Merged

pseudo-rnd-thoughts merged 2 commits into
ray-project:masterfrom
pseudo-rnd-thoughts:hang-detector/user-guide

Conversation

@pseudo-rnd-thoughts

Copy link
Copy Markdown
Member

Description

This PR adds a user-guide for the NCCL hang detector describing how to enable it, the diagnostic tools available and how to understand the diagnostics

@pseudo-rnd-thoughts
pseudo-rnd-thoughts requested review from a team as code owners October 15, 2026 12:06
@pseudo-rnd-thoughts pseudo-rnd-thoughts added docs An issue or change related to documentation train Ray Train Related Issue labels Oct 15, 2026

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

Copy link
Copy Markdown
Contributor

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 documentation and code examples for the new NCCL hang detection feature in Ray Train, including a comprehensive user guide, API references, and configuration examples. The review feedback highlights two potentially incorrect documentation references (train-worker-fault-tolerance and persistent-storage-guide) that should be updated to train-fault-tolerance and train-persistent-storage respectively to prevent broken links and ensure consistency.

@pseudo-rnd-thoughts pseudo-rnd-thoughts added the go add ONLY when ready to merge, run all tests label Oct 15, 2026

@dstrodtman dstrodtman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Docs-side style review from Douglas Strodtman on the Anyscale docs team. Claude Code assisted with this review. I've read every comment and stand behind it.

Scope: style, grammar, and Ray docs conventions only, checked against the Ray documentation style guide. I didn't review the technical content, including the version notes, defaults, and detector behavior. I spot-checked the env var names and defaults in the configuration table against python/ray/train/v2/_internal/constants.py and callbacks/nccl_ras.py, and they match.

This page is in good shape. The suggestions are mostly mechanical: a semicolon and some wills, two headings to phrase as questions, bold on full sentences and inline code, and a pros and cons list folded into prose. All are click-to-accept and leave the claims unchanged.

On the two Gemini link suggestions: please don't accept either one. Both original labels exist on master. train-persistent-storage doesn't exist, so that suggestion would break the docs build. Details are in my replies on those threads.

Approving from the docs side. The suggestions are polish, so apply the ones you agree with.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Mark Towers <[email protected]>
@pseudo-rnd-thoughts
pseudo-rnd-thoughts merged commit 3dcf7b9 into ray-project:master Oct 16, 2026
6 checks passed
pseudo-rnd-thoughts pushed a commit that referenced this pull request Nov 4, 2026
…mp (#67795)

## Problem

- py-spy is refused on many workers because ptrace is restricted in
containers. Every Anyscale worker is one of them (empty `CapEff`, Yama
`ptrace_scope` 1).
- The Python-only fallback is therefore the dump users actually see.
- It labels each thread with its numeric ident only. The reader has to
infer from the frames which one is Ray Train's
`TrainingThread(train_func)`, which is the `MonitoringThread`, and which
is the actor main thread.
- Current output, from a hung Ray Train worker on Anyscale:

```
# Thread 137667459151424
  File "/usr/lib/python3.12/threading.py", line 1030, in _bootstrap
    self._bootstrap_inner()
```

## Change

- `dump_stack_trace` looks up thread names once through
`threading.enumerate()` and prints the name next to the ident.
- The rest of the dump is unchanged.

```
before:  # Thread 137667459151424
after:   # Thread 137667459151424 (TrainingThread(train_func))
```

## Decisions to confirm

- Threads that are not in `threading.enumerate()` (threads not started
through `threading`, for example C-created ones) are labelled `unknown`.

## Related

- Detector PRs by @pseudo-rnd-thoughts: #64928, #66203, #66629, #66627.
- #67794 (sudo retry for py-spy) touches the same function but not these
lines. The two apply independently.

Duplicate-work check: `gh pr list -R ray-project/ray --search "nccl_ras
OR hang detector"` and a search for "thread name" with "nccl_ras" found
no PR making this change (only the Grafana and user-guide PRs #66958,
#66810, #67068 and the sibling #67794).

Test: `python -m pytest
python/ray/train/v2/tests/test_nccl_ras_callback.py -v` passes, 117
tests. `pre-commit run --files` on both files passes.

AI assistance (Claude Code) was used for this PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Marwan Sarieddine <[email protected]>
Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs An issue or change related to documentation go add ONLY when ready to merge, run all tests train Ray Train Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants