Xpu Profile Unitraceのロゴ

Xpu Profile Unitrace

組織
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.

概要

公開者intel
リポジトリskills
スキル名xpu-profile-unitrace
スター
31
フォーク
14
同梱ファイル
指示のみ
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    intelがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Xpu Profile Unitrace」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/intel/skills/tree/main/skills/xpu-profile-unitrace
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでXpu Profile Unitraceを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にXpu Profile Unitraceを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Xpu Profile Unitraceは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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

よくある質問

AIスキル「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.

TypingMindでXpu Profile Unitraceを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Xpu Profile Unitraceはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにXpu Profile Unitraceをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/intel/skills/tree/main/skills/xpu-profile-unitraceを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Xpu Profile Unitraceを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Xpu Profile Unitraceで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもXpu Profile Unitraceを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Xpu Profile Unitrace」は無料ですか?

はい。intelがApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