Skip to content

feat(issue4): bitwise determinism diagnostic tool for NCCL collectives - #17

Open
xyaohubery wants to merge 1 commit into
Tencent:mainfrom
xyaohubery:feat/issue4-bitwise-determinism-checker
Open

feat(issue4): bitwise determinism diagnostic tool for NCCL collectives#17
xyaohubery wants to merge 1 commit into
Tencent:mainfrom
xyaohubery:feat/issue4-bitwise-determinism-checker

Conversation

@xyaohubery

Copy link
Copy Markdown

Summary

Diagnostic tool for detecting and localizing non-determinism in NCCL collective operations, addressing Issue #4.

Problem

Two identical training runs can diverge bitwise due to floating-point non-associativity in collective reductions (ring vs tree vs PAT algorithms, topology changes). This tool pinpoints the exact call and algorithm that introduces divergence.

What's Included

  • bitwise_determinism_checker.py: Core engine with simulated Ring/Tree/PAT/NVLS algorithms, bitwise comparison framework, algorithm sweep, and actionable recommendations
  • nccl_config_injector.py: NCCL config sweep, topology pinning, and torch.distributed integration

Usage

# Single-op diagnostic
python bitwise_determinism_checker.py --op allreduce --size 1M --runs 10

# Sweep across all algorithms
python bitwise_determinism_checker.py --sweep-algos --op allreduce --size 128M

# Full diagnostic suite
python bitwise_determinism_checker.py --full-suite --output report.json

Key Findings

  • Ring + Simple: Deterministic (fixed rank order) — recommended for internode
  • NVLS: Deterministic (hardware tree) — recommended for intranode with NVSwitch
  • PAT: Potentially non-deterministic (atomic operations in shared memory)
  • Tree: Non-deterministic without topology pinning (dynamic parent selection)

🤖 Generated with Claude Code

…tives

Tool for detecting non-determinism in collective operations (AllReduce,
Reduce-Scatter) via repeated runs with bitwise comparison.

Includes:
- bitwise_determinism_checker.py: Core engine with simulated Ring/Tree/
  PAT/NVLS algorithms and bitwise comparison framework
- nccl_config_injector.py: NCCL config sweep + topology pinning helper
- Supports both simulation mode (numpy) and GPU mode (torch.distributed)
- Algorithm sweep to identify which NCCL_ALGO configs cause divergence
- Recommendations for deterministic collective configurations

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant