benchmark-model-kernels

A planning and benchmarking tool for testing the small matrix calculations used inside Hugging Face decoder models. It uses model configurations without loading their trained weights.

In plain words
What is it for?
Use it to choose model, GPU, tensor or expert parallelism, and token-concurrency settings, then plan or run BF16, FP8, and NVFP4 GEMM or fused-MoE tests.
Why use it?
It helps estimate kernel performance for a planned deployment while keeping the benchmark focused on individual GPU calculations, not full serving speed.

Skill for Claude CodeCodex

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/model-optimizer/benchmark-model-kernels
Any agent
npx skills add NVIDIA/Model-Optimizer --skill benchmark-model-kernels
Clone the repo
git clone --depth 1 https://github.com/NVIDIA/Model-Optimizer

Made for: Claude Code, Codex.

Per session 105 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,962 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.00105 $0.01962
Opus 5 $0.00053 $0.00981
Sonnet 5 $0.00021 $0.00392
Haiku 4.5 $0.00011 $0.00196

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

Security

Grade A, and why

benchmark-model-kernels 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 2d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (scripts/benchmark_model.py, scripts/benchmark_via_builtin.py, tests/test_benchmark_model.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

plugins/modelopt/skills/benchmark-model-kernels/SKILL.md · 146 lines

How it starts

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

Benchmark Model Kernels

Plan a single-GPU microbenchmark for the per-rank shapes of an intended deployment. The scripts never load checkpoint weights, launch distributed workers, or measure collectives, serving throughput, or request latency.

Interview, one decision per message

Ask exactly one unresolved decision per message with two or three concrete options, state the default, and wait for the answer. Recommend an option only when it is substantively better. Skip decisions already answered. Follow this order:

  1. Model — a local directory, a config.json, or a Hub ID (equivalent; no default). The script builds the model on meta tensors from configuration only. Do not enable --trust-remote-code without explicit approval; pin --revision <commit> when it is needed.

  2. TP and EP — accept both directly, or derive them from the intended deployment's GPU model and count and confirm. Defaults: TP=1, EP=1. Derive parallelism from the intended deployment, never from the GPU that runs the microbenchmark. The script validates every sharding rule (divisibility, GQA replication, expert partitioning) and errors loudly.

  3. M sweep — balanced default (recommended): 1 8 64 512; decode-focused: 1 4 16 32; throughput-focused: 64 256 1024 4096. M is roughly the tokens scheduled per step (decode: active sequences), not endpoint concurrency. With EP, an MoE row models one rank's share of the global batch: a global batch of B tokens corresponds to the column M = B/EP, so do not compare different EP values at the same M.

  4. Shape preview — always run this before anything else; no FlashInfer or GPU needed:

    python "$SKILL_DIR/scripts/benchmark_model.py" <model> \
      --tp <tp> --ep <ep> --ms <m1> <m2> ... --print_only
    

    Review the printed shapes and the MoE tuple with the user. # unsupported: lines mean the list is partial and the script exits nonzero — handle those via Manual supplements below.

  5. FlashInfer checkout and GPU — the full benchmark needs a FlashInfer source checkout containing benchmarks/flashinfer_benchmark.py; the installed wheel alone is not enough. Prefer a clean checkout matching the installed flashinfer version; ask before cloning or installing anything. On the benchmark machine, check nvidia-smi and package versions, verify the target GPU is idle (concurrent work on the same GPU skews timings), and verify CUPTI timing with a tiny bench_gpu_time(..., enable_cupti=True) probe — a warning that falls back to CUDA events is a failure (the cupti-python/nvidia-cuda-cupti packages must match PyTorch's CUDA major). Ask for a GPU index only when several are visible. Pick a fresh workdir and state it.

  6. Full benchmark:

Read the full file on GitHub · 146 lines

Files

What ships with it

4 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. 2d ago First seen · 146 lines · 105 tokens per session scan A d1e3238ea29c

Subscribe to this mod's changes

benchmark-model-kernels is a skill published in the GitHub repository NVIDIA/Model-Optimizer (3,612 stars, last pushed 2d ago), licensed Apache-2.0. It adds 105 tokens to every session and 1,962 once invoked, about $0.0005 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.

Related

Other skills, from other repositories

nemoclaw-contributor-implement-issue

Implement an accepted NemoClaw GitHub issue in the current checkout. Use when a user asks to pick up an issue for implementation, implement or fix a named issue, or add the issue's tests. Confirm accepted scope, deliver the smallest independently valuable capability slice, and record validation and remaining gates…

NVIDIA/NemoClaw · 134 tokens

amazon-bestseller-listing

Amazon Best Sellers listing scraper: extract product cards from any Amazon Best Sellers (zgbs) or /gp/bestsellers/ category page — returns rank (position on chart), asin, title, url, image, imageAlt, price, stars, reviewCount, ratingRaw per item, plus category metadata (categoryName, categoryFullName, categoryUrl) and…

browser-act/skills · 300 tokens

amazon-reviews-api-skill

This skill helps users automatically extract Amazon product reviews via the Amazon Reviews API. Agent should proactively apply this skill when users express needs like getting reviews for Amazon product with ASIN B07TS6R1SF, analyzing customer feedback for a specific Amazon item, getting ratings and comments for a…

browser-act/skills · 124 tokens

amazon-competitor-analyzer

Scrapes Amazon product data from ASINs using browseract.com automation API and performs surgical competitive analysis. Compares specifications, pricing, review quality, and visual strategies to identify competitor moats and vulnerabilities.

browser-act/skills · 48 tokens

cabloy-worktree-environment

This skill must be used only when the user explicitly invokes /cabloy-worktree-environment or explicitly asks to perform the named Cabloy worktree-environment setup. It prepares a confirmation-gated, worktree-local Vona and Zova runtime environment for a linked Cabloy Basic or Cabloy Start Git worktree using Git…

cabloy/cabloy · 126 tokens

shopify-hydrogen

Hydrogen storefront implementation cookbooks. Some of the available recipes are: B2B Commerce, Bundles, Combined Listings, Custom Cart Method, Dynamic Content with Metaobjects, Express Server, Google Tag Manager Integration, Infinite Scroll, Legacy Customer Account Flow, Markets, Partytown + Google Tag Manager…

Shopify/Shopify-AI-Toolkit · 106 tokens