Generated banner for Nvshmem Enable Tma
Generated logo for Nvshmem Enable Tma

Nvshmem Enable Tma

NVIDIAOfficialCreated by NVIDIA NVSHMEM Team

  • Skill
  • Tool integration
  • Software development
  • Apache-2.0
  • Medium risk

From the author

Prepare or review NVSHMEM CUDA kernels for TMA SMEM registration and direct-SMEM transfers. Do not use for unrelated CUDA tuning.
— the description by NVIDIA NVSHMEM Team

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured process for assessing, patching, and reviewing NVSHMEM CUDA kernels to leverage Tensor Memory Accelerator (TMA) capabilities. It focuses on enabling efficient direct-SMEM transfers or NVSHMEM-managed GMEM staging while ensuring strict adherence to scope, safety, and performance requirements. The skill guides users through verifying prerequisites like NVSHMEM versioning, GPU architecture (SM90+), and peer-reachability, ensuring that changes are surgical and do not disrupt existing application logic.

What it does

  • Assesses CUDA kernels for TMA-backed NVSHMEM communication compatibility.
  • Provides a workflow for patching kernels to use direct-SMEM puts or managed GMEM staging.
  • Enforces strict scope boundaries to prevent unintended modifications to non-target kernels.
  • Validates prerequisites including NVSHMEM version, GPU architecture, and network topology.
  • Generates a structured report detailing the outcome, policy preconditions, and validation status.
  • Ensures existing application error handling and completion semantics are preserved.

When to use it

  • When you need to optimize NVSHMEM point-to-point transfers using TMA on SM90+ hardware.
  • When you want to transition from standard NVSHMEM transfers to direct-SMEM puts for proven-redundant staging buffers.
  • When performing a code review of NVSHMEM-enabled kernels to ensure correct TMA registration and launch configuration.
  • When diagnosing performance or configuration issues related to TMA routing in NVSHMEM applications.

Advantages

  • Minimizes risk by enforcing surgical, scope-limited code changes.
  • Ensures correctness by requiring proof of redundancy before removing staging buffers.
  • Provides clear, standardized reporting for validation and troubleshooting.
  • Maintains compatibility with regular NVSHMEM paths for ineligible operations or older hardware.

Usage examples

“Use nvshmem-enable-tma to prepare app.cu for NVSHMEM TMA on H100 NVLink while leaving non-NVSHMEM kernels unchanged.”
The agent will inspect app.cu, identify the target kernel, apply necessary registration and TMA-enabled launch parameters, and confirm that only the selected kernel was modified.
“Use nvshmem-enable-tma to inspect a shared-tile-to-GMEM-to-put sequence and, if the GMEM copy is provably redundant, pass the existing shared tile directly.”
The agent will verify if the GMEM buffer is redundant and, upon confirmation, provide a patch to remove the intermediate copy and use a direct-SMEM put with the required async proxy fence.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/nvidia/nvshmem-enable-tma/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip nvshmem-enable-tma.zip -d .agents/skills

Documentation by NVIDIA NVSHMEM Team

Enable TMA in NVSHMEM Applications

Purpose

Prepare an application for NVSHMEM's TMA-backed device-side transfers without changing its put/get APIs or unrelated kernels. Assess the target, choose the correct shared-memory path, make the smallest safe change, and explain launch-time requirements.

Prerequisites

  • Require readable CUDA/C++ source for a patch or code review. A static assessment needs no GPU, installed NVSHMEM runtime, or cluster access.

  • Require an NVSHMEM 3.7.0-or-newer development environment and CUDA toolchain only when compiling.

  • Require SM90-or-newer GPUs and peer GPU load/store reachability such as NVLink only when validating TMA execution or performance.

  • CFT requires TMA.

Reference Routing

Before changing code, read registration-and-launch.md completely and then every reference selected below. Use the references as shapes, not blind replacements: preserve the application's error handling, launch abstraction, completion contract, and shared-memory layout.

SituationRequired additional reference
Global-memory operands, or staging copy/buffer is not proven redundantgmem-staging.md
Explicitly opted-in shared-memory put source with a proven-redundant GMEM copydirect-smem-put.md
Compile, run, diagnose, or report validationvalidation-and-troubleshooting.md

For a read-only assessment or review, read only the references needed to evaluate the proposed path. Do not make a code change until the complete registration reference and every selected path reference have been read.

Inputs

  • Required: Application source or source path, and the requested outcome: assessment, patch, review, or debugging.

  • Optional: Derive NVSHMEM version, CUDA architecture, topology, kernel launch sites, and launch configuration from the project or environment when possible.

  • Conditional for execution: Obtain build command, launch command, and target hardware access only when the user asks to compile or run validation.

  • Ask only for facts that cannot be inspected and materially affect the result. Do not require topology details merely to prepare code; mark performance benefit unverified when topology is unknown.

