torch-xpu-bench

torch-xpu-bench is a skill for Claude Code from intel/gpu-ai-skills. It costs 96 tokens per session (2,054 once invoked), scanned A, original, Apache-2.0.

A benchmark tool for measuring Hugging Face models running through PyTorch on an Intel GPU. It records generation speed, first-token delay, decode-step latency, and peak GPU memory for a single process.

In plain words
What is it for?
Use it to compare data types or compilation settings, measure single-sequence generation, check whether a model fits in GPU memory, and benchmark diffusion or encoder-only models.
Why use it?
It gives comparable measurements without the extra effects of an HTTP server or multi-request serving system.

Skill for Claude Code ✓ vendor

Written for Claude Code: shipped in a Claude Code plugin.

Part of the intel-gpu-ai-skills plugin — 21 skills, 1 agent shipped together

Good fit Use it to compare data types or compilation settings, measure single-sequence generation, check whether a model fits in GPU memory, and benchmark diffusion or encoder-only models.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/intel/gpu-ai-skills/torch-xpu-bench
About the project

Intel GPU AI Skills is a collection of agent skills for setting up, running, benchmarking, and profiling Hugging Face models on Intel GPUs. It supports workflows involving PyTorch, vLLM-XPU, SGLang-XPU, llama.cpp-SYCL, and migration from CUDA to XPU. The catalogue contains the project's skills, instructions, agent, and plugin.

intel/gpu-ai-skills · 21 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.

Any agent
npx skills add intel/gpu-ai-skills --skill torch-xpu-bench
Clone the repo
git clone --depth 1 https://github.com/intel/gpu-ai-skills

Made for: Claude Code.

Or install intel-gpu-ai-skills, the plugin that ships this one along with the rest of its 21 skills, 1 agent.

Its marketplace also offers this one on its own, as the plugin torch-xpu-bench/plugin install torch-xpu-bench after adding the marketplace above.

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 torch-xpu-bench

README.md
[![agentmods](https://agentmods.dev/badge/skills/intel/gpu-ai-skills/torch-xpu-bench/github.svg)](https://agentmods.dev/skills/intel/gpu-ai-skills/torch-xpu-bench)
Your own site
<a href="https://agentmods.dev/skills/intel/gpu-ai-skills/torch-xpu-bench"><img src="https://agentmods.dev/badge/skills/intel/gpu-ai-skills/torch-xpu-bench/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for torch-xpu-bench

Your own site · 80×15
<a href="https://agentmods.dev/skills/intel/gpu-ai-skills/torch-xpu-bench"><img src="https://agentmods.dev/badge/skills/intel/gpu-ai-skills/torch-xpu-bench.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,054 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00096 $0.02054
Opus 5 $0.00048 $0.01027
Sonnet 5 $0.00019 $0.00411
Haiku 4.5 $0.00010 $0.00205

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

Security

Grade A, and why

torch-xpu-bench 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 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/bench.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/intel-gpu-ai-skills/skills/torch-xpu-bench/SKILL.md · 198 lines

How it starts

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

torch-xpu-bench

Pure-PyTorch benchmarks of HF models on XPU. Measures bare model.generate() with no scheduler, no continuous batching, no API overhead. For serving-shape numbers (TTFT/TPOT/ITL under concurrency) use vllm-xpu-bench.

Important: This skill provides a ready-to-use benchmark script at {base_dir}/scripts/bench.py. Do not write your own benchmark script; use the provided one.

Use cases:

  • TTFT and decode rate of a single sequence at a given dtype.
  • A/B dtypes (bf16 vs fp16), compile on/off, model size.
  • Confirm --enforce-eager is hurting in vLLM before flipping it.
  • Validate model-can-it-fit predictions against max_memory_allocated.

For diffusion and encoder-only models, see references/non-llm-snippets.md.

CUDA → XPU translation

CUDA XPU
torch.cuda.synchronize() torch.xpu.synchronize()
torch.cuda.Event(enable_timing=True) torch.xpu.Event(enable_timing=True)
torch.cuda.max_memory_allocated() torch.xpu.max_memory_allocated()
torch.cuda.reset_peak_memory_stats() torch.xpu.reset_peak_memory_stats()
torch.cuda.empty_cache() torch.xpu.empty_cache()

Two gotchas:

  • Synchronise before timing. XPU kernels launch async; without torch.xpu.synchronize() you measure launch latency.
  • Warm up. First call compiles XPU Triton kernels; first compiled-graph call triggers capture. Discard the first 1–3 runs.

Hosts with non-Intel GPUs

If nvidia-smi or rocm-smi reports hardware, bench code that doesn't pin a device may silently land on CUDA/ROCm. Defences:

export CUDA_VISIBLE_DEVICES=     # hide all NVIDIA
export HIP_VISIBLE_DEVICES=      # hide all AMD ROCm
export ZE_AFFINITY_MASK=0        # pick a specific Intel device

scripts/bench.py asserts model parameters land on xpu after from_pretrained; replicate in your own benches. Cross-check with xpu-smi dump -d 0 -m 5 — if XPU memory doesn't climb, the bench is on the wrong device.

These all load onto xpu:0 when only an Intel XPU is visible: device_map="xpu" / "xpu:0" / 0 / "auto" / {"": "xpu"} / {"": 0}. hf_device_map is empty for whole-model placement; populates only on multi-GPU splits.

Read the full file on GitHub · 198 lines

Files

What ships with it

2 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. 9d ago First seen · 198 lines · 96 tokens per session scan A fcc69d2680fd

Subscribe to this mod's changes

torch-xpu-bench is a skill published in the GitHub repository intel/gpu-ai-skills (21 stars, last pushed 4d ago), licensed Apache-2.0. It adds 96 tokens to every session and 2,054 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

agent-platform-rag-engine-management

Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google…

google/skills · 85 tokens

agent-platform-model-registry

Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.

google/skills · 60 tokens

foundry-config-setup

Resolve missing setup caused by a hardcoded Foundry project endpoint or model in a sample. Use when a sample fails because it uses a placeholder/hardcoded projectendpoint (for example "https://your-project.services.ai.azure.com") or a hardcoded model instead of reading them from the environment.

microsoft/agent-framework · 65 tokens

google-cloud-solution-agentic-analytics-spark-knowledge-catalog

Discovers requirements and generates guidance to design and deploy a governed, secure agentic-analytics solution for data that's distributed across Google Cloud, other cloud providers, or on-premises. Data that's outside Google Cloud (such as data from Databricks, Snowflake, Salesforce, SAP, or Oracle systems) is…

google/skills · 138 tokens

training-check

Interactively monitor training metrics from the current Codex session, periodically checking WandB or fallback logs for NaN, divergence, plateaus, and broken runs.

wanshuiyin/Auto-claude-code-research-in-sleep · 35 tokens

nemo-automodel-launcher-config

Configure NeMo AutoModel job launches for interactive runs, Slurm clusters, and SkyPilot cloud execution.

NVIDIA/skills · 30 tokens