feat: otel duration gap additions#4
Closed
sputti-czi wants to merge 3 commits into
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add three OTel metric instruments: recv-direction edge latency, collective duration, inter-collective gap
Summary
This PR extends CoMMA's OTel metrics path with three new Base2-exponential-histogram instruments that fold, at the source, the per-operation signals needed for communication-graph straggler analysis — so they arrive as bounded-cardinality metric aggregates rather than per-event traces:
nccl.net_recv.latency{nccl.communicator.hash, nccl.source.rank, nccl.destination.rank, nccl.hostname}net_send.latencya→b, giving both-endpoint observations of every edge.nccl.collective.duration{nccl.comm.hash, nccl.collective.name, nccl.size.class, nccl.rank, nccl.hostname}nccl.collective.gap{nccl.hostname, nccl.pid}Together with the existing
nccl.net_send.latencyandnccl.collective.seq_num, these make source-vs-victim attribution possible from metrics alone: send+recv edge histograms give a walkable directed graph (including the internal ring/tree traffic of collectives, which the span path does not expose as edges), and duration/gap give the compute-side corroboration.Also fixed (pre-existing bugs found while validating)
num_activeover-count inHistogramManager::update_priority— the active-set counter drifted upward across grouping intervals, prematurely exhausting the high-fidelity cardinality budget.dur_nswraparound instep_tracker— step durations above ~4.29 s wrapped; they now saturate, so long/stalled steps record as the ceiling instead of a small bogus value.Design notes
GapTrackeruses a single packedAtomicU64(low 32 bits: in-flight activity windows; high 32: total begins) plus an idle-since timestamp withfetch_maxstamping — lock-free, two atomics per activity begin/end, and a concurrent 0→1 observer can never read a stale idle timestamp from a previous idle period.NCCL_PROFILER_OTEL_ENABLE(defaultfalse); recv-side recording additionally respects the existingtrack_recv_stepsandp2p_recv_sample_rateknobs. With defaults, this PR changes nothing at runtime.HistogramManagerTop-K /otel_metrics_max_cardinalitygovernance asnet_send.latency;collective.durationis bounded by ranks × size classes × collective names;collective.gapis one series per process. Overflow behavior (aggregated fallback keyed by hostname) is unchanged.copybara:strip(otel)conventions.Validation (real hardware)
Two 8-node × 8×H100 (64-GPU) 3-hour runs (FSDP2 workload, ring/SIMPLE), identical except the profiler configuration:
docs/otel-support.md.Micro-benchmarks (
benches/otel_utils.rs, criterion)Hot-path record costs for all three instruments plus the gap tracker's idle transition and nested-activity paths (
net_send/net_recv latency record,collective duration record,gap idle transition,gap nested activity) — provided so the per-op overhead claim is reproducible and guarded against regression.Files
src/otel_utils.rs—DurationHistogram,GapTracker, recv re-keying in the latency histogram managersrc/cloud_daemon.rs— recv latency manager wiring; duration/gap recording on the completion pathsrc/profiler.rs— activity-window hooks for the gap tracker;num_activefixsrc/step_tracker.rs— u32 saturation fixsrc/lib.rs,Cargo.toml— module/bench registration (copybara-marked)benches/otel_utils.rs— criterion micro-benchmarksdocs/otel-support.md— documents the three instruments, their attribute keying, gating, and the send/recv asymmetry