Scope

  • Identify exactly one user-opted-in CUDA translation unit and one NVSHMEM communication kernel before editing. Its required launch code is the complete change boundary.

  • Derive the target from the user's named file/kernel or attachment metadata, not from files discovered by globbing. A singular request does not authorize editing every eligible kernel.

  • Preserve all other kernels, host-only NVSHMEM use, and unrelated launch code. Never modify adjacent candidates merely because they contain NVSHMEM calls.

  • Expand beyond one kernel only when the user explicitly names multiple targets. Apply this scope check to each target independently.

Before editing, answer every question below. Stop without editing if a required answer is no or unverified.

  • Explicit scope: Is this the selected file and kernel?

  • Eligible operation: Does the selected kernel's device call graph reach a TMA-relevant NVSHMEM operation?

  • Necessary edit: Is every planned change needed for registration, lifetime, direct-SMEM dataflow, or launch sizing?

  • Proven redundancy: If removing a staging copy or buffer, is it proven to have no producer, consumer, alias, synchronization, completion, or lifetime role? If the answer is unverified because the GMEM buffer is a parameter, escapes the selected translation unit, or has uninspectable consumers, ask the user whether it is externally observable before editing. Do not infer redundancy.

  • No speculation: Does the selected target require application-side TMA registration for the operation being prepared?

  • Surgical launch change: Can the existing grid, block, stream, arguments, and error handling remain intact apart from required registration parameters and dynamic-SMEM bytes?

After editing, inspect the changed-file list and diff. Remove only your own out-of-scope edits before reporting completion; the changed application file set must contain only the opted-in target.

Instructions

1. Establish the Boundary
  • Treat an assessment or review as read-only.

  • Treat a request to enable, prepare, update, or fix TMA as permission to edit only the selected kernel and in-scope launch configuration.

  • Inspect the selected kernel's device call graph for device-side point-to-point put, get, put-with-signal, and their typed/thread/warp/block variants.

2. Decide Whether TMA Is Useful and Available

State these conclusions before or alongside a patch:

  • Require NVSHMEM 3.7.0 or newer. Stop a requested conversion for an older confirmed version and recommend upgrading.

  • Require SM90 or newer for TMA execution. With NVSHMEM_TMA_POLICY=ENABLE, older GPUs preserve correctness through the regular path but receive no TMA benefit.

  • TMA helps only peer-reachable GPU memory paths through the GPU load/store fabric, normally NVLink. Do not recommend it for IB, RoCE, EFA, or another network transport.

  • It is promising for large point-to-point transfers, low communication-thread counts, fused kernels, or tiles already in shared memory. Never promise a speedup without measurement.

When version, architecture, or topology is unknown, prepare code only if requested and label the corresponding conclusion unverified.

3. Classify Each Operation

Inspect local operand spaces, application shared memory, staging-copy dataflow, dynamic/static shared memory, alignment, early returns, CTA-uniform control flow, existing fences/flushes/quiet calls, and possible concurrent staged callers in a CTA.

SituationPath
Global-memory application operands, or no proven-redundant stagingNVSHMEM-managed GMEM staging
Shared-memory put source with a proven-redundant SMEM-to-GMEM copyOffer direct shared-memory put as an explicit opt-in
Shared-memory get destinationKeep the documented staging path

Default to NVSHMEM-managed staging. Never introduce a new application shared-memory layout solely to force a direct-operand path.

4. Apply the Selected References

Follow the complete registration/lifetime protocol in the shared registration reference. Then apply the selected path reference. Preserve existing completion semantics and do not hard-code the current recommended shared-memory byte count.

5. Validate and Report

Read the validation reference for all compile, run, diagnosis, and validation-report work. Lead the final report with one of:

  • TMA is useful and the application is prepared

  • The application is prepared, but TMA benefit is unverified

  • TMA is not useful or not supported for this target

Use this report template:

Outcome: <one required outcome line above>
Changed scope: <the selected file, kernel, and launch site; confirm no adjacent files changed>
Selected path: <NVSHMEM-managed GMEM staging | explicitly opted-in direct-SMEM put>
Policy precondition: Set NVSHMEM_TMA_POLICY=ENABLE before nvshmem_init*; <where to set it>
Eligibility: NVSHMEM <version, must be >= 3.7.0>; <SM90+ evidence>; <NVLink/peer load-store evidence>
Operation constraints: <alignment, byte count, scope/concurrency, completion, shared-memory sizing>
Fallback: ENABLE preserves the regular path for ineligible operations; registration alone does not guarantee TMA routing
Unverified: <topology, occupancy, or none>
Validation: <checks run and exact remaining test commands>

