nemo-mbridge-perf-nsys-analysis

Diagnose Megatron Bridge training bottlenecks from Nsight Systems traces using critical-path analysis.

896|481|Updated May 21, 2025
One-click install
npx skills add https://github.com/NVIDIA-NeMo/Megatron-Bridge --skill nemo-mbridge-perf-nsys-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nemo-mbridge-perf-nsys-analysis
Source: https://github.com/NVIDIA-NeMo/Megatron-Bridge/tree/main/skills/nemo-mbridge-perf-nsys-analysis
Command: npx skills add https://github.com/NVIDIA-NeMo/Megatron-Bridge --skill nemo-mbridge-perf-nsys-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Profiling distributed GPU training with Nsight Systems often leads to wrong conclusions: summed kernel time is mistaken for wall time, NCCL duration is mistaken for a bottleneck, and rank 0 is treated as representative. This Skill turns .nsys-rep and exported .sqlite traces into a rigorous critical-path diagnosis with a ranked, evidence-backed optimization plan for Megatron Bridge training runs.

Core Features & Use Cases

  • Critical-path time accounting: Builds per-iteration device budgets using interval unions, splits compute-absent time into launch-starved, blocking, and dependency-stalled buckets, and reconciles every millisecond.
  • Multi-rank and communication analysis: Surveys all captured ranks, separates transfer proxy from jitter wait, distinguishes exposed versus blocking communication, and inventories non-NCCL backends like HybridEP, DeepEP, and NVSHMEM.
  • Evidence-backed gain estimation: Computes recoverable-time ceilings for step time, throughput, and MFU without double counting, and maps proven bottlenecks to follow-up tuning skills (CUDA graphs, TP/DP/MoE communication overlap, CPU offloading, memory tuning).
  • Use Case: Given traces from a PP=8 run where NCCL appears to dominate, use this Skill to prove whether collectives actually block compute, identify the true straggler rank after cross-host clock alignment, and produce a ranked optimization plan with defensible gain ceilings.

Quick Start

Use the nemo-mbridge-perf-nsys-analysis skill to analyze my Megatron Bridge trace file profile.nsys-rep and tell me the dominant bottleneck and ranked optimization opportunities.

Frequently Asked Questions about nemo-mbridge-perf-nsys-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze an Nsight Systems trace for Megatron Bridge training?

Export the .nsys-rep to SQLite with nsys export, establish a steady-state iteration window from a recurring NVTX or collective anchor, then build a per-iteration device budget using interval unions. Attribute compute-absent time and rank opportunities by recoverable critical-path milliseconds.

Why is summed NCCL kernel time not proof of a communication bottleneck?

Summed kernel durations are work volume, not wall time, and exposed communication may overlap compute without delaying it. A bottleneck claim requires dependency-proven blocking communication on the critical path, reported alongside exposed time as an upper bound.

How do I compare Nsight traces across multiple ranks or hosts?

Rebase each export using TARGET_INFO_SESSION_START_TIME, then refine cross-host offsets with many matched collective end timestamps and report residual error. Compare only ranks holding the same model part, and never treat a longer window that started earlier as a straggler.

Can Nsight Systems replace Nsight Compute for kernel-level analysis?

No. Nsight Systems shows kernel placement and duration on the timeline, not why an individual kernel underuses the GPU. Use Nsight Compute for SOL, instruction, occupancy, and memory roofline conclusions.

How do I measure profiler overhead in an Nsight capture?

Compare the profiled step time against same-run unprofiled steady steps with identical workload and topology. The PROFILER_OVERHEAD table only records profiler activity in the trace and is not total end-to-end slowdown.

What are the limitations of Nsight Systems trace analysis with CUDA graphs?

CUDA graph replay may give many kernels a single launch and omit per-kernel CUDA API rows, so launch-starved attribution and call-site conclusions can be invalid. Describe the missing dependency resolution instead of claiming host-launch root causes.