Official agent skill

Xpu Build Pytorch

by intel in intel/torch-xpu-ops

Build PyTorch from source with Intel XPU (GPU) support. An agent skill from intel/torch-xpu-ops.

OfficialApache-2.0Auto-check passedAI & LLM Engineering

Install Xpu Build Pytorch

skills CLI
$ npx skills add intel/torch-xpu-ops --skill xpu-build-pytorch -a claude-code

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

GitHub CLI
$ gh skill install intel/torch-xpu-ops xpu-build-pytorch --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/intel/torch-xpu-ops.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/xpu-build-pytorch .claude/skills/xpu-build-pytorch && 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
xpu-build-pytorch
GitHub stars
115
Token cost
~939 tokens
SKILL.md length
270 words
Files
2
Skills in repo
29
Repo updated
First seen
Licence
Apache-2.0

At a glance

Build PyTorch from source with Intel XPU (GPU) support. An agent skill from intel/torch-xpu-ops.

  • Works in 4 steps: Verify prerequisites → Configure build_pytorch.env → Build → …
  • The user asks to build PyTorch
  • SKILL.md covers Instructions, Best practices, Requirements and Advanced usage
  • Calls pip, git and python

What it does

Xpu Build Pytorch is an agent skill from intel/torch-xpu-ops, published by the product's own GitHub organization. Build PyTorch from source with Intel XPU (GPU) support. Use when the user asks to build PyTorch, set up the XPU build environment, rebuild after code changes, install PyTorch for XPU, or configure oneAPI. Handles prerequisites check, buildpytorch.env setup, build verification, and torch-xpu-ops development pin override.

Its SKILL.md is about 940 tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `reference.md`).

It sits in AI & LLM Engineering, covering Deep learning. It works with PyTorch and C++. The licence is Apache-2.0.

When your agent uses it

  • The user asks to build PyTorch
  • Set up the XPU build environment
  • Rebuild after code changes
  • Install PyTorch for XPU

Example prompts

  • “/xpu-build-pytorch”

Requirements

  • Python 3

Workflow steps

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

  1. Verify prerequisites
  2. Configure build_pytorch.env
  3. Build
  4. Verify

What it can do on your machine

Read from SKILL.md and the folder at commit a033aa5. 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

    Shell commands in SKILL.md call:

    • pip
    • git
    • python

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

  • Network

    No URLs in SKILL.md. Its commands use pip and git, which can reach the network depending on how they are called.

    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

Xpu Build Pytorch loads about 939 tokens when it runs. Until then it costs about 85 tokens; SKILL.md has 270 words of instructions outside code blocks.

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

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from intel/torch-xpu-ops at commit a033aa5, republished under its Apache-2.0 licence (© intel). 270 words, ~939 tokens.

Download SKILL.mdSave it as .claude/skills/xpu-build-pytorch/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
xpu-build-pytorch
description
Build PyTorch from source with Intel XPU (GPU) support. Use when the user asks to build PyTorch, set up the XPU build environment, rebuild after code changes, install PyTorch for XPU, or configure oneAPI. Handles prerequisites check, build_pytorch.env setup, build verification, and torch-xpu-ops development pin override.

Build PyTorch with XPU Support

The only build command is pip install -e . -v --no-build-isolation. Never use any other command.

The ## Build section of AGENTS.md covers the baseline: the build command, the BUILD_SEPARATE_OPS flag, and the xpu.txt commit-pin override for local development. This skill extends that with XPU-specific prerequisites (oneAPI) and a step-by-step verification workflow.

Instructions

Always check local memory for build configuration (env vars, paths, incremental-build shortcuts) before running the build. Apply what you find; if nothing applicable is in memory, ask the user.

1. Verify prerequisites
bash
# Confirm in PyTorch root (xpu.txt is unique to this repo)
test -f third_party/xpu.txt || echo "ERROR: Not in PyTorch root"

# Verify oneAPI installation (icpx not in PATH before sourcing vars — check directory instead)
test -d /opt/intel/oneapi/compiler || echo "WARNING: oneAPI not found at /opt/intel/oneapi/compiler"
2. Configure build_pytorch.env

Create in PyTorch root. Adjust paths for your system.

bash
# Target hardware: pvc (Data Center GPU Max), dg2 (Arc GPU), etc.
# Omitting targets all supported architectures — safe default.
# export TORCH_XPU_ARCH_LIST=pvc

export USE_XPU=1
export USE_CUDA=0

# Adjust to your oneAPI installation path
source /opt/intel/oneapi/compiler/latest/env/vars.sh
# Alternative: source /opt/intel/oneapi/setvars.sh
# Optional PTI support: source /opt/intel/oneapi/pti/latest/env/vars.sh
3. Build

