extract-asm-syclkernel-jit
Skill121 starsChanged 5 months agoApache-2.0View on GitHub
Extract GPU ISA from JIT-compiled SYCL kernels. The binary only contains SPIR-V; IGC compiles it to native ISA at first launch. The zebin only exists in memory at runtime, so IGC_ShaderDumpEnable=1 is required to capture it. Use when extracting ASM from SYCL JIT kernels, torch-xpu-ops built with TORCH_XPU_ARCH_LIST=none, or standalone DPC++ without AOT flags.
In this repository28 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- asm-source-mappingSkill
- at-dispatch-v2Skill
- auto-labelSkill
- extract-asm-onednnSkill
- extract-asm-syclkernel-aotSkill
- extract-asm-tritonSkill
- extract-xpu-kernel-asmSkill
- fix-implementSkill
- fix-reproduceSkill
- fix-root-causeSkill
- fix-verifySkill
- issue-handlerSkill
- issue-triageSkill
- label-issueSkill
- oob-perf-analysisSkill
- pr-reviewSkill
- release-branchingSkill
- skill-writerSkill
- ut-checkSkill
- ut-issue-authoringSkill
- ut-refactor-reviewSkill
- xpu-alignmentSkill
- xpu-build-pytorchSkill
- xpu-ci-health-checkSkill
- xpu-ops-pr-creationSkill
- xpu-release-notesSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 65
Use unitrace (preferred) or SYCL_UR_TRACE (fallback):
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Extract ASM from JIT-Compiled SYCL Kernels
Same compilation stack as AOT (SYCL → LLVM IR → SPIR-V → IGC → zebin), but
execution happens at first kernel launch. The zebin only exists transiently in
memory — you MUST re-run with IGC_ShaderDumpEnable=1 to capture it to disk.
How this fits the compilation stack
Build time:
SYCL source → LLVM IR → SPIR-V
↓
embedded in binary (no native code yet)
First launch (runtime):
SPIR-V → IGC (JIT) → zebin (in memory only!)
↓
IGC_ShaderDumpEnable=1 → dumps to disk ← this is what we capture
↓
.asm file (with // file:line comments from IGC)Why IGC_ShaderDumpEnable=1 is required: Unlike AOT where the zebin is
statically extractable from the binary, JIT zebin only exists in GPU driver
memory. Without the dump flag, it's never written to disk.
Bonus: JIT dump produces .asm files with inline // file:line comments
(IGC's EmitPass annotates them directly).
When to use
- Kernel is
_ZTS…AND one of:- Binary has NO
__CLANG_OFFLOAD_BUNDLE(pure JIT build) - Binary has AOT bundle but target does not match current device (e.g. built for PVC, running on BMG — runtime falls back to JIT via SPIR-V)
- Binary has NO
- Common cases:
torch-xpu-opsbuilt withTORCH_XPU_ARCH_LIST=none- Standalone DPC++ without
-fsycl-targets=spir64_gen - Device not in the AOT target list (e.g.
TORCH_XPU_ARCH_LIST=pvcon BMG)
When NOT to use
- Binary has AOT code matching current device → use
extract-asm-syclkernel-aot - Kernel is oneDNN ngen → use
extract-asm-onednn(different stack) - Kernel is Triton → use
extract-asm-triton
Steps
Prerequisite: The router (extract-xpu-kernel-asm) has already confirmed
that the JIT path is active for the current device. This skill assumes IGC will
be invoked at runtime.
Pin the actually-launched kernel.
Use unitrace (preferred) or SYCL_UR_TRACE (fallback):
unitrace -d <repro_cmd> # Or fallback: SYCL_UR_TRACE=-1 <repro_cmd> 2>&1 | grep -oP 'pKernelName = 0x[0-9a-f]+ \(\K[^)]+' | sort -uPick the hot kernel name (
<KERNEL>).Re-run with IGC dump (cold cache).
OUT="<workdir>/$(basename "$BIN")_$(date +%Y%m%d_%H%M%S)" mkdir -p "$OUT/igc" NEO_CACHE_PERSISTENT=0 \ IGC_ShaderDumpEnable=1 \ IGC_DumpToCustomDir="$OUT/igc" \ ONEAPI_DEVICE_SELECTOR=level_zero:0 \ <repro_cmd> 2>&1 | tee "$OUT/run.log" ls "$OUT/igc"/*.asm | wc -lMatch kernel name to
.asmfile.MATCH=$(grep -l "$KERNEL" "$OUT/igc"/OCL_asm*_simd*_entry_*.asm | head -1) test -n "$MATCH" || { echo "no asm matches $KERNEL"; exit 1; } echo "asm-file: $MATCH"
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

