Command Palette

Search for a command to run...

Назад к скиллам
скилл № 94099

sass-machine-code

Use when the user asks about SASS, cuobjdump -sass, nvdisasm, warp stall reasons, long scoreboard, HMMA/HGMMA, FFMA or instruction mix in Nsight Compute…

БесплатноБез исполняемых скриптов
j4flmaoот j4flmao★ 47 звёзд на GitHub

Установить sass-machine-code в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

SASS Machine Code Analysis

Purpose

SASS is the architecture-specific machine code that the SM actually executes, produced by ptxas from PTX. NVIDIA documents the instruction names per architecture but not the encoding, so SASS is used for reading, not writing: confirming vectorized loads, tensor-core instructions, spills, unrolling and predication, and attributing stalls to exact instructions with Nsight Compute.

Agent Protocol

Trigger

"sass", "cuobjdump -sass", "nvdisasm", "machine code", "stall reasons", "long scoreboard", "warp stall", "register bank conflict", "HMMA", "HGMMA", "FFMA", "instruction mix".

Input Context

  • Binary or kernel source + compile flags, target sm_XX.
  • Nsight Compute report (--set full) with source/SASS correlation (-lineinfo).

Output Artifact

Annotated SASS excerpt + root cause + source-level fix. No file unless requested.

Response Format

Hot instruction(s): {SASS line(s)} ← source line {n}
Top stall: {reason} ({% of samples})
Cause: {explanation}
Fix: {source/compile change}
Re-check: {metric}

Completion Criteria

  • Hot spots chosen from sampling data, not by eye.
  • Fix applied at source/flag level, then SASS and metrics re-inspected.
  • Result correctness re-validated.

Getting SASS

nvcc -O3 -arch=sm_90 -lineinfo -cubin -o k.cubin k.cu
cuobjdump -sass k.cubin                 # or on the final executable
nvdisasm -g k.cubin                     # -g annotates source line info
nvdisasm -cfg k.cubin | dot -Tsvg > cfg.svg   # control-flow graph
ncu --set full --import-source yes -o rep ./app   # then open the Source page, view "SASS" or "Source and SASS"

Reading Common Instructions

SASS Meaning
LDG.E.128 / STG.E.128 128-bit (vectorized) global load/store. LDG.E alone = 32-bit.
LDG.E.CONSTANT Read-only (non-coherent) path, from __ldg / const __restrict__.
LDS / STS Shared memory load/store.
LDL / STL Local memory: usually register spills (bad in hot loops).
LDGSTS Async global→shared copy (cp.async, sm_80+).
UTMALDG TMA bulk tensor load (sm_90).
FFMA, FADD, FMUL FP32 fused multiply-add / add / multiply on CUDA cores.
HMMA / IMMA Warp-level tensor-core MMA (FP16/BF16/TF32 / INT8).
HGMMA Hopper warpgroup tensor-core MMA (wgmma).
MUFU.EX2, MUFU.RCP, MUFU.RSQ Special function unit: exp2, reciprocal, rsqrt (fast intrinsics).
SHFL.BFLY/DOWN Warp shuffle.
BAR.SYNC __syncthreads().
ISETP + @P0 Integer compare setting a predicate; @P0/@!P0 predicated execution.
BRA, BSSY/BSYNC Branch; convergence-barrier pairs around divergent regions (Volta+).
S2R SR_TID.X Read special register (thread index).

Matrix-multiply throughput on modern GPUs comes from tensor-core instructions (HMMA/HGMMA), not FFMA. A GEMM kernel full of FFMA with FP16/BF16 inputs means tensor cores are not being used.

Scheduling Model (what matters for analysis)

  • Since Maxwell, an SM is split into 4 processing blocks, each with its own warp scheduler that issues at most one instruction per cycle from one eligible warp.
  • Each warp issues its instructions in program order; latency is hidden by switching among warps (and by independent instructions within a warp).
  • Fixed-latency dependencies are handled by compiler-encoded control information (stall counts, yield hints). Variable-latency results (memory, MUFU) use scoreboards; a dependent instruction waits on that scoreboard.
  • Register file is banked; an instruction reading several operands from the same bank can lose cycles. ptxas sets .reuse flags to serve repeated operands from an operand reuse cache. Bank counts/widths differ per architecture (known from microbenchmark studies, not official docs).

Nsight Compute Stall Reasons → Fix

Stall reason Meaning Typical fix
Long Scoreboard Waiting on L1TEX (global/local/texture) data Coalesce, increase reuse via smem, prefetch/cp.async pipelining, more warps/ILP; check for LDL spills
Short Scoreboard Waiting on MIO (shared memory, MUFU, shuffles) Fix bank conflicts, fewer transcendental ops, -use_fast_math if accuracy allows
MIO Throttle / LG Throttle Memory instruction queues full Wider (vectorized) accesses, fewer instructions
Math Pipe Throttle Execution pipe busy Good if compute-bound; otherwise move work to tensor cores or lower precision
Wait Fixed-latency dependency More ILP, unrolling
Barrier Waiting at __syncthreads Balance work across warps, fewer barriers
Not Selected Eligible but another warp issued Not a problem; indicates enough warps
No Instruction Instruction cache miss / branch target Reduce code size (over-unrolling), avoid huge kernels
Branch Resolving Divergent branches Make branches warp-uniform, predication
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл sass-machine-code?

Use when the user asks about SASS, cuobjdump -sass, nvdisasm, warp stall reasons, long scoreboard, HMMA/HGMMA, FFMA or instruction mix in Nsight Compute. Produces annotated SASS with root cause and a source-level fix. Not for writing PTX or inline asm (use ptx-assembly) or general kernel design (use cuda-programming).

Как установить скилл sass-machine-code?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл sass-machine-code запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить sass-machine-code с