Always redirect build output to a log file so failures can be diagnosed:

bash
source build_pytorch.env
pip install -e . -v --no-build-isolation 2>&1 | tee /tmp/pytorch_build_$(date +%Y%m%d_%H%M%S).log
echo "Build log saved to /tmp/pytorch_build_*.log"
4. Verify
bash
source build_pytorch.env
python -c "import torch; print('XPU available:', torch.xpu.is_available())"

Expected: XPU available: True

Best practices

  • Never skip sourcing build_pytorch.env before running tests — XPU ops are unavailable without the oneAPI runtime.
  • Always rebuild after git rebase or git checkout — stale C++ extensions produce unreliable or silently wrong test results.
  • Faster iteration builds: set BUILD_SEPARATE_OPS=1 to shrink translation unit scope. Debug/RelWithDebInfo builds enable this automatically.
    bash
    BUILD_SEPARATE_OPS=1 pip install -e . -v --no-build-isolation 2>&1 | tee /tmp/pytorch_build_$(date +%Y%m%d_%H%M%S).log
  • After editing a C++ header: manually copy to torch/include/ — editable installs serve C++ headers from the installed path, not source.
  • After modifying inductor headers: delete the PCH cache before rebuilding:
    bash
    rm -rf /tmp/torchinductor_$USER/precompiled_headers/
  • Leave TORCH_XPU_ARCH_LIST commented out unless you know your target hardware — setting pvc on an Arc GPU produces a silently incorrect build.

Requirements

  • Intel oneAPI Base Toolkit installed (provides icpx, libsycl, DPC++ runtime)
  • PyTorch cloned from source with third_party/torch-xpu-ops populated
  • Python environment with build dependencies (ninja, cmake, pyyaml, typing_extensions)

Advanced usage

For developing torch-xpu-ops locally (commit pin override so CMake does not overwrite your changes on every build), see reference.md.

© intel, 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 1 other file in .claude/skills/xpu-build-pytorch of intel/torch-xpu-ops.

  • SKILL.md
  • reference.md

Open the folder on GitHubat commit a033aa5

Compare with similar skills

Xpu Build Pytorch 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.

Xpu Build Pytorch compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Xpu Build Pytorch this skillintel/torch-xpu-ops115—~939Automated safety check: PassApache-2.0
Ako4allTongmingLAIC/AKO4ALL369—~4kAutomated safety check: PassMIT
Paddle Op DevPaddlePaddle/Paddle24k—~1.3kAutomated safety check: PassApache-2.0
Embedded AI Deploymentmatlab/agent-skills-playground1811 repos~3.4kAutomated safety check: PassCustom licence
Qualcomm QNN Backend Developmentpytorch/executorch5.1k—~1.8kAutomated safety check: PassCustom licence
Paddle Cross Ecosystem Custom OpPaddlePaddle/Paddle24k—~883Automated safety check: PassApache-2.0

Similar skills

  • Ako4all

    TongmingLAIC/AKO4ALL

    Drive an agentic loop that iteratively optimizes a GPU kernel for maximum speedup.

    369 GitHub stars~4k tokensUpdated 23 days ago
    AI & LLM EngineeringAuto-check passed
  • Paddle Op Dev

    PaddlePaddle/Paddle

    PaddlePaddle (飞桨) C++ 算子开发指南。提供从 YAML 配置、InferMeta 函数、Kernel 实现、Python API 封装、单元测试到编译验证的完整算子开发流程指导。在以下场景使用此 skill:(1) 为 Paddle 框架新增 C++ 算子 (2) 修改或调试已有 Paddle 算子 (3) 编写算子的 YAML…

    24k GitHub stars~1.3k tokensUpdated 8 days ago
    AI & LLM EngineeringAuto-check passed
  • Embedded AI Deployment

    matlab/agent-skills-playground

    Deploy AI models to embedded hardware using MathWorks tools (MATLAB, Simulink, Embedded Coder).

    181 GitHub starsUsed in 1 repo~3.4k tokens
    AI & LLM EngineeringAuto-check passed
  • Helps build, test and extend the Qualcomm AI Engine Direct (QNN) backend in ExecuTorch, with routes for new ops, model export, Buck-vs-CMake parity fixes and per-layer accuracy debugging.

    5.1k GitHub stars~1.8k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • 将原生 PyTorch 自定义算子库、Torch extension、生态库(TorchCodec/FlashInfer/DeepEP 等)以及 Kernel DSL 生态(Triton/TileLang/TVM FFI 等)以最小修改方式接入 PaddlePaddle。遇到以下场景务必使用:迁移外部算子库到 Paddle;分析 PFCCLab fork 与上游的兼容差异;处理…

    24k GitHub stars~883 tokensUpdated 8 days ago
    AI & LLM EngineeringAuto-check passed
  • Quark Install

    amd/Quark

    Install or verify the AMD Quark package and its dependencies.

    181 GitHub stars~1.8k tokensUpdated 10 days ago
    AI & LLM EngineeringAuto-check: notes

