LogoAwesome Skills
  • Search
  • Category
  • Tag
  • Blog
LogoAwesome Skills
LogoAwesome Skills

Discover Open-Source Agent Skills for AI Coding Assistants

Product

  • Search
  • Category
  • Tag
  • Blog

Resources

  • Claude Skill Docs
  • Antigravity Skills Docs

Tools

  • Claude Code
  • OpenCode
  • Cursor
  • Codex
  • Antigravity

Company

  • Privacy Policy
  • Terms of Service
  • Sitemap

©2026 Awesome Skills. All rights reserved.

Privacy PolicyTerms
Back to Skills

nemo-mbridge-perf-hierarchical-context-parallel

Operational guide for enabling hierarchical context parallelism in Megatron-Bridge, including config knobs, code anchors, pitfalls, and verification.

2,759stars321forksUpdated 8/1/2026
Data Science & ML#performance#machine-learning#megatron#nvidia#long-context#distributed-training

Security Assessment

Safe(96/100)
Security Score96/100

About nemo-mbridge-perf-hierarchical-context-parallel

This NVIDIA skill is an operational guide for enabling hierarchical context parallelism (CP) in Megatron-Bridge. It solves the problem of scaling context parallelism beyond the number of key-value heads by using nested context-parallel process groups driven by the a2a+p2p communication type and configured with hierarchical_context_parallel_sizes. It gives engineers the exact config knobs, upstream code anchors, pitfalls, and verification steps to do this correctly.

The guide provides a minimal Bridge override (context_parallel_size, cp_comm_type set to a2a+p2p, the hierarchical sizes list, and decentralized process-group flag) and the required constraints: the product of the hierarchical sizes must equal the context parallel size, sequence length must be divisible by twice the context parallel size, and Transformer Engine must be 1.12.0 or newer. It cites specific upstream source ranges in Megatron-LM and Bridge to ground the config declarations, argument validation, process-group creation, and Transformer Engine integration. A pitfalls section warns about MPU-only support today, the lack of a checked-in recipe exercising HCP, single-GPU load helpers clearing the sizes, and a subtle correctness trap where older stacks silently disabled CP communication (producing artificially high throughput with broken gradients) versus the newer assertion. It is Apache-2.0 licensed with published evaluation results.

It targets ML engineers and performance specialists scaling long-context training in Megatron-Bridge, or investigating a commit that changed CP config and caused an out-of-memory error or regression. It produces configuration guidance and analysis with code references; it performs no destructive or privileged actions.

FAQ

When would I use hierarchical context parallelism?

When scaling context parallelism beyond the number of KV heads, using nested CP process groups with the a2a+p2p communication type configured via hierarchical_context_parallel_sizes.

What constraints must the config satisfy?

The product of hierarchical_context_parallel_sizes must equal context_parallel_size, sequence length must be divisible by twice the context parallel size, and Transformer Engine must be at least 1.12.0.

Are there current limitations in Bridge?

Yes. Hierarchical CP is MPU-only today (with use_decentralized_pg=True it falls back to flat CP groups), no checked-in Bridge recipe exercises it directly, and single-GPU load helpers clear the hierarchical sizes.

What is the silent-failure risk on older stacks?

Older versions would silently disable CP communication if a2a+p2p was used without setting the hierarchical sizes, so each rank attended only to its local chunk, yielding artificially high throughput but broken gradients. Newer MCore asserts instead.

How do I verify it is active?

Check the process-group initialization output in the logs for the hierarchical context parallel group entries.

All Files

6 files
skill-card.md3.9 KB
View
card.yaml2.7 KB
View
skill.oms.sig4.7 KB
View
evals/evals.json1.5 KB
View
BENCHMARK.md4.4 KB
View
SKILL.md5.5 KB
View

Install nemo-mbridge-perf-hierarchical-context-parallel

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

nvidia/skills

Related Skills

short-form-video

14

multi-asset-morning-briefing

7,907

content-strategy

2,901

doherty-threshold

2,901