xpu-port

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

A tool for changing a PyTorch codebase from CUDA, NVIDIA's GPU programming platform, to Intel XPU, Intel's accelerator platform. It scans Python code, applies specified rewrites, and checks one model pass against a CPU reference.

In plain words
What is it for?
Use it to scan CUDA call sites, preview or apply mechanical Python changes, and verify one forward pass using CPU FP64 results as the reference.
Why use it?
It reduces repetitive edits when moving a single-target PyTorch project from CUDA to XPU. It does not handle running the same code on both CUDA and XPU or non-Python files.

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 scan CUDA call sites, preview or apply mechanical Python changes, and verify one forward pass using CPU FP64 results as the reference.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/intel/gpu-ai-skills/xpu-port
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 xpu-port
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 xpu-port/plugin install xpu-port 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 xpu-port

README.md
[![agentmods](https://agentmods.dev/badge/skills/intel/gpu-ai-skills/xpu-port/github.svg)](https://agentmods.dev/skills/intel/gpu-ai-skills/xpu-port)
Your own site
<a href="https://agentmods.dev/skills/intel/gpu-ai-skills/xpu-port"><img src="https://agentmods.dev/badge/skills/intel/gpu-ai-skills/xpu-port/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 xpu-port

Your own site · 80×15
<a href="https://agentmods.dev/skills/intel/gpu-ai-skills/xpu-port"><img src="https://agentmods.dev/badge/skills/intel/gpu-ai-skills/xpu-port.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 193 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,504 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.00193 $0.02504
Opus 5 $0.00097 $0.01252
Sonnet 5 $0.00039 $0.00501
Haiku 4.5 $0.00019 $0.00250

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

Security

Grade A, and why

xpu-port 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 10d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/xpu_port_rewrite.py, scripts/xpu_port_scan.py, scripts/xpu_port_verify.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/xpu-port/SKILL.md · 232 lines

How it starts

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

xpu-port

Three deterministic scripts; the agent drives the loop.

scripts/
├── xpu_port_scan.py     # libcst, classifies sites mechanical/semantic/escalate
├── xpu_port_rewrite.py  # libcst, named transforms, --check previews diff
└── xpu_port_verify.py   # CPU FP64 reference vs target dtype, one forward
pip install libcst

Targets

Single-target XPU only. After the port, the codebase runs on Intel XPU. CUDA call sites are rewritten, not dual-gated. If the user wants both CUDA and XPU at runtime (dual-target), stop and say so — that's a different problem (per-call-site guards, device-aware factories) and this skill produces broken half-ported code if used for it.

Backstop — wrong entry point

This skill executes; it does not assess or route. One redirect exists, pointing one way. If the request is really an assessment or a whole-repo migration ("migrate this repo", "what would it take to run on XPU" — scope not yet set), hand it to cuda-to-xpu-migration and stop; its report's Next steps lead back here for the Python surface.

The same backstop covers mis-scoped ports. This skill reads Python source only — its gates say nothing about Dockerfiles, launch scripts, or dependency pins. When no migration report is in hand and the step-1 scan comes back empty while its advisory flags NVIDIA/CUDA infrastructure surfaces, the port was mis-scoped: hand it to cuda-to-xpu-migration and stop. When a migration report is in hand, execute the Python surface it scoped and list its non-Python surfaces as documented-not-rewritten — an advisory on the final scan does not reopen this gate (see step 5).

Procedure

The port's minimum gate is final scan empty + verifier green. Both are necessary; neither alone is sufficient (for service repos with no single forward, the serving skill's smoke test stands in for the verifier — see step 6).

Important: the verifier confirms one forward pass is numerically correct — it does not confirm the training loop runs end-to-end (e.g. torch.compile, custom LR schedulers, or data-loader workers may still fail on XPU). After the gates pass, run at least 2 real training iterations on the target device before declaring the port complete.

Read the full file on GitHub · 232 lines

Files

What ships with it

5 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. 10d ago First seen · 232 lines · 193 tokens per session scan A 9a302ca94299

Subscribe to this mod's changes

xpu-port is a skill published in the GitHub repository intel/gpu-ai-skills (21 stars, last pushed 5d ago), licensed Apache-2.0. It adds 193 tokens to every session and 2,504 once invoked, about $0.0010 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

cardputer-buddy

Iterate on the Cardputer-Adv MicroPython app bundle (Claude Buddy, Snake, Hello) after the device is already provisioned via m5-onboard. Use when the user wants to add a new app, push a single changed .py without re-flashing, watch device serial logs, or run a one-shot REPL command. Trigger on "add an app", "push to…

anthropics/claude-plugins-official · 109 tokens

holoscan-install-wheel

Install Holoscan SDK Python wheel via pip into a venv. Use for Python installs; not for native C++/apt or Conda installs.

NVIDIA/skills · 37 tokens

HA Integration Dev

Home Assistant custom integration development in Python. Covers customcomponents, DataUpdateCoordinator, configflow, OAuth2, conversation agent, HACS publishing, device registry, entity platforms, services, repair issues, diagnostics, Bluetooth integrations, and multi-coordinator patterns.

tonylofgren/aurora-smart-home · 55 tokens

triton-ascend

A guide to writing Triton kernels for Ascend NPUs. Triton is a Python-based language for describing parallel operations that run in blocks across the device.

mindspore-ai/akg · 28 tokens

triton-ascend-case-index-put

An optimization pattern for indexed assignment, which writes values into positions chosen by index arrays. It loads index data into fast on-chip memory so a loop can reuse it.

mindspore-ai/akg · 73 tokens

triton-lang

Triton language skill for Python GPU kernel authoring. Use when writing Triton kernels with @triton.jit, tl.load/store, masking, atomics, benchmarking with triton.testing, or integrating kernels into PyTorch. Activates on queries about Triton, tl.constexpr, block pointers, Triton benchmarking, or PyTorch custom ops.

mohitmishra786/low-level-dev-skills · 76 tokens