Agent skill

Capture Nsys Profile

by mlc-ai in mlc-ai/pith-train

Capture a Nsight Systems (.nsys-rep) profile of a short PithTrain run for performance analysis.

Apache-2.0Auto-check passedAI & LLM Engineering

Install Capture Nsys Profile

skills CLI
$ npx skills add mlc-ai/pith-train --skill capture-nsys-profile -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mlc-ai/pith-train capture-nsys-profile --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mlc-ai/pith-train.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/capture-nsys-profile .claude/skills/capture-nsys-profile && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
capture-nsys-profile
GitHub stars
355
Token cost
~1k tokens
SKILL.md length
408 words
Files
3 (incl. scripts)
Skills in repo
10
Repo updated
First seen
Licence
Apache-2.0

At a glance

Capture a Nsight Systems (.nsys-rep) profile of a short PithTrain run for performance analysis.

  • Works in 3 steps: Choose parallelism → Determine node count → Capture the profile
  • The user asks to capture an nsys profile
  • SKILL.md covers Prerequisites, Step 1: Choose parallelism, Step 2: Determine node count and Step 3: Capture the profile, plus 2 more sections
  • Runs Python and Shell scripts from its folder; calls bash

What it does

Capture Nsys Profile is an agent skill from mlc-ai/pith-train. Capture a Nsight Systems (.nsys-rep) profile of a short PithTrain run for performance analysis. Use when the user asks to "capture an nsys profile", "profile training", or "grab an nsys trace", or wants to inspect kernel timelines / pipeline behavior / all-to-all overheads. Adaptive over pipeline-parallel (PP), expert-parallel (EP), context-parallel (CP), and sequence length; size the global batch so the pipeline reaches steady state without producing a multi-GB .nsys-rep. Run 5 warmup steps + 1 profiled step…

Its SKILL.md is about 1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including scripts (for example `scripts/capture.py` and `scripts/launch_capture.sh`).

It sits in AI & LLM Engineering. The repository describes itself as: Compact and Agent-Native MoE Training System. The licence is Apache-2.0.

When your agent uses it

  • The user asks to capture an nsys profile
  • Profile training
  • Grab an nsys trace
  • Wants to inspect kernel timelines / pipeline behavior / all-to-all overheads

Example prompts

  • “capture an nsys profile”
  • “profile training”
  • “grab an nsys trace”
  • “/capture-nsys-profile”

Requirements

  • Python 3
  • A Bash shell

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Choose parallelism
  2. Determine node count
  3. Capture the profile

What it can do on your machine

Read from SKILL.md and the folder at commit c7c8b1d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Python and Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Capture Nsys Profile loads about 1k tokens when it runs. Until then it costs about 141 tokens; SKILL.md has 408 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~141
When it runs · the whole SKILL.md, loaded when a task matches
~1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from mlc-ai/pith-train at commit c7c8b1d, republished under its Apache-2.0 licence (© mlc-ai). 408 words, ~1,028 tokens.

Download SKILL.mdSave it as .claude/skills/capture-nsys-profile/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
capture-nsys-profile
description
Capture a Nsight Systems (.nsys-rep) profile of a short PithTrain run for performance analysis. Use when the user asks to "capture an nsys profile", "profile training", or "grab an nsys trace", or wants to inspect kernel timelines / pipeline behavior / all-to-all overheads. Adaptive over pipeline-parallel (PP), expert-parallel (EP), context-parallel (CP), and sequence length; size the global batch so the pipeline reaches steady state without producing a multi-GB .nsys-rep. Run 5 warmup steps + 1 profiled step from a released checkpoint.

Capture Nsys Profile

Capture a single-step Nsight Systems (.nsys-rep) trace of PithTrain training, loaded from a released HuggingFace checkpoint so MoE load balancing is representative. The profile configuration (PP / EP / CP / sequence length) is specified at launch time; micro-batch size is hardcoded to 1.

Prerequisites

  • Python environment: activate .venv in the repo root (source .venv/bin/activate).
  • Nsight Systems CLI: nsys --version must work on every compute node.
  • Hardware: enough GPUs to satisfy world_size >= PP * CP * EP (with at least DP >= 1). See Step 2.
  • Benchmark inputs set up: the setup-benchmark-inputs skill has run for the target model (produces the tokenized corpus and DCP checkpoint capture loads).

Step 1: Choose parallelism

The user typically specifies PP and EP (and sometimes CP / sequence length). Confirm the numbers before launching:

  • --model: one of the supported models
  • --pipeline-parallel-size: PP
  • --expert-parallel-size: EP
  • --context-parallel-size: CP (default 1)
  • --sequence-length: sequence length in tokens (default 2048)

If the user is vague ("just profile DeepSeek-V2-Lite"), ask for PP and EP before launching. Different parallelism splits surface different bottlenecks, so the right config depends on what they want to see.