Mention any direct-SMEM candidate deliberately not applied because it was outside scope or its redundancy was not proven.

Limitations

  • Do not convert host-side RMA, collectives without an applicable TMA path, network-transport operations, or remote shared-memory targets.

  • Do not claim registration guarantees TMA routing; policy, architecture, topology, operand space, alignment, size, scope, and runtime limits determine each transfer.

Troubleshooting

For configuration failures, incorrect results, hangs near shared-memory release, or an unselected TMA path, read validation-and-troubleshooting.md. Treat regular-path fallback under NVSHMEM_TMA_POLICY=ENABLE as valid behavior; do not diagnose it as a correctness failure.

Examples

Use $nvshmem-enable-tma to prepare app.cu for NVSHMEM TMA on H100 NVLink while leaving non-NVSHMEM kernels unchanged.

Use $nvshmem-enable-tma to inspect a shared-tile-to-GMEM-to-put sequence and, if the GMEM copy is provably redundant, pass the existing shared tile directly.

Use $nvshmem-enable-tma to assess an NVSHMEM 3.6 application running on A100 peers connected only through InfiniBand.

<!-- ci trigger -->

Files

BENCHMARK.md

Skill Benchmark: nvshmem-enable-tma

✅ Overall verdict: PASS — Recommended for publication

Publication Recommendation

Recommended for publication based on the completed evaluation evidence in this report.

Evaluation Metadata

  • Skill: nvshmem-enable-tma

  • Evaluation date: 2026-09-17

  • Evaluator version: 1.5.6

  • Agents: Claude Code (aws/anthropic/bedrock-claude-opus-4-8), Codex (openai/openai/gpt-5.5)

  • Tasks: 4 evaluation tasks (3 positive, 1 negative)

  • Dataset digest: sha256:e3c2d48c44ad179c71aae4981c94ea63468db8ca1773417a7723778f19bdf523 (skill-evaluator-dataset-snapshot/1)

  • Attempts per task: 3

  • Environment: k8s-sandbox

  • Tier 2 evidence: required for publication

  • Tier 3 evidence: required for publication

Each task attempt ran in its own isolated sandbox pod.

What This Report Answers

The three-tier evaluation checks whether the skill:

  • is safe to use;

  • produces correct answers;

  • is discovered and activated when needed;

  • helps the agent complete the user's goal and expected workflow; and

  • avoids wasted skill and tool usage.

Results at a Glance

MeasureClaude Code (Baseline → Skill Uplift)Codex (Baseline → Skill Uplift)
Overall89.1% — baseline ran, but no comparable score was available; uplift unavailable87.9% — baseline ran, but no comparable score was available; uplift unavailable
Security100.0% → 100.0% (±0.0 points)100.0% → 100.0% (±0.0 points)
Correctness40.0% → 95.0% (+55.0 points)70.0% → 90.0% (+20.0 points)
Discoverability80.0% — baseline ran, but no comparable score was available; uplift unavailable80.0% — baseline ran, but no comparable score was available; uplift unavailable
Effectiveness37.5% → 82.5% (+45.0 points)42.5% → 81.3% (+38.8 points)
Efficiency88.2% — baseline ran, but no comparable score was available; uplift unavailable88.2% — baseline ran, but no comparable score was available; uplift unavailable

How to read this table: baseline is the same task attempted without the target skill. Scores are rounded to one decimal; threshold-adjacent values use additional precision so their displayed band matches the verdict. Uplift is derived from those displayed scores and shown in percentage points.

Example: 47.0% → 92.0% (+45.0 points) means the skill-assisted run scored 92.0%, 45.0 percentage points above its 47.0% no-skill baseline.

A partial dimension was calculated from only the available configured signals; review the detailed report before relying on it.

Token Usage

Actual Tier 3 execution usage is reported for every observed agent/case pair and both conditions.

