본문으로 건너뛰기
cccskills
무료GitHub에 공개

nemo-mbridge-perf-megatron-fsdp

Enable Megatron FSDP in Megatron-Bridge to distribute model training state across GPUs. Follow configuration and checkpoint requirements, investigate memory failures or performance regressions, and verify the setup with an existing two-GPU functional test.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

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

설치 방법 보기

이럴 때 유용합니다

  • Switch from DDP to Megatron FSDP
  • Investigate memory failures after FSDP configuration changes
  • Check checkpoint formats and incompatible settings
  • Verify FSDP training with a two-GPU test

포함된 파일(6)

  • SKILL.md3.8 KB
  • BENCHMARK.md4.2 KB
  • card.yaml2.1 KB
  • evals/evals.json1.4 KB
  • skill-card.md3.7 KB
  • skill.oms.sig4.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Megatron FSDP Skill

For stable background and recommendation level, see:

  • @docs/training/megatron-fsdp.md
  • @skills/nemo-mbridge-perf-megatron-fsdp/card.yaml

Enablement

Minimal Megatron FSDP override in Bridge:

cfg.dist.use_megatron_fsdp = True
cfg.ddp.use_megatron_fsdp = True
cfg.ddp.data_parallel_sharding_strategy = "optim_grads_params"
cfg.ddp.average_in_collective = False
cfg.checkpoint.ckpt_format = "fsdp_dtensor"

Example recipe fixup:

cfg = llama3_8b_pretrain_config()
cfg.dist.use_megatron_fsdp = True
cfg.ddp.use_megatron_fsdp = True
cfg.ddp.data_parallel_sharding_strategy = "optim_grads_params"
cfg.ddp.average_in_collective = False
cfg.checkpoint.ckpt_format = "fsdp_dtensor"
cfg.checkpoint.save = "/tmp/fsdp_ckpts"
cfg.checkpoint.load = None

Performance harness note:

python scripts/performance/launch.py --use_megatron_fsdp true

Code Anchors

Bridge config definition:

use_megatron_fsdp: bool = False
"""Use Megatron's Fully Sharded Data Parallel. Cannot be used together with use_torch_fsdp2."""

use_torch_fsdp2: bool = False
"""Use the torch FSDP2 implementation. FSDP2 is not currently working with Pipeline Parallel.
It is still not in a stable release stage, and may therefore contain bugs or other
potential issues."""

Bridge validation:

if self.dist.use_megatron_fsdp and self.dist.use_torch_fsdp2:
    raise ValueError(...)
...
assert not self.dist.use_tp_pp_dp_mapping, "use_tp_pp_dp_mapping is not supported with Megatron FSDP"
...
assert self.checkpoint.ckpt_format == "fsdp_dtensor", (
    "Megatron FSDP only supports fsdp_dtensor checkpoint format"
)

Runtime wrapper selection:

if use_megatron_fsdp:
    DP = FullyShardedDataParallel
elif use_torch_fsdp2:
    DP = TorchFullyShardedDataParallel
else:
    DP = DistributedDataParallel
...
DP(
    config=get_model_config(model_chunk),
    ddp_config=ddp_config,
    module=model_chunk,
    ...
    pg_collection=pg_collection,
)

Perf harness overrides:

recipe.ddp.use_megatron_fsdp = True
recipe.ddp.data_parallel_sharding_strategy = "optim_grads_params"
recipe.ddp.keep_fp8_transpose_cache = False
recipe.ddp.average_in_collective = False
...
recipe.checkpoint.load = None

Pitfalls

  1. Public recipes often expose use_megatron_fsdp but still default to ckpt_format="torch_dist". If save/load is enabled, switch to fsdp_dtensor.
  2. use_torch_fsdp2 exists, but on the validated branch Bridge still fails before training because _ddp_wrap passes pg_collection.
  3. CPU offloading is only valid when pipeline_model_parallel_size == 1 and activation recomputation is disabled.
  4. Upstream warns that FSDP and TP/CP can want different CUDA_DEVICE_MAX_CONNECTIONS settings on Hopper and earlier.
  5. Megatron FSDP and FSDP2 are mutually exclusive.

Verification

Use the existing 2-GPU functional smoke test:

CUDA_VISIBLE_DEVICES=0,1 uv run python -m torch.distributed.run --nproc_per_node=2 \
  -m pytest tests/functional_tests/training/test_megatron_fsdp.py::TestMegatronFSDP::test_fsdp_pretrain_basic -v -s

Success criteria:

  • Pytest reports 1 passed
  • The log shows finite loss at the last iteration
  • The run finishes without a checkpoint format assertion

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Move pandas-style table processing to NVIDIA GPUs using cuDF. Choose minimal-change acceleration or explicit GPU code, handle joins and aggregations, compare results with pandas, and use dask-cuDF when data exceeds GPU memory.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Accelerate existing pandas processing with minimal changes
  • Move joins and aggregations to GPU code
  • Compare missing values and ordering with pandas
NVIDIA/skills3.7천2026년 10월 21일 업데이트

Customize NVIDIA Nemotron Voice Agent’s Generic Pipecat example for appointment scheduling, five-field patient intake, or a custom healthcare conversation. Build prompts and tool handlers without a separate backend, then validate conversation behavior, services, and voice interaction.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Build an appointment-scheduling voice agent
  • Collect five patient-intake fields through conversation
  • Design a custom healthcare conversation with tool calls
NVIDIA/skills3.7천2026년 10월 21일 업데이트

Calibrate live cameras by recording their RTSP video streams through VIOS and processing the clips with AutoMagicCalib. The workflow imports settings and alignment files, checks readiness, tracks calibration progress, and retrieves results.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Calibrate cameras from live RTSP streams
  • Import settings and alignment files for a camera scene
  • Retrieve evaluation statistics using ground truth data
NVIDIA/skills3.7천2026년 10월 21일 업데이트

Test a running AMC service with the bundled four-camera warehouse dataset. Run camera calibration from upload to completion, then check distance and image projection errors against ground-truth data to verify the installation.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Verify a newly installed AMC service
  • Check the sample's calibration errors against ground truth
  • Walk through the sample workflow in Swagger UI
NVIDIA/skills3.7천2026년 10월 21일 업데이트

Calibrate multiple cameras from recorded MP4 files through the AutoMagicCalib REST API. The skill handles project creation, uploads, input verification, progress checks, and evaluation when reference data is supplied, with optional VGGT refinement.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Calibrating cameras from synchronized MP4 recordings
  • Uploading local settings and alignment files
  • Evaluating calibration against ground-truth data
NVIDIA/skills3.7천2026년 10월 21일 업데이트

Set up AutoMagicCalib from NGC release containers using Docker Compose. The skill handles registry authentication, port and path configuration, optional VGGT model download, service startup, and readiness checks for the backend and web interface.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Launching the AutoMagicCalib backend and web interface
  • Configuring service ports and network access
  • Adding the optional VGGT model during setup
NVIDIA/skills3.7천2026년 10월 21일 업데이트

NVIDIA의 스킬 모두 보기

이 스킬의 문제 신고