Logo vun Xpu Profile Unitrace

Xpu Profile Unitrace

Organisatioun
intel
xpu-profile-unitrace

Profile Intel-XPU workloads at the SYCL / Level Zero kernel level via Intel pti-gpu's unitrace. Captures per-API-call and per-kernel timing, memory transfers, oneCCL / MPI events, and hardware counters PyTorch-level profilers cannot see. Use when a hot op is already known at the torch.profiler layer and the user needs the SYCL kernel beneath, or when profiling oneCCL collectives in multi-GPU runs. Not for PyTorch-level signal (use torch-xpu-profile / vllm-xpu-profile). Requires building unitrace from source.

Iwwersiicht

Editeurintel
Repositoryskills
Skill-Nummxpu-profile-unitrace
Stären
31
Forks
14
Matgeliwwert Fichieren
Nëmmen Instruktiounen
LizenzApache-2.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Vum intel op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Xpu Profile Unitrace an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/intel/skills/tree/main/skills/xpu-profile-unitrace
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/intel/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/xpu-profile-unitrace .claude/skills/xpu-profile-unitrace
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Xpu Profile Unitrace an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Xpu Profile Unitrace automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Xpu Profile Unitrace net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

xpu-profile-unitrace

unitrace profiles XPU workloads at the SYCL / Level Zero kernel level — captures per-kernel timing, memcopy bytes, oneCCL/MPI events, and hardware counters that PyTorch profilers can't see.

Use when:

  • A PyTorch-level profiler identified a hot op and you need to know which SYCL kernel inside it is the cost.
  • You need Level Zero command-list events, oneCCL collectives, exact memcopy bytes, kernel launch geometry, or HW counters.
  • Multi-XPU run with per-rank oneCCL visibility needed.
  • Workload is raw SYCL / oneAPI (not PyTorch).

Prefer torch-xpu-profile or vllm-xpu-profile first; their output usually answers the question without going to SYCL level.

Install: check, then build if missing

sh
command -v unitrace && unitrace --version

Most public XPU images don't ship unitrace. To build from source inside the target image:

sh
source /opt/intel/oneapi/setvars.sh --force >/dev/null
git clone --depth 1 https://github.com/intel/pti-gpu.git /opt/pti-gpu
cd /opt/pti-gpu/tools/unitrace
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j"$(nproc)"
export PATH="/opt/pti-gpu/tools/unitrace/build:$PATH"
unitrace --version          # confirm
unitrace --device-list      # confirm sees XPU

Prerequisites: CMake 3.22+, C++17 compiler, oneAPI Base Toolkit (present in vllm/vllm-openai-xpu:latest and in the lmsysorg/sglang:v<version>-xpu release images). Add -DBUILD_WITH_MPI=1 for multi-GPU collective profiling; -DCMAKE_INSTALL_PREFIX=/opt/unitrace && make install for an installable layout. Verified clean on vllm/vllm-openai-xpu:latest against unitrace 2.3.0.

If you profile often, bake this into a Dockerfile extending the runtime image so you don't rebuild every session.

Quickstart capture

sh
cd /work       # working dir is where the trace lands
unitrace \
    --chrome-call-logging \
    --chrome-kernel-logging \
    python3 my_workload.py

Closing log lines name the exact paths:

[INFO] Log is stored in /work/python3.<PID>.json
[INFO] Timeline is stored in python3.<PID>.json

Drag python3.<PID>.json into https://ui.perfetto.dev. -o NAME sets a marker / log path but does not rename the timeline; don't rely on it as a "save as X.json" flag.

For hardware metrics:

sh
unitrace --stall-sampling --chrome-kernel-logging -o /work/stalls.json python3 my_workload.py

unitrace --device-list shows visible XPUs; unitrace --metric-list shows available HW counters.

What unitrace adds over torch.profiler

Layertorch.profilerunitrace
PyTorch op (aten::matmul)yesyes (passes through)
SYCL kernel name + durationnoyes (e.g. xetla_gemm_universal_4_b_2_d_4)
Level Zero command-list eventsnoyes (queue submit / sync / fence)
oneCCL collectivesnoyes (Allreduce, Allgather, per-rank)
Memory copy direction + sizepartialyes (H2D/D2H/P2P with byte counts)
Hardware countersnoyes (--stall-sampling, --metric-query)

Use it when the PyTorch op is "matmul" and you need to know which GEMM kernel was dispatched (XeTLA vs oneDNN vs Triton fallback).

Reading the timeline

Open the Chrome-trace JSON in Perfetto. Same conventions as torch.profiler, plus:

  • Kernel-name rows — group by kernel name (right-click) for total time per kernel; top 3–5 dominate.
  • Command-list submit gaps — wide gaps between adjacent kernels (> kernel duration) suggest host is the bottleneck.
  • CCL collective rows — multi-GPU per-rank timing. A long rank blocks others — straggler.
  • Memory copies — directional rows. Unexpected P2P copies often mean a missing device_map placement.

Stall sampling for hot kernels

Once a kernel dominates, rerun with stall sampling to see why:

sh
unitrace --stall-sampling -k --chrome-kernel-logging \
    -o /work/stall.json python3 my_workload.py

Output groups stalls by category. High "Memory" -> bandwidth-bound; high "Pipeline" -> compute-bound. Read against the same roofline used by model-config-recommend.

Common errors

  • unitrace: command not found -> build dir not on PATH. export PATH=/opt/pti-gpu/tools/unitrace/build:$PATH.
  • unable to load metric library -> oneAPI env not set. source /opt/intel/oneapi/setvars.sh --force.
  • Empty trace -> workload didn't run on XPU. Verify with unitrace --device-list and xpu-smi dump -d 0 -m 5.
  • Trace size in GB -> long runs accumulate. Capture a short window (5–10 iterations).
  • Permission denied reading HW metrics -> some metric modes need --privileged on the container.

Env vars

VariablePurpose
ZE_AFFINITY_MASKPin to one XPU before profiling.
LD_LIBRARY_PATHMust include oneAPI runtime libs (handled by setvars.sh).
ZE_ENABLE_TRACING_LAYER=1Force L0 to load the tracing layer when unitrace can't inject it automatically.

What this skill does NOT cover

  • Fixing a hot SYCL kernel — out of scope.
  • Hardware-counter analysis on Data Center GPU Max (richer modes not covered here).

References

Heefeg gestallte Froen

Wat mécht de KI-Skill Xpu Profile Unitrace?

Profile Intel-XPU workloads at the SYCL / Level Zero kernel level via Intel pti-gpu's unitrace. Captures per-API-call and per-kernel timing, memory transfers, oneCCL / MPI events, and hardware counters PyTorch-level profilers cannot see. Use when a hot op is already known at the torch.profiler layer and the user needs the SYCL kernel beneath, or when profiling oneCCL collectives in multi-GPU runs. Not for PyTorch-level signal (use torch-xpu-profile / vllm-xpu-profile). Requires building unitrace from source.

Firwat Xpu Profile Unitrace op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Xpu Profile Unitrace besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Xpu Profile Unitrace an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/intel/skills/tree/main/skills/xpu-profile-unitrace an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Xpu Profile Unitrace benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Xpu Profile Unitrace benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Xpu Profile Unitrace domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Xpu Profile Unitrace gratis?

Jo. De Skill gëtt vum intel ënner der Lizenz Apache-2.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