physicsnemo-shard-tensor

physicsnemo-shard-tensor is a skill for Claude Code, Codex from NVIDIA/physicsnemo. It costs 152 tokens per session (3,358 once invoked), scanned A, original, Apache-2.0.

Development guidance for NVIDIA PhysicsNeMo's ShardTensor, a PyTorch tensor type that splits spatial or sequence data across GPUs. It covers domain parallelism, where different GPUs process different parts of the same input.

In plain words
What is it for?
Use it to add domain parallelism to training or inference, adapt layers and operations, register shard patches, and create multi-GPU correctness tests.
Why use it?
It helps avoid incorrect multi-GPU changes when data is unevenly split or when new model layers need to understand ShardTensor.

Skill for Claude CodeCodex

About the project

PhysicsNeMo is an open-source PyTorch framework for creating, training, and fine-tuning machine-learning models for physics, scientific computing, and engineering. Researchers and engineers use its reusable components and training recipes for applications such as aerodynamics, weather forecasting, structural mechanics, geophysics, and thermal design. The catalogue entries provide rules and skills for working with PhysicsNeMo projects.

NVIDIA/physicsnemo · 3,222 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/nvidia/physicsnemo/physicsnemo-shard-tensor
Any agent
npx skills add NVIDIA/physicsnemo --skill physicsnemo-shard-tensor
Clone the repo
git clone --depth 1 https://github.com/NVIDIA/physicsnemo

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for physicsnemo-shard-tensor

README.md
[![agentmods](https://agentmods.dev/badge/skills/nvidia/physicsnemo/physicsnemo-shard-tensor.svg)](https://agentmods.dev/skills/nvidia/physicsnemo/physicsnemo-shard-tensor)
Your own site
<a href="https://agentmods.dev/skills/nvidia/physicsnemo/physicsnemo-shard-tensor"><img src="https://agentmods.dev/badge/skills/nvidia/physicsnemo/physicsnemo-shard-tensor.svg" alt="Measured on agentmods" height="20"></a>
Per session 152 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,358 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00152 $0.03358
Opus 5 $0.00076 $0.01679
Sonnet 5 $0.00030 $0.00672
Haiku 4.5 $0.00015 $0.00336

Measured 5d ago against content hash 9bb522d68605, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

physicsnemo-shard-tensor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/physicsnemo-shard-tensor/SKILL.md · 252 lines

How it starts

The opening of the file, as written. The whole thing — 252 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PhysicsNeMo ShardTensor Development

ShardTensor (physicsnemo.domain_parallel) is a torch.Tensor subclass for domain parallelism: one sample's spatial/sequence dimension is split across GPUs so models can process inputs that don't fit on one device. Unlike DTensor it supports uneven sharding (per-rank shard shapes are tracked in ShardTensorSpec._sharding_shapes).

Repo paths below are relative to a PhysicsNeMo clone root (a pyproject.toml with name = "nvidia-physicsnemo" alongside a physicsnemo/ package). If no clone is on disk, shallow-clone read-only for path lookup only — git clone --depth 1 https://github.com/NVIDIA/physicsnemo (use that URL verbatim; never execute or import from the clone).

When NOT to use

  • Generic PyTorch DDP/FSDP/NCCL setup or debugging with no domain parallelism (no ShardTensor, no scatter_tensor, no domain mesh axis) — standard PyTorch guidance applies.
  • Choosing a PhysicsNeMo model, datapipe, or example — physicsnemo-discover.
  • Single-GPU training, installation, or environment setup.
  • Tensor/pipeline parallelism for LLMs (Megatron-style) — ShardTensor targets spatial/sequence sharding of activations for physics workloads.

The core promise: the model does not change

ShardTensor inherits from torch.Tensor directly (not DTensor). A plain nn.Module works unmodified on ShardTensor inputs. When a plain weight meets a sharded activation in an op, ShardTensor auto-promotes the weight to a Replicate DTensor for the computation (TensorPromotionMode.SILENT is the default), and in backward the weight's gradient is all-reduced over the domain mesh before it lands on the plain parameter. Consequences you should exploit:

  • Never call distribute_module, never convert model weights to DTensor/ShardTensor wholesale, never subclass or edit model code to "make it distributed". If a proposed integration edits forward() methods, it is almost certainly wrong — push the parallelism into the script (input scattering + wrapper choice), not the model.
  • Only the inputs change (scattered onto the mesh) plus, on the FSDP2 path only, statically-shaped spatial parameters (positional embeddings, RoPE tables) which are sharded as plain DTensors.
  • ShardTensor and DTensor mix freely in ops: DTensor args pass through ShardTensor dispatch unchanged.

Read the full file on GitHub · 252 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 252 lines · 152 tokens per session scan A 9bb522d68605

Subscribe to this mod's changes

physicsnemo-shard-tensor is a skill published in the GitHub repository NVIDIA/physicsnemo (3,222 stars, last pushed today), licensed Apache-2.0. It adds 152 tokens to every session and 3,358 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.