Step 2: Determine node count

Target DP=1 (smallest world that satisfies the parallelism plan). Assuming 8 GPUs per node:

ConfigPP * CP * EPMin nodes (8 GPUs/node)
pp=2 cp=1 ep=241 (half of an 8-GPU node)
pp=2 cp=1 ep=8162
pp=4 cp=1 ep=8324
If running under SLURM

Use the launch-with-slurm skill to find the allocation and read its node count; compare it to the minimum above. If the allocation is short, surface that to the user instead of launching.

Show full SKILL.md (146 more words)Show less

Step 3: Capture the profile

bash
# Single-node, minimum GPUs (DeepSeek-V2-Lite, pp=2 ep=2)
bash .agents/skills/capture-nsys-profile/scripts/launch_capture.sh --model deepseek-v2-lite --pipeline-parallel-size 2 --expert-parallel-size 2

# Multi-node via SLURM (Qwen3-30B-A3B, pp=2 ep=8 -> 2 nodes)
srun -N 2 -W 0 .agents/skills/capture-nsys-profile/scripts/launch_capture.sh --model qwen3-30b-a3b --pipeline-parallel-size 2 --expert-parallel-size 8

# Custom sequence length (Qwen3-30B-A3B, pp=4 ep=8 -> 4 nodes, seq=4096)
srun -N 4 -W 0 .agents/skills/capture-nsys-profile/scripts/launch_capture.sh --model qwen3-30b-a3b --pipeline-parallel-size 4 --expert-parallel-size 8 --sequence-length 4096

Output

Each node produces one .nsys-rep at workspace/capture-nsys-profile/pithtrain_node<N>.nsys-rep, containing traces for all ranks on that node (nsys attaches to torchrun's child processes). Analysis (GUI inspection, nsys stats, etc.) is out of scope for this skill; that belongs to a separate analyze-nsys-profile skill.

Common Issues

WORLD_SIZE is not divisible by pp, or the stage is not divisible by cp or ep

The allocation doesn't have enough GPUs for the requested parallelism. Stop; tell the user their allocation is short (report current world_size, and that pp must divide it with cp and ep each dividing world_size / pp) and ask whether to reduce PP/EP/CP or request more nodes. Do not silently adjust on their behalf.

No .nsys-rep produced after the run

Check the per-node log for nsys errors. Common causes: nsys not on PATH inside the srun step, or the output directory not writable.

© mlc-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts) in .agents/skills/capture-nsys-profile of mlc-ai/pith-train.

  • SKILL.md
  • scripts/capture.py
  • scripts/launch_capture.sh

Open the folder on GitHubat commit c7c8b1d

Compare with similar skills

Capture Nsys Profile next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Capture Nsys Profile compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Capture Nsys Profile this skillmlc-ai/pith-train355—~1kAutomated safety check: PassApache-2.0
Agent BuildershareAI-lab/learn-claude-code78k5 repos~1.2kAutomated safety check: PassMIT
Add Uint Supportpytorch/pytorch104k2 repos~2.3kAutomated safety check: PassCustom licence
LLM Benchmarking with lm-evaluation-harnessOrchestra-Research/AI-Research-SKILLs13k8 repos~3kAutomated safety check: PassMIT
Segment Anything Model GuideOrchestra-Research/AI-Research-SKILLs13k8 repos~3.3kAutomated safety check: PassMIT
1passwordtrpc-group/trpc-agent-go1.9k14 repos~656Automated safety check: PassApache-2.0

Similar skills

  • Agent Builder

    shareAI-lab/learn-claude-code

    Design and build AI agents for any domain. An agent skill from shareAI-lab/learn-claude-code.

    78k GitHub starsUsed in 5 repos~1.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Add Uint Support

    pytorch/pytorch

    Add unsigned integer (uint) type support to PyTorch operators by updating ATDISPATCH macros.

    104k GitHub starsUsed in 2 repos~2.3k tokens
    AI & LLM EngineeringAuto-check passed
  • LLM Benchmarking with lm-evaluation-harness

    Orchestra-Research/AI-Research-SKILLs

    Runs lm-evaluation-harness to benchmark language models on academic suites such as MMLU, GSM8K and HumanEval, compare models and track training checkpoints.

    13k GitHub starsUsed in 8 repos~3k tokens
    AI & LLM EngineeringAuto-check passed
  • Segment Anything Model Guide

    Orchestra-Research/AI-Research-SKILLs

    Guide to using Meta's Segment Anything Model for zero-shot image segmentation with point, box or mask prompts, or automatic mask generation.

    13k GitHub starsUsed in 8 repos~3.3k tokens
    AI & LLM EngineeringAuto-check passed
  • 1password

    trpc-group/trpc-agent-go

    Set up and use 1Password CLI (op). An agent skill from trpc-group/trpc-agent-go.

    1.9k GitHub starsUsed in 14 repos~656 tokens
    AI & LLM EngineeringAuto-check passed
  • Planning With Files

    jarrodwatts/claude-code-config

    Transforms workflow to use Manus-style persistent markdown files for planning, progress tracking, and knowledge storage.

    1.1k GitHub starsUsed in 5 repos~967 tokens
    AI & LLM EngineeringAuto-check passed