AgentDataset caseWith skillWithout skillDeltaChangeCoverage
claude-codeAll cases974,9271,227,433N/AN/Askill 4/4; base 7/7
claude-codenvshmem-enable-tma-001409,833574,334N/AN/Askill 1/1; base 3/3
claude-codenvshmem-enable-tma-002377,823434,847N/AN/Askill 1/1; base 2/2
claude-codenvshmem-enable-tma-00364,05795,000-30,943-32.57%skill 1/1; base 1/1
claude-codenvshmem-enable-tma-005123,214123,252-38-0.03%skill 1/1; base 1/1
codexAll cases725,1401,797,597N/AN/Askill 4/4; base 6/6
codexnvshmem-enable-tma-001323,280797,326N/AN/Askill 1/1; base 3/3
codexnvshmem-enable-tma-002321,258853,653-532,395-62.37%skill 1/1; base 1/1
codexnvshmem-enable-tma-00366,56490,896-24,332-26.77%skill 1/1; base 1/1
codexnvshmem-enable-tma-00514,03855,722-41,684-74.81%skill 1/1; base 1/1
ALL AGENTSDataset aggregate1,700,0673,025,030N/AN/Askill 8/8; base 13/13

Prompt tokens include cached reads, so total tokens are prompt + completion (cached is not added twice). The Efficiency score uses (prompt - cached) + completion. N/A means the relevant trajectory counters were not available; coverage is never estimated.

Tier Status

TierPurposeStatusEvidence
Tier 1Static validationPASSED11 validator(s); 0 finding(s)
Tier 2Semantic deduplicationPASSED2 validator(s); 0 finding(s)
Tier 3Live agent evaluationPASS2 agent(s); 4 task(s)

Findings and Observations

<details> <summary>Show detailed findings and successful checks</summary>

  • Schema & Repository Governance: Found skill manifest: SKILL.md

  • Semantic Version Validation: Valid semantic version: 1.0.0

  • Security Scan: No security vulnerabilities detected (secrets, API keys, credentials)

  • PII Scan: Scanning 5 files for PII

  • Code Integrity & Hygiene: Checking 5 markdown files for dead links

  • Unicode Smuggling Detection: No invisible Unicode characters detected in 5 file(s)

  • QUALITY: Score: 100.0/100 (Grade: A)

  • SCRIPT_LINT: No scripts/ directory found

  • Context Deduplication: Collected 5 file(s)

  • Inter-Skill Deduplication: Parsed skill 'nvshmem-enable-tma': 129 char description

  • AGENT_EVAL: Tier 3 evaluation complete: verdict PASS; best agent claude-code

</details>

Scoring Methodology

<details> <summary>Show dimension definitions, source signals, and thresholds</summary>

DimensionQuestionScored signals
SecurityIs it safe to use?security (100%)
CorrectnessIs the answer correct?accuracy (100%)
DiscoverabilityWas the right skill loaded when needed?skill_execution (100%)
EffectivenessDid the skill help complete the task?goal_accuracy (50%) + behavior_check (50%)
EfficiencyDid it avoid wasted tool calls and token usage?skill_efficiency (50%) + token_efficiency (50%)
  • Dimension bands: PASS at 50% or above; NEUTRAL from 40% to below 50%; FAIL below 40%.

  • Overall Tier 3 lift: PASS at +5 points or more; FAIL at -10 points or less; values between those bands are NEUTRAL.

  • Overall verdict: PASS only when every configured dimension passes for at least one supported agent. Lift is reported as diagnostic evidence and does not override this gate.

  • The 50% attempt pass threshold is a separate per-task gate; it is not the dimension pass threshold.

  • Effectiveness is the equal-weight mean of goal completion (goal_accuracy) and expected workflow adherence (behavior_check).

  • Efficiency is 50% tool-call productivity (the backward-compatible skill_efficiency wire id) and 50% token_efficiency. Positive-case skill routing is scored under Discoverability, not Efficiency; a negative case without a routing target is N/A. N/A sources are omitted, remaining weights are renormalized, and the dimension is marked partial.

Signals present in this run:

  • security (Security): unsafe operations, secret leakage, and unauthorized access.

  • skill_execution (Skill Execution): whether the expected skill was selected, decoys were avoided, and the workflow executed.

  • skill_efficiency (Tool Productivity): tool-call productivity (legacy wire id; routing is scored under Discoverability).

  • accuracy (Accuracy): final-answer correctness against the reference answer.

  • goal_accuracy (Goal Accuracy): whether the user's goal was achieved.

  • behavior_check (Behavior Check): whether the expected workflow behavior was followed.

  • token_efficiency (Token Efficiency): actual uncached prompt plus completion usage (50% of Efficiency).

</details>

Freshness

Regenerate this benchmark when the skill, evaluation dataset, target agent/model, evaluator version, environment, or scoring policy changes.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

What our scanner noticed· Medium risk

  • Large base64-encoded blobs

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
NVIDIA NVSHMEM Team
Publisher
NVIDIA (Official)
Source
NVIDIA/skills · skills/nvshmem-enable-tma · commit fce3cca
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE-APACHE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by NVIDIA NVSHMEM Team or NVIDIA.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download nvshmem-enable-tma.zip