What problem does it solve?
Physics simulations with high-resolution inputs often exceed single-GPU memory, and standard PyTorch DDP/FSDP guidance does not cover splitting one sample's spatial or sequence dimension across GPUs. This Skill provides NVIDIA-authored guidance for PhysicsNeMo's ShardTensor domain parallelism so agents can convert scripts correctly without modifying model code.
Core Features & Use Cases
- Script-level integration: Build 2D DeviceMesh topologies with named ddp and domain axes, scatter inputs with scatter_tensor, and choose the right wrapper (DDP or FSDP2 fully_shard) while leaving model code unchanged via auto-promotion.
- Custom op enablement: Register shard patches from user code at import time using register_function_handler, register_dispatch_handler, or register_named_function_handler, modeled on existing patches in physicsnemo/domain_parallel/shard_utils/.
- Multi-GPU correctness testing: Bootstrap distributed-vs-single-GPU numerical comparisons with numerical_shard_tensor_check and check_grads=True under torchrun with the multigpu_static marker.
- Use Case: A ViT-style PhysicsNeMo training script OOMs on high-resolution inputs; the Skill guides converting it to an 8-GPU ddp x domain mesh with sharded spatial activations, batch size 1 per domain group, and verified gradient correctness.
Quick Start
Ask your agent to convert a single-GPU PhysicsNeMo training script to use ShardTensor domain parallelism across multiple GPUs with DDP or FSDP2.