More from intel/torch-xpu-ops

All 29 skills in this repo
  • Intel GPU Device Selection

    intel/torch-xpu-ops

    Official

    Select the Intel GPU device to use when a system has multiple Intel GPU devices.

    115 GitHub stars~508 tokensUpdated today
    Auto-check passed
  • Xpu CI Health Check

    intel/torch-xpu-ops

    Official

    Check PyTorch ciflow/xpu (xpu.yml) on the main branch, collect the failing XPU test cases from the most recent completed run(s), analyze the ROOT CAUSE of each failure with AI, and produce a list…

    115 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • At Dispatch V2

    intel/torch-xpu-ops

    Official

    Convert PyTorch ATDISPATCH macros to ATDISPATCHV2 format in ATen C++ code.

    115 GitHub starsUsed in 3 repos~2.2k tokens
    Auto-check passed
  • PR Review

    intel/torch-xpu-ops

    Official

    Review pull requests for XPU operator or backend code. An agent skill from intel/torch-xpu-ops.

    115 GitHub stars~4.2k tokensUpdated today
    Auto-check passed
  • Skill Writer

    intel/torch-xpu-ops

    Official

    Guide users through creating Agent Skills for Claude Code. An agent skill from intel/torch-xpu-ops.

    115 GitHub starsUsed in 3 repos~2.4k tokens
    Auto-check passed
  • Ut Issue Authoring

    intel/torch-xpu-ops

    Official

    Read the evidence a nightly UT run produced, decide which failures share a root cause and which are machine breakage rather than product bugs, and write one issue draft per root cause to drafts.json.

    115 GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Questions about Xpu Build Pytorch

What does Xpu Build Pytorch do?

Build PyTorch from source with Intel XPU (GPU) support. An agent skill from intel/torch-xpu-ops. Xpu Build Pytorch is an agent skill from intel/torch-xpu-ops, published by the product's own GitHub organization. Build PyTorch from source with Intel XPU (GPU) support.

When should I use Xpu Build Pytorch?

Xpu Build Pytorch fits situations like: the user asks to build PyTorch; set up the XPU build environment; rebuild after code changes; install PyTorch for XPU.

How do I install Xpu Build Pytorch in Claude Code?

Run `npx skills add intel/torch-xpu-ops --skill xpu-build-pytorch -a claude-code`. Or copy the skill folder (.claude/skills/xpu-build-pytorch in intel/torch-xpu-ops) into .claude/skills/xpu-build-pytorch in your project. Claude Code loads it when a task matches its description.

How do I install Xpu Build Pytorch in Codex?

Run `npx skills add intel/torch-xpu-ops --skill xpu-build-pytorch -a codex`. Or copy the skill folder (.claude/skills/xpu-build-pytorch in intel/torch-xpu-ops) into .agents/skills/xpu-build-pytorch in your project. Codex loads it when a task matches its description.

Can I use Xpu Build Pytorch 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 intel/torch-xpu-ops --skill xpu-build-pytorch -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/xpu-build-pytorch, .gemini/skills/xpu-build-pytorch, .github/skills/xpu-build-pytorch and .opencode/skills/xpu-build-pytorch in your project.

What does Xpu Build Pytorch need to run?

Going by SKILL.md and its folder, Xpu Build Pytorch needs the command-line tools its instructions call (pip, git and python). Our summary lists: Python 3.

Does Xpu Build Pytorch access the network?

SKILL.md contains no URLs. Its commands use pip and git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Xpu Build Pytorch 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. Review the folder before installing.

What licence does Xpu Build Pytorch use?

Xpu Build Pytorch 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 Xpu Build Pytorch use?

About 939 tokens (SKILL.md is roughly 3.8k 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 Xpu Build Pytorch?

Skills that share tags, products or a category with Xpu Build Pytorch: Ako4all (TongmingLAIC/AKO4ALL, 369 stars), Paddle Op Dev (PaddlePaddle/Paddle, 24k stars), Embedded AI Deployment (matlab/agent-skills-playground, 181 stars) and Qualcomm QNN Backend Development (pytorch/executorch, 5.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Xpu Build Pytorch?

intel (a GitHub organization, an official publisher) maintains it in intel/torch-xpu-ops, which has 115 GitHub stars. The repository holds 29 skills in this directory. The repository was last updated on October 8, 2026.

Source: intel/torch-xpu-ops on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.