Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CollectiveTrace

A profiling tool that identifies which CUDA kernels are blocking NCCL collectives during distributed training.

Problem

Existing tools (PyTorch Profiler, Nsight Systems, ncclsee) don't correlate kernel-level SM activity with collective communication timing.

Architecture

  • Rust: trace parsing and timeline alignment
  • Python: analysis and visualization

Setup

pip install maturin
maturin develop --release

This builds the Rust extension and installs the collectivetrace Python package into your active environment. Use --release, the debug build is noticeably slower than pure Python on anything but tiny files.

Generate a test fixture

python fixtures/generate_fixture.py

Writes fixtures/sample_trace.json, a synthetic 50k-event trace. This is not a real Kineto trace, it exists to exercise the parser and the benchmark before real GPU-generated traces are available.

Tests

Rust:

cargo test

Python (requires the extension to be built first):

python -m pytest python/tests/

Benchmarks

Pure Rust, no Python overhead:

cargo bench

Rust extension called from Python vs. a pure Python equivalent, same fixture:

python python/benchmarks/bench_vs_python.py

Layout

src/parser.rs           trace parsing logic, no Python dependency
src/lib.rs               PyO3 bindings around parser.rs
tests/parse_test.rs      Rust tests
benches/parse_bench.rs   Rust-only timing benchmark
python/collectivetrace/  Python package wrapping the compiled extension
python/tests/            Python tests
python/benchmarks/       Python vs Rust benchmark
fixtures/                fixture generator and generated trace files

Related Works

About

Profiles which CUDA kernels are blocking NCCL collectives during distributed training + inference

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages