MCPInstall

magpie-kernel-evaluator

Benchmarks LLM inference and drives GPU kernel optimization with Magpie. Use when the user wants to benchmark vLLM, SGLang, or Atom; capture torch traces; post-process inference traces with TraceLens into prefill/decode and roofline reports; identify top bottleneck kernels or map profiler names to source; analyze or compare HIP, CUDA, PyTorch, or Triton kernels; validate and rank optimized variants; run local, container, or Ray workloads; or mentions Magpie, TraceLens, gap analysis, TTFT, TPOT, kernel evaluation, or AMD GPU optimization.

Installs
886
Last 24h
+18
Trending rank
#6248
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/amd/skills --skill magpie-kernel-evaluator
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads magpie-kernel-evaluator automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Magpie

Use Magpie for three connected jobs:

  1. Benchmark an inference workload and collect throughput, latency, and traces.
  2. Analyze or compare GPU kernels for correctness and performance.
  3. Drive an optimization loop from a benchmark bottleneck to source, candidate kernels, and end-to-end validation.

Describe only capabilities supported by the checked-out Magpie version. Do not infer support for an unverified ROCm, GPU, framework, or experimental integration.

Choose the workflow

User goalWorkflow
Evaluate one implementationanalyze
Rank two or more implementationscompare
Measure model-serving performancebenchmark
Find expensive kernels in existing tracesstandalone gap analysis
Explain a profiled inference workloadbenchmark → TraceLens post-processing → stage/roofline review
Optimize an end-to-end workloadbenchmark → TraceLens/gap analysis → source mapping → analyze/compare → re-benchmark

Use a YAML config for reproducible or multi-step work. Use inline CLI arguments for small exploratory runs.

Preflight

Installing this skill does not install the Magpie application (magpie-eval). For a preparation-only request, read the supplied fixtures and reference.md, write the requested plan or configuration, and identify commands that remain unverified. Do not install packages or execute a workload when the user forbids it; a missing Magpie installation does not prevent preparing a plan.

Before executing a Magpie workload:

  1. Check magpie --help in the intended Python environment (Python 3.10+). If the command is missing, try python -m Magpie --help in that same environment; a working module entry point can be used instead of the CLI. No module named Magpie means the application is not installed in that environment. For errors inside an installed Magpie package, diagnose the reported import or dependency failure instead.

  2. If Magpie is not installed, install it in the intended environment before continuing:

    python -m pip install git+https://github.com/AMD-AGI/Magpie.git
    

    For an existing Magpie source checkout, use python -m pip install -e /path/to/Magpie instead. The installed skill folder and a testcase workspace are not Magpie source checkouts. Re-run magpie --help or python -m Magpie --help to verify the installation; if it fails, report the error before attempting a workload.

  3. Inspect the installed interface for the selected workflow (substitute python -m Magpie if using the module entry point):

    magpie --help
    magpie analyze --help
    magpie compare --help
    magpie benchmark --help
    magpie --gpu-info
    
  4. Check required tools, model access, GPU visibility, writable output space, and container or Ray access as applicable. Installing the Python package does not install ROCm/CUDA, profilers, or model weights.

  5. Read the repository compatibility matrix before making version claims. Treat ROCm or hardware not listed there as unverified until tested.

  6. Record the exact config, model revision, image, environment variables, GPU allocation, and Magpie commit for benchmark comparisons.

Analyze a kernel

Prefer a config when correctness or profiler settings matter:

magpie analyze --kernel-config path/to/kernel.yaml

For a quick single-kernel run:

magpie analyze path/to/kernel.hip --type hip --testcase "./run_test.sh"

Supported public kernel types are hip, cuda, pytorch, and triton. Use --no-perf only when the user wants correctness or execution validation without profiling.

Do not equate successful execution with numerical correctness. Supply a representative testcase whenever an optimized result will be accepted or rejected.

Compare kernel variants

Compare at least two implementations and identify the baseline explicitly:

magpie compare --kernel-config path/to/compare.yaml

Keep inputs, tolerances, warmup, iteration count, GPU allocation, and profiler settings identical across candidates. Reject candidates that fail correctness before considering performance rankings.

For PyTorch without a testcase, Magpie's built-in check only verifies that each result is finite; it does not prove numerical equivalence between variants. Require a testcase for numerical validation.

Benchmark inference

Prefer a checked-in benchmark config:

magpie benchmark --benchmark-config path/to/benchmark.yaml

The stable public CLI supports vllm, sglang, and atom. It supports direct docker and local run modes; use YAML configuration and the repository's Ray examples for distributed execution. Do not advertise integrations that exist only in internal enums or partial code paths as stable.

Enable profiling deliberately: profiler runs perturb latency and should not replace a clean baseline. Compare throughput, completed requests, TTFT, TPOT, ITL, and end-to-end latency using equivalent workloads.

Post-process traces with TraceLens

Enable TraceLens in the profiled benchmark YAML; torch traces are its required input:

benchmark:
  profiler:
    torch_profiler:
      enabled: true
    tracelens:
      enabled: true
      analysis_mode: inference
      analysis_stages: all
      export_format: csv

Use analysis_mode: inference for vLLM/SGLang. It splits the rank-0 trace into prefilldecode, decode, and prefill stages when available, runs TraceLens post-processing, and writes full stage reports plus compact *_kernel_roofline_simple.csv files under the benchmark workspace's tracelens/ directory. For direct PyTorch trace reporting, use analysis_mode: pytorch.

Open the compact roofline CSVs first. Rank rows by kernel_time_ms_sum or time_pct; then use roofline_bound, arithmetic intensity, achieved TFLOP/s or TB/s, and pct_roofline_mean to form an optimization hypothesis. Confirm benchmark_report.json.tracelens_analysis has outputs and no error before treating post-processing as successful. Use analysis_mode: pytorch when the task specifically needs the legacy direct single-rank or multi-rank collective reports.

Magpie's integrated TraceLens stage produces CSV/Excel analysis artifacts, not an agent-written analysis.md. If the user requests a prioritized agentic report, pass the captured trace to the separate tracelens-analysis-orchestrator skill when installed; keep that result distinct from Magpie's benchmark report.

Analyze existing traces and find source

Run standalone gap analysis with --trace-dir directly on benchmark:

magpie benchmark \
  --trace-dir path/to/torch_trace \
  --top-k 20 \
  --find-kernel-sources \
  --kernel-source-repos path/to/repository

Do not insert a gap-analysis positional token; it is not a CLI subcommand. Inspect the generated aggregate and per-rank CSVs, and preserve source-mapping confidence rather than assuming every normalized kernel name maps uniquely.

Drive the optimization loop

  1. Run an unprofiled baseline benchmark and save its config and report.
  2. Repeat with torch profiling and TraceLens inference post-processing enabled.
  3. Review stage-level TraceLens roofline summaries to classify dominant operations and likely compute, memory, or communication limits.
  4. Run gap analysis over the representative steady-state window to rank concrete kernels.
  5. Select bottlenecks by total contribution, not only single-dispatch duration.
  6. Map the selected kernel to source and an executable testcase.
  7. Generate isolated candidate implementations; preserve the baseline.
  8. Use analyze for iteration, then compare with correctness gates to rank candidates.
  9. Re-run the original unprofiled benchmark with the winning candidate and the same workload. Report both kernel-level and end-to-end changes, including regressions.

Stop before claiming success if correctness is unproven, the benchmark inputs changed, the source mapping is uncertain, or the end-to-end improvement is within run-to-run noise.

Use MCP tools when available

Prefer Magpie MCP tools for structured agent workflows such as hardware inspection, kernel discovery, config generation, analyze/compare, optimization suggestions, result lookup, report comparison, Ray job management, and benchmark batches.

Do not pass a CLI analyze_report.json wrapper directly to an MCP tool that expects one result object's performance_state and performance_result. Do not assume every CLI option exists in MCP; kernel-source enrichment is currently exposed by the CLI gap-analysis path.

Additional resources

  • Full CLI reference: reference.md
  • Copy-paste command examples: examples.md

FAQ

What does the magpie-kernel-evaluator skill do?

Benchmarks LLM inference and drives GPU kernel optimization with Magpie. Use when the user wants to benchmark vLLM, SGLang, or Atom; capture torch traces; post-process inference traces with TraceLens into prefill/decode and roofline reports; identify top bottleneck kernels or map profiler names to source; analyze or compare HIP, CUDA, PyTorch, or Triton kernels; validate and rank optimized variants; run local, container, or Ray workloads; or mentions Magpie, TraceLens, gap analysis, TTFT, TPOT, kernel evaluation, or AMD GPU optimization.

How do I install magpie-kernel-evaluator?

Run npx skills add https://github.com/amd/skills --skill magpie-kernel-evaluator in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/magpie-kernel-evaluator/ (personal) or .claude/skills/magpie-kernel-evaluator/ (project).

Which AI agents can use magpie-kernel-evaluator?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is magpie-kernel-evaluator safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains magpie-kernel-evaluator?

