distributed-and-domain-parallel
Route PhysicsNeMo distributed launches, DDP/FSDP2, DeviceMesh, ShardTensor, and domain-parallel input/output handling.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- distributed-and-domain-parallel
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Route PhysicsNeMo distributed launches, DDP/FSDP2, DeviceMesh, ShardTensor, and domain-parallel input/output handling.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/distributed-workflows.md1.8 KB
- 参考文档references/shardtensor-api.md2.0 KB
- 参考文档references/troubleshooting.md1.7 KB
- 脚本scripts/domain_parallel_smoke.py3.6 KB
03 SKILL.md 正文
PhysicsNeMo distributed and domain parallel
Use this sub-skill when the task is about DistributedManager, launchers, DDP/FSDP2, named DeviceMesh layouts, ShardTensor inputs, scatter/sync APIs, or torch.compile caveats around domain parallelism.
Trigger phrases
- "How do I launch PhysicsNeMo with torchrun, mpirun, or srun?"
- "How do I use DistributedManager or initialize a DeviceMesh?"
- "How do I combine DDP or FSDP2 with ShardTensor?"
- "How do I scatter inputs across the domain mesh?"
- "Why is
requires_grad_orsync_module_over_meshfailing?" - "Can I compile this ShardTensor model with torch.compile?"
Quick decision tree
- Need only a single process or a CPU import smoke? Use
scripts/domain_parallel_smoke.pywith no flags. - Need 2+ GPUs and a real distributed proof? Launch the smoke with
--distributedundertorchrun,mpirun, orsrun. - All model params remain plain tensors? Use DDP on the explicit
ddpmesh group, or no wrapper if only domain parallelism is active. - Need memory sharding or DTensor parameters? Use FSDP2 (
torch.distributed.fsdp.fully_shard) on theddpmesh only. - Need
torch.compile? Compile only safe submodules; keep ring/sequence-sharded attention and other p2p collectives outside the compiled region.
Non-negotiables
ShardTensoris for activations, not wholesale model surgery.- Do not recommend FSDP1 or
distribute_module. - Per-domain-group batch size must be 1; scale batch on the DDP axis only.
- Domain-parallel proof needs actual CUDA-capable GPUs. CPU-only is import/single-process only.
Validation steps
- Confirm
DistributedManager.initialize()gives the expected rank, world size, device, and launcher detection. - Build a named mesh and verify
ddp_size * domain_size == world_size. - Scatter a tiny tensor over the domain mesh and gather it back with
full_tensor(). - Call
sync_module_over_meshon a tiny plain module and confirm weights and buffers match the source rank. - If using
requires_grad=True, check the leaf tensor and its gradient on the smoke path. - For any
torch.compilecase, verify the eager path first.
Use the bundled references
references/distributed-workflows.md— launcher recipes, DDP/FSDP2 skeletons, logging, and checkpoint notes.references/shardtensor-api.md—DeviceMesh,scatter_tensor,sync_module_over_mesh, batch semantics, andtorch.compileconstraints.references/troubleshooting.md— common ShardTensor and distributed failure modes.
Route elsewhere when appropriate
- Model-family selection or example picking →
../model-selection/SKILL.md - Data loading, readers, and dataloaders →
../datapipes/SKILL.md - Mesh creation/validation/repair utilities →
../mesh-and-geometry/SKILL.md - Diffusion sampler/preconditioner internals →
../diffusion-and-generative/SKILL.md - Active-learning loops or ONNX export →
../active-learning-and-deployment/SKILL.md
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).