More from mlc-ai/pith-train

All 10 skills in this repo
  • Analyze Nsys Profile

    mlc-ai/pith-train

    Query a captured PithTrain Nsight Systems profile to measure compute/communication overlap, locate exposed comm by DualPipeV stage, and inspect per-rank stream behavior.

    355 GitHub stars~1.9k tokensUpdated 5 days ago
    Auto-check passed
  • Validate Correctness

    mlc-ai/pith-train

    Validates that code changes do not break training correctness by comparing loss deltas against a base-vs-base run-to-run envelope.

    355 GitHub stars~2.3k tokensUpdated 5 days ago
    Auto-check passed
  • Validate Performance

    mlc-ai/pith-train

    Measures the throughput difference between two branches with force-balanced routing.

    355 GitHub stars~1.4k tokensUpdated 5 days ago
    Auto-check passed
  • Setup Benchmark Inputs

    mlc-ai/pith-train

    Set up the minimal set of artifacts (tokenized DCLM corpus shard + released HuggingFace checkpoint converted to DCP) required to benchmark, profile, or regression-test a MoE model in PithTrain.

    355 GitHub stars~399 tokensUpdated 5 days ago
    Auto-check passed
  • Add New Model

    mlc-ai/pith-train

    Adds support for a new MoE language model to PithTrain. An agent skill from mlc-ai/pith-train.

    355 GitHub stars~4.6k tokensUpdated 5 days ago
    Auto-check passed
  • Wandb Tracking

    mlc-ai/pith-train

    Read, analyze, and manage Weights & Biases (wandb) experiment data for PithTrain runs.

    355 GitHub stars~1.1k tokensUpdated 5 days ago
    Auto-check: warnings

Questions about Capture Nsys Profile

What does Capture Nsys Profile do?

Capture a Nsight Systems (.nsys-rep) profile of a short PithTrain run for performance analysis. Capture Nsys Profile is an agent skill from mlc-ai/pith-train.nsys-rep) profile of a short PithTrain run for performance analysis.

When should I use Capture Nsys Profile?

Capture Nsys Profile fits situations like: the user asks to capture an nsys profile; profile training; grab an nsys trace; wants to inspect kernel timelines / pipeline behavior / all-to-all overheads.

How do I install Capture Nsys Profile in Claude Code?

Run `npx skills add mlc-ai/pith-train --skill capture-nsys-profile -a claude-code`. Or copy the skill folder (.agents/skills/capture-nsys-profile in mlc-ai/pith-train) into .claude/skills/capture-nsys-profile in your project. Claude Code loads it when a task matches its description.

How do I install Capture Nsys Profile in Codex?

Run `npx skills add mlc-ai/pith-train --skill capture-nsys-profile -a codex`. Or copy the skill folder (.agents/skills/capture-nsys-profile in mlc-ai/pith-train) into .agents/skills/capture-nsys-profile in your project. Codex loads it when a task matches its description.

Can I use Capture Nsys Profile in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mlc-ai/pith-train --skill capture-nsys-profile -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/capture-nsys-profile, .gemini/skills/capture-nsys-profile, .github/skills/capture-nsys-profile and .opencode/skills/capture-nsys-profile in your project.

What does Capture Nsys Profile need to run?

Going by SKILL.md and its folder, Capture Nsys Profile needs Python and a shell for the scripts in its folder and the command-line tools its instructions call (bash). Our summary lists: Python 3; A Bash shell.

Does Capture Nsys Profile access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Capture Nsys Profile safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Capture Nsys Profile use?

Capture Nsys Profile is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Capture Nsys Profile use?

About 1k tokens (SKILL.md is roughly 4.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Capture Nsys Profile?

Skills that share tags, products or a category with Capture Nsys Profile: Agent Builder (shareAI-lab/learn-claude-code, 78k stars), Add Uint Support (pytorch/pytorch, 104k stars), LLM Benchmarking with lm-evaluation-harness (Orchestra-Research/AI-Research-SKILLs, 13k stars) and Segment Anything Model Guide (Orchestra-Research/AI-Research-SKILLs, 13k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Capture Nsys Profile?

mlc-ai (a GitHub organization) maintains it in mlc-ai/pith-train, which has 355 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 4, 2026.

Source: mlc-ai/pith-train on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.