It is published by amd in amd/skills. It has 886 recorded installs.

More from amd/skills

View all →

local-ai-use

amd/skills

Makes this agent generate images, transcribe audio, and synthesize speech on the user's own machine through a local Lemonade Server instead of a paid cloud API. Use it above all to change that routing persistently, from now on — keep generating pictures locally while chat stays on the cloud; set this workspace up to make images on my own machine — even when the user asks for no image or file in the same breath. Also use it for a single request the user wants done locally, offline, on-device, or kept private: transcribe this recording, make this picture, read this text aloud. Applies in Claude, Cursor, Codex, or any agent harness. Use when the user wants to cut cost or tokens on image, audio, or voice API calls, or to drop DALL-E, hosted Whisper, ElevenLabs, or other paid multimodal APIs; or mentions Lemonade Server, OmniRouter, SD-Turbo, kokoro, Ryzen AI, or NPU/iGPU/dGPU inference. Changes no application source code; do not use it if the user is adding local AI to an app they ship.

Media & Creative1.1K installs

Integrates local AI capabilities into applications using Embeddable Lemonade. Use when the user wants to add local AI, offline AI, private AI, on-device AI, a local LLM, local chat, embeddings, image generation, speech-to-text, or text-to-speech to an existing app; replace or supplement OpenAI, Anthropic, Ollama, or other cloud AI APIs with a local backend; only use to convert user apps. Do not use when the user just wants the agent itself to generate images, transcribe, or speak locally in the current workspace, even to cut their own API bill.

AI & Agents913 installs

Orchestrates modular PyTorch profiler trace analysis with TraceLens: generates perf reports, prepares category data, runs system-level and compute-kernel subagents in parallel, validates outputs, and writes a prioritized stakeholder report (analysis.md). Use when the user asks to follow the analysis orchestrator, run the agentic analysis workflow, analyze a trace, compare two traces, or mentions standalone or comparative TraceLens analysis.

AI & Agents895 installs

Serves AI models on AMD Instinct GPU hardware using vLLM. Use this skill whenever the user wants to run, serve, deploy, start, host, or launch a language model on an AMD GPU, AMD Instinct, MI300X, MI325X, MI350X, or MI355X. Also use when the user mentions vLLM on ROCm, vLLM on AMD, serving on HBM, or asks how to get a model running on AMD data center hardware. Use when the user asks "run Qwen3", "serve DeepSeek", "start a vLLM endpoint", "get a model running on my AMD machine", or any similar phrasing. Handles the full flow: GPU detection, environment validation, vLLM configuration, launch, and health verification. Do not use for NVIDIA GPUs, consumer AMD GPUs (RX series, Radeon), Ryzen AI, NPU, MI250X, or MI100.

AI & Agents894 installs

Serves an LLM on a supported AMD EPYC server CPU using vLLM with zentorch, in Docker, Podman, or conda. Use for "vLLM on CPU", "zentorch serving", or an EPYC CPU endpoint, including on a host that also has AMD Instinct GPUs. Detects the EPYC generation, validates the runtime, checks model support and RAM fit, sizes threads/KV/NUMA, confirms the plan, launches, and verifies the endpoint. Runs one instance on one socket and its memory. Reports and stops on failure; does not retry or debug. Use serving-llms-on-instinct when the endpoint should run on a GPU. Excludes multi-node, EPYC 4000, and pre-Zen4 EPYC without AVX-512.

AI & Agents835 installs

Turns a natural-language description of routing intent into a valid Lemonade collection.router policy JSON. The skill generates and validates the JSON only - it does not register it or call the live server. Use when the user wants to route requests between models ("route sensitive queries to X and everything else to Y"), generate a router/hybrid-router config or policy, author a collection.router JSON, split traffic between a small local model and a big/cloud model, add PII/jailbreak/topic classifiers to routing, or mentions Lemonade Router, routing rules, routing.router, candidates/defaultmodel, keywordsany, semanticsimilarity, or LLM-as-router. Fills every field the user did not specify with safe defaults.

Backend & APIs809 installs

Popular ai & agents skills

View category →

google-agents-cli-publish

google/agents-cli

This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).

AI & Agents513.9K installs

google-agents-cli-eval

google/agents-cli

This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).

AI & Agents513.5K installs

skill-creator

anthropics/skills

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

OfficialAI & Agents416.4K installs

codex-pet

prime-skills/runcomfy-agent-skills

Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.

AI & Agents402.1K installs

full-output-enforcement

leonxlnx/taste-skill

Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.

AI & Agents401K installs

executing-plans

obra/superpowers

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

AI & Agents245.7K installs