AGENT SKILL

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

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_ or sync_module_over_mesh failing?"
  • "Can I compile this ShardTensor model with torch.compile?"

Quick decision tree

  1. Need only a single process or a CPU import smoke? Use scripts/domain_parallel_smoke.py with no flags.
  2. Need 2+ GPUs and a real distributed proof? Launch the smoke with --distributed under torchrun, mpirun, or srun.
  3. All model params remain plain tensors? Use DDP on the explicit ddp mesh group, or no wrapper if only domain parallelism is active.
  4. Need memory sharding or DTensor parameters? Use FSDP2 (torch.distributed.fsdp.fully_shard) on the ddp mesh only.
  5. Need torch.compile? Compile only safe submodules; keep ring/sequence-sharded attention and other p2p collectives outside the compiled region.

Non-negotiables

  • ShardTensor is 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_mesh on 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.compile case, verify the eager path first.

Use the bundled references

Route elsewhere when appropriate

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351