[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M718NWG0K2EK3M3J339TFYE9":3,"skill-same:01M718NWG0K2EK3M3J339TFYE9":72},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":48,"ownerHtmlUrl":49,"ownerBlogUrl":48,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M718NWG0K2EK3M3J339TFYE9","rocm-tuning",null,"Profile and tune Llaminar V2 ROCm\u002FHIP kernels on AMD Instinct GPUs (gfx906 MI50\u002FMI60), including INT8 VNNI GEMM\u002FGEMV, sampling, grouped verification, and graph-captured inference. Use rocprof per-dispatch timing\u002Fcounters plus LLVM ISA analysis to diagnose occupancy, vectorization, VGPR pressure, spills, divergence, LDS conflicts, and throughput while retaining byte-exact production behavior.","Llaminar\u002Fllaminar","Llaminar","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F247404048?v=4","01M718MTZG2TQSA7DEB5DKQDN1","01M718MV06G9CV8S2JMN9XHX8Y",48,"AGPL-3.0","https:\u002F\u002Fgithub.com\u002FLlaminar\u002Fllaminar\u002Fblob\u002Fmaster\u002F.agents\u002Frocm-tuning\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"rocm","rocm tuning","tuning","dispatch","kernels","occupancy","use","vectorization","INT8","timing","diagnose","instinct","graph","throughput","verification","conflicts","analysis","sampling","hip","llvm","2026-11-10 10:12:30",false,"---\nname: rocm-tuning\ndescription: Profile and tune Llaminar V2 ROCm\u002FHIP kernels on AMD Instinct GPUs (gfx906 MI50\u002FMI60), including INT8 VNNI GEMM\u002FGEMV, sampling, grouped verification, and graph-captured inference. Use rocprof per-dispatch timing\u002Fcounters plus LLVM ISA analysis to diagnose occupancy, vectorization, VGPR pressure, spills, divergence, LDS conflicts, and throughput while retaining byte-exact production behavior.\n---\n\n# ROCm \u002F HIP Kernel Profiling & Tuning (Llaminar V2, gfx906)\n\n## Purpose\n\nA repeatable, evidence-driven workflow for tuning Llaminar V2 HIP INT8 GEMM\u002FGEMV kernels\non AMD Instinct MI50\u002FMI60 (gfx906), distilled from the multi-session effort that produced\nthe V7 native kernel matching\u002Fbeating AMD's Composable Kernel (CK) on N-heavy LLM shapes.\n\nIt chains three tools:\n\n1. **PerfStats GPU event timing** — production-graph replay timing and structured route\u002Fhost counters.\n2. **`rocprof`** — per-dispatch GPU kernel timing (the *only* trustworthy latency number).\n3. **LLVM ISA toolchain** (`llvm-objcopy` \u002F `llvm-readelf` \u002F `llvm-objdump`) — extract code\n   objects, read VGPR\u002FSGPR\u002FLDS metadata, disassemble, and census instructions.\n4. **The dispatch-comparison perf test + parity** — A\u002FB variants and validate correctness.\n\nThe golden rule of gfx906 tuning: **wallclock lies.** On PCIe-bottlenecked topologies,\n>90% of GEMM wallclock is memory transfer. Always quote `rocprof` per-dispatch GPU time,\nnot wallclock, when comparing kernels.\n\n## Production hot-path invariants\n\nROCm kernel tuning must preserve the production execution architecture, not\ntrade architecture for an isolated microbenchmark win:\n\n- **No dynamic allocation or deallocation.** Hot-path kernels and launch\n  bridges consume persistent workspace bindings. `hipMalloc`,\n  `hipMallocAsync`, `hipFree`, container growth, or hidden scratch allocation\n  belongs in explicit initialization\u002Fworkspace infrastructure only.\n- **No host transfer.** Do not insert H2D\u002FD2H copies, host-visible mirrors, or\n  host polling into execution. Deliberate RAM\u002Fdisk KV-cache tier movement is a\n  transfer-service operation at an explicit lifecycle boundary, not kernel\n  plumbing.\n- **No stream or device synchronization.** `hipStreamSynchronize`,\n  `hipDeviceSynchronize`, blocking copies, and event synchronization on the\n  host are forbidden in the hot path. They are permitted only in explicitly\n  scoped test\u002Fprofiler result collection or terminal result surfacing.\n- **No order-dependent atomics in batch-invariant paths.** Grouped verifier,\n  deterministic decode, and batch-invariant prefill kernels must give every\n  output a unique deterministic writer. An atomic is acceptable only when its\n  value is provably independent of inter-thread order, bitwise equivalence is\n  covered by the all-format\u002FM-totality sweep, and profiling proves it is\n  economical.\n- **Use explicit producer\u002Fconsumer events.** A producer launches on an explicit\n  non-null stream and publishes completion by recording an event on that exact\n  stream. A consumer on another stream waits for that event before reading.\n  Never publish a write on a guessed\u002Fdefault stream, transition coherence\n  manually after a blocking sync, or replace the dependency with a global\n  barrier.\n- **Remain graph-capturable end to end.** Persistent buffers, launches, event\n  record\u002Fwait edges, and collectives must be capturable. Homogeneous GPU\n  inference requires one complete captured graph; segmented execution is not a\n  tuning fallback.\n\nThe full reference write-up lives at\n`src\u002Fv2\u002Fkernels\u002Frocm\u002Fgemm\u002FREADME.vnni-gemm-tuning.md` (and the companion\n`README.native-vnni-isa-analysis.md` for GEMV). Read those for the V1-V7 history and the\nCK ISA census; this skill is the operational checklist.\n\nFor whole-model diagnosis, first measure the production captured graph:\n\n```bash\nLLAMINAR_PERF_STATS_JSON=\u002Ftmp\u002Frocm-profile.json \\\nLLAMINAR_PERF_STATS_SUMMARY=1 \\\nLLAMINAR_PERF_STATS_GPU_STAGE_TIMING=1 \\\n.\u002Fbuild_v2_release\u002Fllaminar2 benchmark -m \u003Cmodel>.gguf -d rocm:0\n```\n\nThe `stage_gpu` graph-replay rows are GPU-event measurements around the real\ncaptured graph. They do not fabricate per-stage attribution inside a monolithic\ngraph; use rocprof for that dispatch-level view. `LLAMINAR_PROFILING=1` is\ndeprecated and exists only as a warning compatibility alias to these PerfStats\nrequests. It must never disable graph capture or select eager execution.\n\n---\n\n## Profiler attachment and evidence rules\n\n- Pass `--no-mpi-bootstrap` only when profiling or debugging `llaminar2`\n  directly so the profiler attaches to the compute process rather than the\n  `mpirun` wrapper. Never use it for production or canonical benchmark timing;\n  it disables the ordinary placement bootstrap.\n- Do not pass `--no-mpi-bootstrap` to standalone test\u002Fperformance binaries;\n  they do not auto-bootstrap MPI.\n- Preserve `LLAMINAR_*`, `HSA_*`, and `ROCR_*` variables with `sudo -E` only on\n  hosts that require privilege escalation. Ordinary `sudo` strips them.\n- Write rocprof CSVs, traces, extracted code objects, and disassembly under an\n  explicit result directory outside the repository.\n- Use one exact kernel\u002FISA\u002Fshape\u002FM candidate per profiler launch. Treat\n  rocprof timing and counters as diagnostic evidence beside the unprofiled\n  canonical timing corpus; never train dispatch on profiler overhead or replay\n  duration.\n- Keep the profiler generation and metric groups required by the repository's\n  evidence collector. Do not silently substitute `rocprofv3` output for a\n  `rocprof`\u002Frocprofiler schema expected by the trainer.\n\n---\n\n## Step 0: Architecture facts you must keep in mind (gfx906)\n\n| Parameter | Value | Why it matters |\n|-----------|-------|----------------|\n| CUs | 60 | Grid sizing across CUs |\n| SIMDs\u002FCU | 4 | One wavefront (64 lanes) per SIMD |\n| VGPRs\u002FSIMD | 256 | **Determines occupancy** (waves\u002FSIMD = floor(256\u002FVGPRs-per-wave)) |\n| LDS\u002FCU | 64 KB | Shared across workgroups on a CU |\n| L1 I-cache | 16 KB\u002FCU | **Constrains loop-body ISA size** (branch bloat hurts) |\n| L2 | 4 MB shared | Caches the A tile (128×K fits for K≤8192) |\n| Wavefront | 64 threads | One instruction = 64 lanes |\n| `v_dot4_i32_i8` | 1\u002Fcycle\u002Flane | gfx906's VNNI (`vpdpbusd` equivalent) |\n\n**Occupancy ladder:** 1-64 VGPRs → 4 waves; 65-84 → 3; 85-128 → **2 (the sweet spot for\nM128×N128 INT8 GEMM, matches CK)**; 129-256 → 1 (catastrophic — no latency hiding).\nBelow 2 waves nothing else matters; going from 2 waves to \"perfect scheduling\" gave\n**zero** measurable gain on this workload.\n\n---\n\n## Step 1: Build the dispatch-comparison benchmark\n\n```bash\ncmake -B build_v2_release -S src\u002Fv2 -G Ninja -DCMAKE_BUILD_TYPE=Release -DHAVE_ROCM=ON\ncmake --build build_v2_release --target v2_perf_rocm_prefill_dispatch_comparison --parallel\n```\n\nThis binary instantiates **all native variants (V1-V7) and CK in one executable**, which\nis exactly what makes comparative disassembly and A\u002FB benchmarking fast.\n\n---\n\n## Step 2: Get the truth with `rocprof` (NOT wallclock)\n\n```bash\nrocprof --stats --timestamp on \\\n  .\u002Fbuild_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_rocm_prefill_dispatch_comparison \\\n  --gtest_filter=\"*WideTileVariantComparison*\"\n\n# Aggregate per-kernel GPU time\ncat results.stats.csv | column -t -s,\n# Per-dispatch rows are in results.csv\n```\n\n`results.stats.csv` gives the real GPU kernel time, excluding host overhead and PCIe.\nThis is the metric that exposed the \"19% wallclock gap\" as a mere **6.6% real kernel gap**\nvs CK. Rank kernels by per-dispatch GPU time; that is your optimization target list.\n\n> ⚠️ If two variants have nearly identical wallclock but you suspect a kernel difference,\n> trust `rocprof`. Wallclock convergence (all V1-V6 hit ~8.72 ms) was pure PCIe transfer,\n> not kernel behavior.\n\nForce a specific variant with env vars when isolating:\n\n| Variable | Effect |\n|----------|--------|\n| `LLAMINAR_ROCM_WIDE_TILE_V7=1` | Force V7 |\n| `LLAMINAR_ROCM_WIDE_TILE_V6=1` … `_V2=1` | Force V6 … V2 |\n\n### Isolate one production-shaped launch\n\nWhole-graph PerfStats identifies the expensive captured fragment. Attribute\nindividual kernels with a standalone performance harness that invokes the same\nbackend entrypoint, geometry, persistent scratch contract, and tensor format as\nproduction. Never disable graph capture or select eager inference merely to\nmake a profiler attach: that measures a different engine. Some rocprofiler\nversions cannot trace retained HIP graphs reliably; retain the outer graph\nevent measurement and profile the isolated real kernel instead.\n\nKeep canonical timing unprofiled, then gather timing, counters, and ISA in a\nseparate deterministic profiler invocation for that exact candidate. Read\n[`references\u002Frocprof-isolated-kernel.md`](references\u002Frocprof-isolated-kernel.md)\nfor the tested rocprof v1 dispatch-range\u002Fcounter commands, metric\ninterpretation, wave64 vectorization checks, and ROCm 7 `.hip_fatbin`\nextraction workflow.\n\nFor ROCm FlashAttention2, build\n`v2_perf_rocm_flash_attention_prefill` and use its exact-candidate test so one\nprofiler invocation contains one captured transaction and no unrelated model\nwork. Select the production geometry explicitly: `qwen7_tp1` exercises the\npacked device-direct branch, `qwen27_tp4` exercises long-context partition\npublication\u002Freduction, and `qwen35_tp8` exercises replicated GQA. For example:\n\n```bash\nLLAMINAR_ROCM_FA2_PROFILE_GEOMETRY=qwen7_tp1 \\\nLLAMINAR_ROCM_FA2_PROFILE_M=128 \\\nLLAMINAR_ROCM_FA2_PROFILE_KV=8192 \\\nLLAMINAR_ROCM_FA2_PROFILE_CAPACITY=131072 \\\nLLAMINAR_ROCM_FA2_PROFILE_FORMAT=FP16 \\\nLLAMINAR_ROCM_FA2_PROFILE_MODE=context \\\nrocprofv3 --kernel-trace --stats --output-directory \u002Ftmp\u002Frocm-fa2-qwen7 \\\n  -- .\u002Fbuild_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_rocm_flash_attention_prefill \\\n  --gtest_filter=ROCmFlashAttentionContextParallelPerf.ExactCandidateProfilerLaunch\n```\n\nUse `LLAMINAR_ROCM_FA2_PROFILE_PHASE_BLOCKS`,\n`LLAMINAR_ROCM_FA2_PROFILE_SLOTS`,\n`LLAMINAR_ROCM_FA2_PROFILE_REDUCER_WAVEFRONTS`, and\n`LLAMINAR_ROCM_FA2_PROFILE_REDUCER_BLOCKS` only to isolate a measured tournament\ncandidate. Leave them unset to profile the installed capture-time policy.\n\n---\n\n## Step 3: ISA deep-dive (occupancy + scheduling)\n\n`rocprof` tells you *which* kernel is slow; the LLVM toolchain tells you *why*. HIP\nexecutables embed gfx906 code objects as ELF bundle sections.\n\n```bash\nBINARY=build_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_rocm_prefill_dispatch_comparison\n\n# 1. Extract the gfx906 code object\nllvm-objcopy \\\n  --dump-section='__CLANG_OFFLOAD_BUNDLE__hipv4-amdgcn-amd-amdhsa--gfx906=\u002Ftmp\u002Fco.elf' \\\n  \"$BINARY\" \u002Fdev\u002Fnull\n\n# 2. Read per-kernel resource metadata (VGPR \u002F SGPR \u002F LDS → occupancy)\nllvm-readelf --notes \u002Ftmp\u002Fco.elf 2>\u002Fdev\u002Fnull | awk '\n  \u002F\\.name:\u002F{name=$2} \u002F\\.vgpr_count:\u002F{vgpr=$2} \u002F\\.sgpr_count:\u002F{sgpr=$2}\n  \u002F\\.group_segment_fixed_size:\u002F{lds=$2}\n  \u002F\\.wavefront_size:\u002F{printf \"%-60s VGPR=%-4s SGPR=%-4s LDS=%s\\n\",substr(name,1,60),vgpr,sgpr,lds}'\n\n# 3. Full disassembly (~45k lines for the full binary)\nllvm-objdump -d --mcpu=gfx906 \u002Ftmp\u002Fco.elf > \u002Ftmp\u002Fdisasm.txt\n\n# 4. Locate kernels (CK symbols are >1000 chars due to C++ templates)\ngrep -n '\u003C_Z' \u002Ftmp\u002Fdisasm.txt | head -40\n```\n\nFor ROCm 7 objects that use `.hip_fatbin`, use the extraction workflow in the\nlinked isolated-kernel reference. The unprofiled benchmark, rocprof evidence,\nand static ISA must always describe the same compiled candidate.\n\n### Read the metadata FIRST\n\nThe VGPR\u002FSGPR\u002FLDS line decides occupancy before you read a single instruction:\n\n| Symptom in metadata | Diagnosis | Fix |\n|---------------------|-----------|-----|\n| VGPR ≥ 129 (1 wave) | register explosion (e.g. V4: 256 VGPRs + 118 spills) | add `__launch_bounds__(256, 2)`; stop full-unrolling the inner loop |\n| VGPR 85-128 (2 waves) | the gfx906 sweet spot — good | only algorithmic\u002Fstructural wins left |\n| Spills > 0 | inner loop unrolled with too many live accumulators | `#pragma clang loop unroll(disable)` or `unroll_count(2)` |\n| LDS > 32 KB | limits workgroups\u002FCU | shrink KT or move A to L2 instead of LDS |\n\n### Locate a kernel by distinctive symbol fragment\n\n| Grep pattern | Kernel |\n|--------------|--------|\n| `qgemm_int8_vnni_wide_tile_v5` | native V5 |\n| `Li256E.*Lb1ELb0E.*PassThrough` | CK 128×128, HasMainK=true, no padding (hot path) |\n| `Li64E` \u002F `Li32E` | CK 64×64 \u002F 32×32 (medium \u002F decode) |\n\n### Instruction census within a kernel's line range\n\n```bash\nSTART=18369; END=22092  # from the grep above\nfor pat in v_dot4_i32_i8 ds_read_b128 ds_read_b32 ds_write s_barrier \\\n           s_waitcnt s_nop s_cbranch buffer_load s_swappc; do\n  printf \"%s: \" \"$pat\"\n  awk \"NR>=$START && NR\u003C=$END\" \u002Ftmp\u002Fdisasm.txt | grep -c \"$pat\"\ndone\n```\n\nWhat to read for:\n- `s_barrier` count → loop structure. Double-buffered (CK, V3-V7) ≈ 3 barriers;\n  single-buffered (V1) = 2 per iteration.\n- `s_cbranch` count → boundary-check bloat. High branch count in the hot loop wastes\n  the 16 KB L1 I-cache (V5 had 15 fast-path + 84 boundary-path = 99 branches\u002Fiter).\n- `s_nop` → wasted cycles (fewer is better; CK had 2 in the entire kernel).\n- `s_swappc` → subroutine calls (only V1; inline everything in the hot loop).\n- `s_waitcnt lgkmcnt(N)` with N>0 between `ds_read`\u002F`v_dot4` → **progressive waits =\n  good pipelining** (CK keeps ~5 LDS reads in flight at all times).\n\n---\n\n## Step 4: The seven latency-hiding levers (in priority order)\n\nApply these to the targeted kernel; the first two are mandatory, the rest are refinements.\n\n1. **`__launch_bounds__(threads, min_waves)` — non-negotiable.** The 2nd arg caps VGPRs\n   (256\u002Fmin_waves). Omitting it let V4 use 256 VGPRs + spills → 1 wave → slower than V1.\n   1→2 waves is often a 3-5× swing, not 2×.\n2. **LDS double-buffering.** Ping-pong even\u002Fodd buffers: compute buf[cur] while loading\n   buf[nxt], one `__syncthreads()` between. Kills the serial load→barrier→compute cycle.\n3. **Inner-loop unroll control.** `#pragma unroll` → VGPR explosion (V4). Prefer\n   `unroll(disable)` (V5: clean 117 VGPRs) or `unroll_count(2)` (V6). On gfx906 these two\n   gave **identical** performance — don't over-invest here once you have 2 waves.\n4. **Progressive `s_waitcnt`** — let the compiler keep 5-6 LDS reads in flight; don't force\n   `lgkmcnt(0)`.\n5. **Register recycling** — reuse a `v_dot4` source VGPR as an accumulator\u002Fload target once\n   dead; this is how CK fits 64 accumulators in 128 VGPRs.\n6. **16-byte vectorized load\u002Fstore** — `uint4` reinterpret_cast → `global_load_dwordx4` \u002F\n   `ds_write_b128` \u002F `ds_read_b128`. 4× scalar throughput.\n7. **Safe-tile split (the V7 winner)** — split the tile loop into a *safe* phase (loads\n   provably in-bounds → unconditional vectorized loads, zero branches) and a *boundary*\n   phase (full checks + scalar fallback, runs 0-2 tiles or never for aligned shapes). For\n   aligned LLM shapes (e.g. N=18944 % 128 == 0) the boundary loop is dead code and the hot\n   loop's ISA is maximally tight in the 16 KB I-cache. This was the structural change that\n   closed the last 6.6% — **where you branch matters more than how you compute.**\n\n---\n\n## Step 5: Validate (correctness + the right benchmark)\n\n```bash\n# Re-run the dispatch comparison and confirm rocprof GPU time improved\nrocprof --stats --timestamp on \\\n  .\u002Fbuild_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_rocm_prefill_dispatch_comparison \\\n  --gtest_filter=\"*WideTileVariantComparison*\"\ncat results.stats.csv | column -t -s,\n\n# Full-model ROCm parity must stay PASS\nctest --test-dir build_v2_integration -R \".*Parity.*ROCM\" --output-on-failure\n```\n\nAccept a change only if **`rocprof` per-dispatch GPU time** improves beyond noise AND\nparity stays PASS. A wallclock-only improvement on a PCIe-bound rig is not evidence.\n\nRemember shape-dependence: V7\u002FKT16 wins N-heavy shapes (FFN_Up, Gate, LM_Head), but\nK-heavy shapes (FFN_Down, AttnOut) still favor V1\u002FV3's simpler\u002Ftall-K geometry. Tune and\nselect per shape; don't assume one kernel wins everywhere.\n\n---\n\n## Step 6: Train generated NativeVNNI dispatch tables\n\nRead `.agents\u002Fnativevnni-gemm-tuning\u002FSKILL.md` for the shared corpus, learner,\ncertification, Git LFS, and installation workflow. This section owns only\nROCm-specific kernel\u002Fprofiler constraints.\n\nROCm NativeVNNI dispatch should follow the same automatic sweep\u002Fgenerate\u002Fvalidate\npipeline as CUDA. Avoid hand-coded per-shape overrides except as throwaway\nexperiments.\n\n1. Keep the shape inventory in the perf harness aligned with real model routes:\n   `tests\u002Fv2\u002Fperformance\u002Fkernels\u002Frocm\u002FPerf__NativeVNNI_Sweep.cpp` for prefill\n   and `tests\u002Fv2\u002Fperformance\u002Fkernels\u002Frocm\u002FPerf__NativeVNNI_Throughput.cpp` for\n   decode\u002FGEMV.\n2. For decode\u002FGEMV dispatch tables, use the Git-LFS-aware turnkey transaction:\n   `scripts\u002Ftrain_native_vnni_dispatch.sh --backend rocm --install`.\n   The lower-level `refresh_native_vnni_dispatch_tables.sh` remains the phase\n   executor used by the driver and for focused diagnostic collection.\n   It runs with `LLAMINAR_ROCM_NVNNI_DISABLE_GENERATED=1`, sweeps canonical\n   serial `M=1` first and grouped verifier `M=2..16,31` against that exact frozen\n   dependency, generates the include, validates it, and can install it with\n   `--install`. M31 is a deeper sentinel rather than a production maximum.\n   Keep public M1 decisions keyed by every runtime-visible discriminator.\n   Grouped verifier buckets must inherit the frozen M1 K partition and ordered\n   reduction tree; selecting a different M2+ family is incompatible with the\n   byte-exact serial-row contract.\n   The durable decode selector must generalize by aspect ratio plus work-size\n   segments. Exact `(M,N,K)` winners are allowed only as overlays above that\n   broad fallback; do not land an exact-shape-only table that would require\n   retraining for every nearby model dimension.\n   Score generated tables on the runtime dispatch surface, not raw\n   source-format rows. If several GGUF formats share a NativeVNNI codebook, the\n   runtime can only choose one `(codebook,M,N,K)` tuning; analyzers should\n   collapse aliases before enforcing exact-hit thresholds.\n   Use staged strict profiles when the full shape inventory is too expensive in\n   one pass: `--profile qwen36-core` covers FFN\u002FGDN projections and\n   `--profile qwen36-lm-head` covers the giant LM-head shape. The LM-head\n   profile defaults to `LLAMINAR_ROCM_NVNNI_DECODE_REFERENCE=native-auto`, which\n   compares candidates with a reset-AUTO native output instead of building a\n   multi-GB FP32 hipBLAS mirror. Treat that as a dispatch-equivalence trainer\n   proxy; model parity and benchmarks still gate any `--install`.\n   Production collection derives immutable profiler requests only after the\n   canonical timing CSV and raw timing sidecar are sealed. Each request starts\n   a fresh process. `roctxProfilerResume(0)`\u002F`roctxProfilerPause(0)` bracket one\n   extra production launch, while a request-specific ROCTx range identifies the\n   exact pipeline in PMC passes. The trace pass keeps physical kernel names;\n   renamed PMC rows join back by contiguous dispatch order. On gfx906, collect\n   `FetchSize`, `WriteSize`, `Wavefronts`, `VALUUtilization`, and\n   `LDSBankConflict` as reviewed singleton passes. Combining the TCC traffic\n   metrics exceeds hardware profile capabilities and can hang rocprofiler's\n   abort path. Never let profiler replay or overhead enter canonical timing.\n   The final `rocm_profiler_features.csv` must be the authenticated export of\n   the canonical observation, request, and evidence manifests, with one row per\n   physical dispatch rather than an ad hoc join of rocprof CSVs.\n   The common policy fit may separately use every ROCm and CUDA device through\n   exact leaf-primary scorer DSOs. The refresh wrapper auto-discovers devices;\n   `--policy-accelerators` fixes the inventory and `--policy-lanes` controls\n   independent CPU orchestration lanes per device. Those scorer launches do not\n   time candidate kernels and never enter rocprof evidence. Keep CUDA and HIP\n   in separate worker processes and hard-fail any requested accelerator error.\n3. Use `--profile family-smoke` for a bounded representative training pass before\n   a full acceptance refresh. This profile is stratified by format: it runs one\n   small sweep per codebook\u002Ffamily, writes per-format partial CSVs, combines them,\n   then runs the normal train\u002Fgenerate\u002Fvalidate flow. This avoids a capped sweep\n   accidentally covering only the first format in the list.\n\n   ```bash\n   scripts\u002Frefresh_native_vnni_dispatch_tables.sh --backend rocm \\\n     --profile family-smoke \\\n     --rocm-formats Q4_0,IQ4_XS \\\n     --m-values 1,2\n   ```\n\n   `family-smoke` is a workflow\u002Fproxy gate, not production acceptance. Do not\n   replace broad checked-in tables from this profile alone; run `qwen36` or\n   `all`, then model-level parity and benchmark gates, before `--install`.\n   Treat the trainer's FP32 cosine as a health filter, not the exact dispatch\n   oracle: packed K-quant formats such as Q4_K\u002FQ2_K can sit just below the\n   generic FP32 gate while still matching the native packed contract. Keep\n   `V2_Integration_ROCm_NativeVNNI_GEMV`,\n   `V2_Integration_ROCmQuantisedGemmSmallM`, and model parity as the promotion\n   gates.\n4. If you are debugging the ROCm trainer directly, run sweeps with\n   `LLAMINAR_ROCM_NVNNI_DISABLE_GENERATED=1`. This is important:\n   AUTO normally consumes the checked-in generated tables, so training without\n   this guard can benchmark the previous table and emit no explicit winner.\n5. Validate CSVs with\n   `tests\u002Fv2\u002Fperformance\u002Fkernels\u002Frocm\u002Fvalidate_rocm_native_vnni_trainer_csv.py`.\n   It checks decode\u002Fprefill schema, shared codebook ids, and canonical prefill\n   bucket policy from `src\u002Fv2\u002Futils\u002FPrefillGraphBucketDefaults.h`.\n6. Generate prefill tables with\n   `tests\u002Fv2\u002Fperformance\u002Fkernels\u002Frocm\u002Fanalyze_rocm_native_vnni_trainer.py` and\n   decode tables with\n   `tests\u002Fv2\u002Fperformance\u002Fkernels\u002Frocm\u002Fanalyze_rocm_native_vnni_decode_trainer.py`.\n   The checked-in outputs are\n   `src\u002Fv2\u002Fkernels\u002Frocm\u002Fgemm\u002FROCmNativeVNNIPrefillDispatchGenerated.inc` and\n   `src\u002Fv2\u002Fkernels\u002Frocm\u002Fgemm\u002FROCmNativeVNNIDecodeDispatchGenerated.inc`.\n7. Validate generated codebook references with\n   `tests\u002Fv2\u002Fperformance\u002Fkernels\u002Fvalidate_native_vnni_generated_dispatch_ids.py`\n   and run the focused units:\n   `V2_Unit_ROCmNativeVNNITrainerCsvValidator`,\n   `V2_Unit_ROCmNativeVNNITrainerGenerator`,\n   `V2_Unit_ROCmNativeVNNIDecodeTrainerGenerator`, and\n   `V2_Unit_NativeVNNIGeneratedDispatchCodebooks`.\n\n### MTP verifier dispatch mode\n\nROCm grouped verifier kernels can be fast only if their generated small-M policy\nalso matches rowwise serial decode. The shared convention is\n`ITensorGemm::beginVerifierDecodeEquivalentScope()`: stages keep the returned\nRAII scope alive while running serial verifier replay or grouped verifier\npublication. ROCm implements the scope by selecting the M=1 decode-equivalent\nNativeVNNI policy. Do not call ROCm mode toggles directly from stage code, and\ndo not hide unsupported verifier modes behind quiet rowwise fallbacks.\nFor shared-expert MoE verifier rows, compare grouped publication against the\ncanonical M=1 GEMM\u002FSwiGLU\u002Fdown replay oracle unless a grouped decode shortcut\nhas already passed the same strict all-codebook gates.\n\nCompact refresh example:\n\n```bash\nLLAMINAR_ROCM_NVNNI_DISABLE_GENERATED=1 \\\nLLAMINAR_ROCM_NVNNI_DECODE_FORMATS=Q4_K \\\nLLAMINAR_ROCM_NVNNI_DECODE_SHAPES=Qwen36_GDN_TimeProjection \\\nLLAMINAR_ROCM_NVNNI_DECODE_CSV=\u002Ftmp\u002Fdecode.csv \\\nHSA_OVERRIDE_GFX_VERSION=9.0.6 \\\n.\u002Fbuild_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_native_vnni_throughput \\\n  --gtest_filter='NativeVNNIPerfTest.TrainerCsv_CodebookTagged'\n\nLLAMINAR_ROCM_NVNNI_DISABLE_GENERATED=1 \\\nLLAMINAR_ROCM_NVNNI_SWEEP_FORMATS=Q4_K \\\nLLAMINAR_ROCM_NVNNI_SWEEP_SHAPES=Qwen36_GDN_TimeProjection \\\nLLAMINAR_ROCM_NVNNI_SWEEP_M=600 \\\nLLAMINAR_ROCM_NVNNI_SWEEP_CSV=\u002Ftmp\u002Fprefill.csv \\\nHSA_OVERRIDE_GFX_VERSION=9.0.6 \\\n.\u002Fbuild_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_native_vnni_sweep \\\n  --gtest_filter='NativeVNNISweepTest.TrainerCsv_CodebookTagged'\n\npython3 tests\u002Fv2\u002Fperformance\u002Fkernels\u002Frocm\u002Fvalidate_rocm_native_vnni_trainer_csv.py \\\n  --require-policy-prefill-m --require-prefill-m 600 \u002Ftmp\u002Fprefill.csv \u002Ftmp\u002Fdecode.csv\npython3 tests\u002Fv2\u002Fperformance\u002Fkernels\u002Frocm\u002Fanalyze_rocm_native_vnni_trainer.py \\\n  --input \u002Ftmp\u002Fprefill.csv --output \u002Ftmp\u002Fprefill.inc --summary \u002Ftmp\u002Fprefill.summary\npython3 tests\u002Fv2\u002Fperformance\u002Fkernels\u002Frocm\u002Fanalyze_rocm_native_vnni_decode_trainer.py \\\n  --input \u002Ftmp\u002Fdecode.csv --output \u002Ftmp\u002Fdecode.inc --summary \u002Ftmp\u002Fdecode.summary\npython3 tests\u002Fv2\u002Fperformance\u002Fkernels\u002Fvalidate_native_vnni_generated_dispatch_ids.py \\\n  \u002Ftmp\u002Fprefill.inc \u002Ftmp\u002Fdecode.inc\n```\n\nAfter updating checked-in tables, rerun focused ROCm coverage:\n`V2_Integration_ROCm_NativeVNNI_GEMM` and\n`V2_Integration_ROCm_NativeVNNI_GEMV`.\n\n---\n\n## Key lessons (hard-won)\n\n1. **Profile before optimizing.** `rocprof` revealed the real 6.6% gap hidden under a\n   misleading 19% wallclock gap — without it you optimize the wrong thing for days.\n2. **Occupancy is table stakes, not a differentiator.** Below 2 waves nothing matters;\n   above it, scheduling perfection bought nothing here.\n3. **The compiler is very good.** `unroll(disable)` got within 6.6% of hand-tuned CK;\n   forcing cross-iteration visibility (V6) added nothing.\n4. **CK's real edge is compile-time specialization** (`HasMainK`\u002F`HasDoubleTail`\u002F\n   `MNPadding` variants → zero boundary code in the hot path). V7 approximates this at\n   runtime with safe-tile splitting.\n5. **Wallclock on PCIe-bottlenecked systems is misleading** — always use `rocprof`.\n\n---\n\n## Quick reference — one-liners\n\n```bash\n# Build the all-variants benchmark\ncmake --build build_v2_release --target v2_perf_rocm_prefill_dispatch_comparison --parallel\n\n# Truth: per-dispatch GPU kernel time\nrocprof --stats --timestamp on \\\n  .\u002Fbuild_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_rocm_prefill_dispatch_comparison \\\n  --gtest_filter=\"*WideTileVariantComparison*\" && cat results.stats.csv | column -t -s,\n\n# ISA: extract → metadata (occupancy) → disassemble → find kernels\nBINARY=build_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_rocm_prefill_dispatch_comparison\nllvm-objcopy --dump-section='__CLANG_OFFLOAD_BUNDLE__hipv4-amdgcn-amd-amdhsa--gfx906=\u002Ftmp\u002Fco.elf' \"$BINARY\" \u002Fdev\u002Fnull\nllvm-readelf --notes \u002Ftmp\u002Fco.elf 2>\u002Fdev\u002Fnull | awk '\u002F\\.name:\u002F{n=$2}\u002F\\.vgpr_count:\u002F{v=$2}\u002F\\.sgpr_count:\u002F{s=$2}\u002F\\.group_segment_fixed_size:\u002F{l=$2}\u002F\\.wavefront_size:\u002F{printf \"%-60s VGPR=%-4s SGPR=%-4s LDS=%s\\n\",substr(n,1,60),v,s,l}'\nllvm-objdump -d --mcpu=gfx906 \u002Ftmp\u002Fco.elf > \u002Ftmp\u002Fdisasm.txt\ngrep -n '\u003C_Z' \u002Ftmp\u002Fdisasm.txt | head -40\n\n# Force a variant\nLLAMINAR_ROCM_WIDE_TILE_V7=1 .\u002Fbuild_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_rocm_prefill_dispatch_comparison --gtest_filter=\"*WideTileVariantComparison*\"\n\n# Parity gate\nctest --test-dir build_v2_integration -R \".*Parity.*ROCM\" --output-on-failure\n```\n","# ROCm \u002F HIP Kernel Profiling & Tuning (Llaminar V2, gfx906)\n\n## Purpose\n\nA repeatable, evidence-driven workflow for tuning Llaminar V2 HIP INT8 GEMM\u002FGEMV kernels\non AMD Instinct MI50\u002FMI60 (gfx906), distilled from the multi-session effort that produced\nthe V7 native kernel matching\u002Fbeating AMD's Composable Kernel (CK) on N-heavy LLM shapes.\n\nIt chains three tools:\n\n1. **PerfStats GPU event timing** — production-graph replay timing and structured route\u002Fhost counters.\n2. **`rocprof`** — per-dispatch GPU kernel timing (the *only* trustworthy latency number).\n3. **LLVM ISA toolchain** (`llvm-objcopy` \u002F `llvm-readelf` \u002F `llvm-objdump`) — extract code\n   objects, read VGPR\u002FSGPR\u002FLDS metadata, disassemble, and census instructions.\n4. **The dispatch-comparison perf test + parity** — A\u002FB variants and validate correctness.\n\nThe golden rule of gfx906 tuning: **wallclock lies.** On PCIe-bottlenecked topologies,\n>90% of GEMM wallclock is memory transfer. Always quote `rocprof` per-dispatch GPU time,\nnot wallclock, when comparing kernels.\n\n## Production hot-path invariants\n\nROCm kernel tuning must preserve the production execution architecture, not\ntrade architecture for an isolated microbenchmark win:\n\n- **No dynamic allocation or deallocation.** Hot-path kernels and launch\n  bridges consume persistent workspace bindings. `hipMalloc`,\n  `hipMallocAsync`, `hipFree`, container growth, or hidden scratch allocation\n  belongs in explicit initialization\u002Fworkspace infrastructure only.\n- **No host transfer.** Do not insert H2D\u002FD2H copies, host-visible mirrors, or\n  host polling into execution. Deliberate RAM\u002Fdisk KV-cache tier movement is a\n  transfer-service operation at an explicit lifecycle boundary, not kernel\n  plumbing.\n- **No stream or device synchronization.** `hipStreamSynchronize`,\n  `hipDeviceSynchronize`, blocking copies, and event synchronization on the\n  host are forbidden in the hot path. They are permitted only in explicitly\n  scoped test\u002Fprofiler result collection or terminal result surfacing.\n- **No order-dependent atomics in batch-invariant paths.** Grouped verifier,\n  deterministic decode, and batch-invariant prefill kernels must give every\n  output a unique deterministic writer. An atomic is acceptable only when its\n  value is provably independent of inter-thread order, bitwise equivalence is\n  covered by the all-format\u002FM-totality sweep, and profiling proves it is\n  economical.\n- **Use explicit producer\u002Fconsumer events.** A producer launches on an explicit\n  non-null stream and publishes completion by recording an event on that exact\n  stream. A consumer on another stream waits for that event before reading.\n  Never publish a write on a guessed\u002Fdefault stream, transition coherence\n  manually after a blocking sync, or replace the dependency with a global\n  barrier.\n- **Remain graph-capturable end to end.** Persistent buffers, launches, event\n  record\u002Fwait edges, and collectives must be capturable. Homogeneous GPU\n  inference requires one complete captured graph; segmented execution is not a\n  tuning fallback.\n\nThe full reference write-up lives at\n`src\u002Fv2\u002Fkernels\u002Frocm\u002Fgemm\u002FREADME.vnni-gemm-tuning.md` (and the companion\n`README.native-vnni-isa-analysis.md` for GEMV). Read those for the V1-V7 history and the\nCK ISA census; this skill is the operational checklist.\n\nFor whole-model diagnosis, first measure the production captured graph:\n\n```bash\nLLAMINAR_PERF_STATS_JSON=\u002Ftmp\u002Frocm-profile.json \\\nLLAMINAR_PERF_STATS_SUMMARY=1 \\\nLLAMINAR_PERF_STATS_GPU_STAGE_TIMING=1 \\\n.\u002Fbuild_v2_release\u002Fllaminar2 benchmark -m \u003Cmodel>.gguf -d rocm:0\n```\n\nThe `stage_gpu` graph-replay rows are GPU-event measurements around the real\ncaptured graph. They do not fabricate per-stage attribution inside a monolithic\ngraph; use rocprof for that dispatch-level view. `LLAMINAR_PROFILING=1` is\ndeprecated and exists only as a warning compatibility alias to these PerfStats\nrequests. It must never disable graph capture or select eager execution.\n\n---\n\n## Profiler attachment and evidence rules\n\n- Pass `--no-mpi-bootstrap` only when profiling or debugging `llaminar2`\n  directly so the profiler attaches to the compute process rather than the\n  `mpirun` wrapper. Never use it for production or canonical benchmark timing;\n  it disables the ordinary placement bootstrap.\n- Do not pass `--no-mpi-bootstrap` to standalone test\u002Fperformance binaries;\n  they do not auto-bootstrap MPI.\n- Preserve `LLAMINAR_*`, `HSA_*`, and `ROCR_*` variables with `sudo -E` only on\n  hosts that require privilege escalation. Ordinary `sudo` strips them.\n- Write rocprof CSVs, traces, extracted code objects, and disassembly under an\n  explicit result directory outside the repository.\n- Use one exact kernel\u002FISA\u002Fshape\u002FM candidate per profiler launch. Treat\n  rocprof timing and counters as diagnostic evidence beside the unprofiled\n  canonical timing corpus; never train dispatch on profiler overhead or replay\n  duration.\n- Keep the profiler generation and metric groups required by the repository's\n  evidence collector. Do not silently substitute `rocprofv3` output for a\n  `rocprof`\u002Frocprofiler schema expected by the trainer.\n\n---\n\n## Step 0: Architecture facts you must keep in mind (gfx906)\n\n| Parameter | Value | Why it matters |\n|-----------|-------|----------------|\n| CUs | 60 | Grid sizing across CUs |\n| SIMDs\u002FCU | 4 | One wavefront (64 lanes) per SIMD |\n| VGPRs\u002FSIMD | 256 | **Determines occupancy** (waves\u002FSIMD = floor(256\u002FVGPRs-per-wave)) |\n| LDS\u002FCU | 64 KB | Shared across workgroups on a CU |\n| L1 I-cache | 16 KB\u002FCU | **Constrains loop-body ISA size** (branch bloat hurts) |\n| L2 | 4 MB shared | Caches the A tile (128×K fits for K≤8192) |\n| Wavefront | 64 threads | One instruction = 64 lanes |\n| `v_dot4_i32_i8` | 1\u002Fcycle\u002Flane | gfx906's VNNI (`vpdpbusd` equivalent) |\n\n**Occupancy ladder:** 1-64 VGPRs → 4 waves; 65-84 → 3; 85-128 → **2 (the sweet spot for\nM128×N128 INT8 GEMM, matches CK)**; 129-256 → 1 (catastrophic — no latency hiding).\nBelow 2 waves nothing else matters; going from 2 waves to \"perfect scheduling\" gave\n**zero** measurable gain on this workload.\n\n---\n\n## Step 1: Build the dispatch-comparison benchmark\n\n```bash\ncmake -B build_v2_release -S src\u002Fv2 -G Ninja -DCMAKE_BUILD_TYPE=Release -DHAVE_ROCM=ON\ncmake --build build_v2_release --target v2_perf_rocm_prefill_dispatch_comparison --parallel\n```\n\nThis binary instantiates **all native variants (V1-V7) and CK in one executable**, which\nis exactly what makes comparative disassembly and A\u002FB benchmarking fast.\n\n---\n\n## Step 2: Get the truth with `rocprof` (NOT wallclock)\n\n```bash\nrocprof --stats --timestamp on \\\n  .\u002Fbuild_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_rocm_prefill_dispatch_comparison \\\n  --gtest_filter=\"*WideTileVariantComparison*\"\n\n# Aggregate per-kernel GPU time\ncat results.stats.csv | column -t -s,\n# Per-dispatch rows are in results.csv\n```\n\n`results.stats.csv` gives the real GPU kernel time, excluding host overhead and PCIe.\nThis is the metric that exposed the \"19% wallclock gap\" as a mere **6.6% real kernel gap**\nvs CK. Rank kernels by per-dispatch GPU time; that is your optimization target list.\n\n> ⚠️ If two variants have nearly identical wallclock but you suspect a kernel difference,\n> trust `rocprof`. Wallclock convergence (all V1-V6 hit ~8.72 ms) was pure PCIe transfer,\n> not kernel behavior.\n\nForce a specific variant with env vars when isolating:\n\n| Variable | Effect |\n|----------|--------|\n| `LLAMINAR_ROCM_WIDE_TILE_V7=1` | Force V7 |\n| `LLAMINAR_ROCM_WIDE_TILE_V6=1` … `_V2=1` | Force V6 … V2 |\n\n### Isolate one production-shaped launch\n\nWhole-graph PerfStats identifies the expensive captured fragment. Attribute\nindividual kernels with a standalone performance harness that invokes the same\nbackend entrypoint, geometry, persistent scratch contract, and tensor format as\nproduction. Never disable graph capture or select eager inference merely to\nmake a profiler attach: that measures a different engine. Some rocprofiler\nversions cannot trace retained HIP graphs reliably; retain the outer graph\nevent measurement and profile the isolated real kernel instead.\n\nKeep canonical timing unprofiled, then gather timing, counters, and ISA in a\nseparate deterministic profiler invocation for that exact candidate. Read\n[`references\u002Frocprof-isolated-kernel.md`](references\u002Frocprof-isolated-kernel.md)\nfor the tested rocprof v1 dispatch-range\u002Fcounter commands, metric\ninterpretation, wave64 vectorization checks, and ROCm 7 `.hip_fatbin`\nextraction workflow.\n\nFor ROCm FlashAttention2, build\n`v2_perf_rocm_flash_attention_prefill` and use its exact-candidate test so one\nprofiler invocation contains one captured transaction and no unrelated model\nwork. Select the production geometry explicitly: `qwen7_tp1` exercises the\npacked device-direct branch, `qwen27_tp4` exercises long-context partition\npublication\u002Freduction, and `qwen35_tp8` exercises replicated GQA. For example:\n\n```bash\nLLAMINAR_ROCM_FA2_PROFILE_GEOMETRY=qwen7_tp1 \\\nLLAMINAR_ROCM_FA2_PROFILE_M=128 \\\nLLAMINAR_ROCM_FA2_PROFILE_KV=8192 \\\nLLAMINAR_ROCM_FA2_PROFILE_CAPACITY=131072 \\\nLLAMINAR_ROCM_FA2_PROFILE_FORMAT=FP16 \\\nLLAMINAR_ROCM_FA2_PROFILE_MODE=context \\\nrocprofv3 --kernel-trace --stats --output-directory \u002Ftmp\u002Frocm-fa2-qwen7 \\\n  -- .\u002Fbuild_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_rocm_flash_attention_prefill \\\n  --gtest_filter=ROCmFlashAttentionContextParallelPerf.ExactCandidateProfilerLaunch\n```\n\nUse `LLAMINAR_ROCM_FA2_PROFILE_PHASE_BLOCKS`,\n`LLAMINAR_ROCM_FA2_PROFILE_SLOTS`,\n`LLAMINAR_ROCM_FA2_PROFILE_REDUCER_WAVEFRONTS`, and\n`LLAMINAR_ROCM_FA2_PROFILE_REDUCER_BLOCKS` only to isolate a measured tournament\ncandidate. Leave them unset to profile the installed capture-time policy.\n\n---\n\n## Step 3: ISA deep-dive (occupancy + scheduling)\n\n`rocprof` tells you *which* kernel is slow; the LLVM toolchain tells you *why*. HIP\nexecutables embed gfx906 code objects as ELF bundle sections.\n\n```bash\nBINARY=build_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_rocm_prefill_dispatch_comparison\n\n# 1. Extract the gfx906 code object\nllvm-objcopy \\\n  --dump-section='__CLANG_OFFLOAD_BUNDLE__hipv4-amdgcn-amd-amdhsa--gfx906=\u002Ftmp\u002Fco.elf' \\\n  \"$BINARY\" \u002Fdev\u002Fnull\n\n# 2. Read per-kernel resource metadata (VGPR \u002F SGPR \u002F LDS → occupancy)\nllvm-readelf --notes \u002Ftmp\u002Fco.elf 2>\u002Fdev\u002Fnull | awk '\n  \u002F\\.name:\u002F{name=$2} \u002F\\.vgpr_count:\u002F{vgpr=$2} \u002F\\.sgpr_count:\u002F{sgpr=$2}\n  \u002F\\.group_segment_fixed_size:\u002F{lds=$2}\n  \u002F\\.wavefront_size:\u002F{printf \"%-60s VGPR=%-4s SGPR=%-4s LDS=%s\\n\",substr(name,1,60),vgpr,sgpr,lds}'\n\n# 3. Full disassembly (~45k lines for the full binary)\nllvm-objdump -d --mcpu=gfx906 \u002Ftmp\u002Fco.elf > \u002Ftmp\u002Fdisasm.txt\n\n# 4. Locate kernels (CK symbols are >1000 chars due to C++ templates)\ngrep -n '\u003C_Z' \u002Ftmp\u002Fdisasm.txt | head -40\n```\n\nFor ROCm 7 objects that use `.hip_fatbin`, use the extraction workflow in the\nlinked isolated-kernel reference. The unprofiled benchmark, rocprof evidence,\nand static ISA must always describe the same compiled candidate.\n\n### Read the metadata FIRST\n\nThe VGPR\u002FSGPR\u002FLDS line decides occupancy before you read a single instruction:\n\n| Symptom in metadata | Diagnosis | Fix |\n|---------------------|-----------|-----|\n| VGPR ≥ 129 (1 wave) | register explosion (e.g. V4: 256 VGPRs + 118 spills) | add `__launch_bounds__(256, 2)`; stop full-unrolling the inner loop |\n| VGPR 85-128 (2 waves) | the gfx906 sweet spot — good | only algorithmic\u002Fstructural wins left |\n| Spills > 0 | inner loop unrolled with too many live accumulators | `#pragma clang loop unroll(disable)` or `unroll_count(2)` |\n| LDS > 32 KB | limits workgroups\u002FCU | shrink KT or move A to L2 instead of LDS |\n\n### Locate a kernel by distinctive symbol fragment\n\n| Grep pattern | Kernel |\n|--------------|--------|\n| `qgemm_int8_vnni_wide_tile_v5` | native V5 |\n| `Li256E.*Lb1ELb0E.*PassThrough` | CK 128×128, HasMainK=true, no padding (hot path) |\n| `Li64E` \u002F `Li32E` | CK 64×64 \u002F 32×32 (medium \u002F decode) |\n\n### Instruction census within a kernel's line range\n\n```bash\nSTART=18369; END=22092  # from the grep above\nfor pat in v_dot4_i32_i8 ds_read_b128 ds_read_b32 ds_write s_barrier \\\n           s_waitcnt s_nop s_cbranch buffer_load s_swappc; do\n  printf \"%s: \" \"$pat\"\n  awk \"NR>=$START && NR\u003C=$END\" \u002Ftmp\u002Fdisasm.txt | grep -c \"$pat\"\ndone\n```\n\nWhat to read for:\n- `s_barrier` count → loop structure. Double-buffered (CK, V3-V7) ≈ 3 barriers;\n  single-buffered (V1) = 2 per iteration.\n- `s_cbranch` count → boundary-check bloat. High branch count in the hot loop wastes\n  the 16 KB L1 I-cache (V5 had 15 fast-path + 84 boundary-path = 99 branches\u002Fiter).\n- `s_nop` → wasted cycles (fewer is better; CK had 2 in the entire kernel).\n- `s_swappc` → subroutine calls (only V1; inline everything in the hot loop).\n- `s_waitcnt lgkmcnt(N)` with N>0 between `ds_read`\u002F`v_dot4` → **progressive waits =\n  good pipelining** (CK keeps ~5 LDS reads in flight at all times).\n\n---\n\n## Step 4: The seven latency-hiding levers (in priority order)\n\nApply these to the targeted kernel; the first two are mandatory, the rest are refinements.\n\n1. **`__launch_bounds__(threads, min_waves)` — non-negotiable.** The 2nd arg caps VGPRs\n   (256\u002Fmin_waves). Omitting it let V4 use 256 VGPRs + spills → 1 wave → slower than V1.\n   1→2 waves is often a 3-5× swing, not 2×.\n2. **LDS double-buffering.** Ping-pong even\u002Fodd buffers: compute buf[cur] while loading\n   buf[nxt], one `__syncthreads()` between. Kills the serial load→barrier→compute cycle.\n3. **Inner-loop unroll control.** `#pragma unroll` → VGPR explosion (V4). Prefer\n   `unroll(disable)` (V5: clean 117 VGPRs) or `unroll_count(2)` (V6). On gfx906 these two\n   gave **identical** performance — don't over-invest here once you have 2 waves.\n4. **Progressive `s_waitcnt`** — let the compiler keep 5-6 LDS reads in flight; don't force\n   `lgkmcnt(0)`.\n5. **Register recycling** — reuse a `v_dot4` source VGPR as an accumulator\u002Fload target once\n   dead; this is how CK fits 64 accumulators in 128 VGPRs.\n6. **16-byte vectorized load\u002Fstore** — `uint4` reinterpret_cast → `global_load_dwordx4` \u002F\n   `ds_write_b128` \u002F `ds_read_b128`. 4× scalar throughput.\n7. **Safe-tile split (the V7 winner)** — split the tile loop into a *safe* phase (loads\n   provably in-bounds → unconditional vectorized loads, zero branches) and a *boundary*\n   phase (full checks + scalar fallback, runs 0-2 tiles or never for aligned shapes). For\n   aligned LLM shapes (e.g. N=18944 % 128 == 0) the boundary loop is dead code and the hot\n   loop's ISA is maximally tight in the 16 KB I-cache. This was the structural change that\n   closed the last 6.6% — **where you branch matters more than how you compute.**\n\n---\n\n## Step 5: Validate (correctness + the right benchmark)\n\n```bash\n# Re-run the dispatch comparison and confirm rocprof GPU time improved\nrocprof --stats --timestamp on \\\n  .\u002Fbuild_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_rocm_prefill_dispatch_comparison \\\n  --gtest_filter=\"*WideTileVariantComparison*\"\ncat results.stats.csv | column -t -s,\n\n# Full-model ROCm parity must stay PASS\nctest --test-dir build_v2_integration -R \".*Parity.*ROCM\" --output-on-failure\n```\n\nAccept a change only if **`rocprof` per-dispatch GPU time** improves beyond noise AND\nparity stays PASS. A wallclock-only improvement on a PCIe-bound rig is not evidence.\n\nRemember shape-dependence: V7\u002FKT16 wins N-heavy shapes (FFN_Up, Gate, LM_Head), but\nK-heavy shapes (FFN_Down, AttnOut) still favor V1\u002FV3's simpler\u002Ftall-K geometry. Tune and\nselect per shape; don't assume one kernel wins everywhere.\n\n---\n\n## Step 6: Train generated NativeVNNI dispatch tables\n\nRead `.agents\u002Fnativevnni-gemm-tuning\u002FSKILL.md` for the shared corpus, learner,\ncertification, Git LFS, and installation workflow. This section owns only\nROCm-specific kernel\u002Fprofiler constraints.\n\nROCm NativeVNNI dispatch should follow the same automatic sweep\u002Fgenerate\u002Fvalidate\npipeline as CUDA. Avoid hand-coded per-shape overrides except as throwaway\nexperiments.\n\n1. Keep the shape inventory in the perf harness aligned with real model routes:\n   `tests\u002Fv2\u002Fperformance\u002Fkernels\u002Frocm\u002FPerf__NativeVNNI_Sweep.cpp` for prefill\n   and `tests\u002Fv2\u002Fperformance\u002Fkernels\u002Frocm\u002FPerf__NativeVNNI_Throughput.cpp` for\n   decode\u002FGEMV.\n2. For decode\u002FGEMV dispatch tables, use the Git-LFS-aware turnkey transaction:\n   `scripts\u002Ftrain_native_vnni_dispatch.sh --backend rocm --install`.\n   The lower-level `refresh_native_vnni_dispatch_tables.sh` remains the phase\n   executor used by the driver and for focused diagnostic collection.\n   It runs with `LLAMINAR_ROCM_NVNNI_DISABLE_GENERATED=1`, sweeps canonical\n   serial `M=1` first and grouped verifier `M=2..16,31` against that exact frozen\n   dependency, generates the include, validates it, and can install it with\n   `--install`. M31 is a deeper sentinel rather than a production maximum.\n   Keep public M1 decisions keyed by every runtime-visible discriminator.\n   Grouped verifier buckets must inherit the frozen M1 K partition and ordered\n   reduction tree; selecting a different M2+ family is incompatible with the\n   byte-exact serial-row contract.\n   The durable decode selector must generalize by aspect ratio plus work-size\n   segments. Exact `(M,N,K)` winners are allowed only as overlays above that\n   broad fallback; do not land an exact-shape-only table that would require\n   retraining for every nearby model dimension.\n   Score generated tables on the runtime dispatch surface, not raw\n   source-format rows. If several GGUF formats share a NativeVNNI codebook, the\n   runtime can only choose one `(codebook,M,N,K)` tuning; analyzers should\n   collapse aliases before enforcing exact-hit thresholds.\n   Use staged strict profiles when the full shape inventory is too expensive in\n   one pass: `--profile qwen36-core` covers FFN\u002FGDN projections and\n   `--profile qwen36-lm-head` covers the giant LM-head shape. The LM-head\n   profile defaults to `LLAMINAR_ROCM_NVNNI_DECODE_REFERENCE=native-auto`, which\n   compares candidates with a reset-AUTO native output instead of building a\n   multi-GB FP32 hipBLAS mirror. Treat that as a dispatch-equivalence trainer\n   proxy; model parity and benchmarks still gate any `--install`.\n   Production collection derives immutable profiler requests only after the\n   canonical timing CSV and raw timing sidecar are sealed. Each request starts\n   a fresh process. `roctxProfilerResume(0)`\u002F`roctxProfilerPause(0)` bracket one\n   extra production launch, while a request-specific ROCTx range identifies the\n   exact pipeline in PMC passes. The trace pass keeps physical kernel names;\n   renamed PMC rows join back by contiguous dispatch order. On gfx906, collect\n   `FetchSize`, `WriteSize`, `Wavefronts`, `VALUUtilization`, and\n   `LDSBankConflict` as reviewed singleton passes. Combining the TCC traffic\n   metrics exceeds hardware profile capabilities and can hang rocprofiler's\n   abort path. Never let profiler replay or overhead enter canonical timing.\n   The final `rocm_profiler_features.csv` must be the authenticated export of\n   the canonical observation, request, and evidence manifests, with one row per\n   physical dispatch rather than an ad hoc join of rocprof CSVs.\n   The common policy fit may separately use every ROCm and CUDA device through\n   exact leaf-primary scorer DSOs. The refresh wrapper auto-discovers devices;\n   `--policy-accelerators` fixes the inventory and `--policy-lanes` controls\n   independent CPU orchestration lanes per device. Those scorer launches do not\n   time candidate kernels and never enter rocprof evidence. Keep CUDA and HIP\n   in separate worker processes and hard-fail any requested accelerator error.\n3. Use `--profile family-smoke` for a bounded representative training pass before\n   a full acceptance refresh. This profile is stratified by format: it runs one\n   small sweep per codebook\u002Ffamily, writes per-format partial CSVs, combines them,\n   then runs the normal train\u002Fgenerate\u002Fvalidate flow. This avoids a capped sweep\n   accidentally covering only the first format in the list.\n\n   ```bash\n   scripts\u002Frefresh_native_vnni_dispatch_tables.sh --backend rocm \\\n     --profile family-smoke \\\n     --rocm-formats Q4_0,IQ4_XS \\\n     --m-values 1,2\n   ```\n\n   `family-smoke` is a workflow\u002Fproxy gate, not production acceptance. Do not\n   replace broad checked-in tables from this profile alone; run `qwen36` or\n   `all`, then model-level parity and benchmark gates, before `--install`.\n   Treat the trainer's FP32 cosine as a health filter, not the exact dispatch\n   oracle: packed K-quant formats such as Q4_K\u002FQ2_K can sit just below the\n   generic FP32 gate while still matching the native packed contract. Keep\n   `V2_Integration_ROCm_NativeVNNI_GEMV`,\n   `V2_Integration_ROCmQuantisedGemmSmallM`, and model parity as the promotion\n   gates.\n4. If you are debugging the ROCm trainer directly, run sweeps with\n   `LLAMINAR_ROCM_NVNNI_DISABLE_GENERATED=1`. This is important:\n   AUTO normally consumes the checked-in generated tables, so training without\n   this guard can benchmark the previous table and emit no explicit winner.\n5. Validate CSVs with\n   `tests\u002Fv2\u002Fperformance\u002Fkernels\u002Frocm\u002Fvalidate_rocm_native_vnni_trainer_csv.py`.\n   It checks decode\u002Fprefill schema, shared codebook ids, and canonical prefill\n   bucket policy from `src\u002Fv2\u002Futils\u002FPrefillGraphBucketDefaults.h`.\n6. Generate prefill tables with\n   `tests\u002Fv2\u002Fperformance\u002Fkernels\u002Frocm\u002Fanalyze_rocm_native_vnni_trainer.py` and\n   decode tables with\n   `tests\u002Fv2\u002Fperformance\u002Fkernels\u002Frocm\u002Fanalyze_rocm_native_vnni_decode_trainer.py`.\n   The checked-in outputs are\n   `src\u002Fv2\u002Fkernels\u002Frocm\u002Fgemm\u002FROCmNativeVNNIPrefillDispatchGenerated.inc` and\n   `src\u002Fv2\u002Fkernels\u002Frocm\u002Fgemm\u002FROCmNativeVNNIDecodeDispatchGenerated.inc`.\n7. Validate generated codebook references with\n   `tests\u002Fv2\u002Fperformance\u002Fkernels\u002Fvalidate_native_vnni_generated_dispatch_ids.py`\n   and run the focused units:\n   `V2_Unit_ROCmNativeVNNITrainerCsvValidator`,\n   `V2_Unit_ROCmNativeVNNITrainerGenerator`,\n   `V2_Unit_ROCmNativeVNNIDecodeTrainerGenerator`, and\n   `V2_Unit_NativeVNNIGeneratedDispatchCodebooks`.\n\n### MTP verifier dispatch mode\n\nROCm grouped verifier kernels can be fast only if their generated small-M policy\nalso matches rowwise serial decode. The shared convention is\n`ITensorGemm::beginVerifierDecodeEquivalentScope()`: stages keep the returned\nRAII scope alive while running serial verifier replay or grouped verifier\npublication. ROCm implements the scope by selecting the M=1 decode-equivalent\nNativeVNNI policy. Do not call ROCm mode toggles directly from stage code, and\ndo not hide unsupported verifier modes behind quiet rowwise fallbacks.\nFor shared-expert MoE verifier rows, compare grouped publication against the\ncanonical M=1 GEMM\u002FSwiGLU\u002Fdown replay oracle unless a grouped decode shortcut\nhas already passed the same strict all-codebook gates.\n\nCompact refresh example:\n\n```bash\nLLAMINAR_ROCM_NVNNI_DISABLE_GENERATED=1 \\\nLLAMINAR_ROCM_NVNNI_DECODE_FORMATS=Q4_K \\\nLLAMINAR_ROCM_NVNNI_DECODE_SHAPES=Qwen36_GDN_TimeProjection \\\nLLAMINAR_ROCM_NVNNI_DECODE_CSV=\u002Ftmp\u002Fdecode.csv \\\nHSA_OVERRIDE_GFX_VERSION=9.0.6 \\\n.\u002Fbuild_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_native_vnni_throughput \\\n  --gtest_filter='NativeVNNIPerfTest.TrainerCsv_CodebookTagged'\n\nLLAMINAR_ROCM_NVNNI_DISABLE_GENERATED=1 \\\nLLAMINAR_ROCM_NVNNI_SWEEP_FORMATS=Q4_K \\\nLLAMINAR_ROCM_NVNNI_SWEEP_SHAPES=Qwen36_GDN_TimeProjection \\\nLLAMINAR_ROCM_NVNNI_SWEEP_M=600 \\\nLLAMINAR_ROCM_NVNNI_SWEEP_CSV=\u002Ftmp\u002Fprefill.csv \\\nHSA_OVERRIDE_GFX_VERSION=9.0.6 \\\n.\u002Fbuild_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_native_vnni_sweep \\\n  --gtest_filter='NativeVNNISweepTest.TrainerCsv_CodebookTagged'\n\npython3 tests\u002Fv2\u002Fperformance\u002Fkernels\u002Frocm\u002Fvalidate_rocm_native_vnni_trainer_csv.py \\\n  --require-policy-prefill-m --require-prefill-m 600 \u002Ftmp\u002Fprefill.csv \u002Ftmp\u002Fdecode.csv\npython3 tests\u002Fv2\u002Fperformance\u002Fkernels\u002Frocm\u002Fanalyze_rocm_native_vnni_trainer.py \\\n  --input \u002Ftmp\u002Fprefill.csv --output \u002Ftmp\u002Fprefill.inc --summary \u002Ftmp\u002Fprefill.summary\npython3 tests\u002Fv2\u002Fperformance\u002Fkernels\u002Frocm\u002Fanalyze_rocm_native_vnni_decode_trainer.py \\\n  --input \u002Ftmp\u002Fdecode.csv --output \u002Ftmp\u002Fdecode.inc --summary \u002Ftmp\u002Fdecode.summary\npython3 tests\u002Fv2\u002Fperformance\u002Fkernels\u002Fvalidate_native_vnni_generated_dispatch_ids.py \\\n  \u002Ftmp\u002Fprefill.inc \u002Ftmp\u002Fdecode.inc\n```\n\nAfter updating checked-in tables, rerun focused ROCm coverage:\n`V2_Integration_ROCm_NativeVNNI_GEMM` and\n`V2_Integration_ROCm_NativeVNNI_GEMV`.\n\n---\n\n## Key lessons (hard-won)\n\n1. **Profile before optimizing.** `rocprof` revealed the real 6.6% gap hidden under a\n   misleading 19% wallclock gap — without it you optimize the wrong thing for days.\n2. **Occupancy is table stakes, not a differentiator.** Below 2 waves nothing matters;\n   above it, scheduling perfection bought nothing here.\n3. **The compiler is very good.** `unroll(disable)` got within 6.6% of hand-tuned CK;\n   forcing cross-iteration visibility (V6) added nothing.\n4. **CK's real edge is compile-time specialization** (`HasMainK`\u002F`HasDoubleTail`\u002F\n   `MNPadding` variants → zero boundary code in the hot path). V7 approximates this at\n   runtime with safe-tile splitting.\n5. **Wallclock on PCIe-bottlenecked systems is misleading** — always use `rocprof`.\n\n---\n\n## Quick reference — one-liners\n\n```bash\n# Build the all-variants benchmark\ncmake --build build_v2_release --target v2_perf_rocm_prefill_dispatch_comparison --parallel\n\n# Truth: per-dispatch GPU kernel time\nrocprof --stats --timestamp on \\\n  .\u002Fbuild_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_rocm_prefill_dispatch_comparison \\\n  --gtest_filter=\"*WideTileVariantComparison*\" && cat results.stats.csv | column -t -s,\n\n# ISA: extract → metadata (occupancy) → disassemble → find kernels\nBINARY=build_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_rocm_prefill_dispatch_comparison\nllvm-objcopy --dump-section='__CLANG_OFFLOAD_BUNDLE__hipv4-amdgcn-amd-amdhsa--gfx906=\u002Ftmp\u002Fco.elf' \"$BINARY\" \u002Fdev\u002Fnull\nllvm-readelf --notes \u002Ftmp\u002Fco.elf 2>\u002Fdev\u002Fnull | awk '\u002F\\.name:\u002F{n=$2}\u002F\\.vgpr_count:\u002F{v=$2}\u002F\\.sgpr_count:\u002F{s=$2}\u002F\\.group_segment_fixed_size:\u002F{l=$2}\u002F\\.wavefront_size:\u002F{printf \"%-60s VGPR=%-4s SGPR=%-4s LDS=%s\\n\",substr(n,1,60),v,s,l}'\nllvm-objdump -d --mcpu=gfx906 \u002Ftmp\u002Fco.elf > \u002Ftmp\u002Fdisasm.txt\ngrep -n '\u003C_Z' \u002Ftmp\u002Fdisasm.txt | head -40\n\n# Force a variant\nLLAMINAR_ROCM_WIDE_TILE_V7=1 .\u002Fbuild_v2_release\u002Ftests\u002Fv2\u002Fv2_perf_rocm_prefill_dispatch_comparison --gtest_filter=\"*WideTileVariantComparison*\"\n\n# Parity gate\nctest --test-dir build_v2_integration -R \".*Parity.*ROCM\" --output-on-failure\n```\n",{"name":5,"description":7},"master","454741b1b2228bc6874e46ade75bbf523a8385d5",".agents\u002Frocm-tuning",4,"https:\u002F\u002Fgithub.com\u002FLlaminar\u002Fllaminar","https:\u002F\u002Fllaminar.ai","https:\u002F\u002Fgithub.com\u002FLlaminar","Home of the Llaminar inferencing engine.","2026-11-15 04:04:16",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add Llaminar\u002Fllaminar --skill rocm-tuning",{"tool":58,"command":59},"bunx","bunx skills add Llaminar\u002Fllaminar --skill rocm-tuning",{"tool":61,"command":62},"pnpm","pnpm dlx skills add Llaminar\u002Fllaminar --skill rocm-tuning","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLlaminar\u002Fllaminar\u002Fblob\u002Fmaster\u002F.agents\u002Frocm-tuning\u002FSKILL.md",true,[66],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Frocprof-isolated-kernel.md","REFERENCE","参考文档",5477,"https:\u002F\u002Fgithub.com\u002FLlaminar\u002Fllaminar\u002Fblob\u002Fmaster\u002F.agents\u002Frocm-tuning\u002Freferences\u002Frocprof-isolated-kernel.md",[73,78,86,96,104,109],{"skillNo":74,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":38},"01M718P9ZZSG781K5PXM1V3KG2","https:\u002F\u002Fgithub.com\u002FLlaminar\u002Fllaminar\u002Fblob\u002Fmaster\u002F.codex\u002Fskills\u002Frocm-tuning\u002FSKILL.md",[],[19,20,18],{"skillNo":79,"name":80,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":38},"01M718P95WX88GYN9MTSC6AE40","mtp-tuning","https:\u002F\u002Fgithub.com\u002FLlaminar\u002Fllaminar\u002Fblob\u002Fmaster\u002F.codex\u002Fskills\u002Fmtp-tuning\u002FSKILL.md",[],[84,20,85],"mtp tuning","mtp",{"skillNo":87,"name":88,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":38},"01M718P7JK26A3N6VZYSE2J36T","cuda-kernel-profiling","https:\u002F\u002Fgithub.com\u002FLlaminar\u002Fllaminar\u002Fblob\u002Fmaster\u002F.codex\u002Fskills\u002Fcuda-kernel-profiling\u002FSKILL.md",[],[92,93,94,95],"profiling","cuda kernel profiling","cuda","kernel",{"skillNo":97,"name":98,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":38},"01M718P5YCB9J40NZZ0PRAKS5V","cpu-tuning","https:\u002F\u002Fgithub.com\u002FLlaminar\u002Fllaminar\u002Fblob\u002Fmaster\u002F.codex\u002Fskills\u002Fcpu-tuning\u002FSKILL.md",[],[102,103,20],"cpu tuning","CPU",{"skillNo":105,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":38},"01M718P57PZ4G3X1B24ZVWR2PQ","https:\u002F\u002Fgithub.com\u002FLlaminar\u002Fllaminar\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Frocm-tuning\u002FSKILL.md",[],[19,20,18],{"skillNo":110,"name":111,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":38},"01M718P4GF2X3EHBTY7ZB1Q2T2","nativevnni-gemm-tuning","https:\u002F\u002Fgithub.com\u002FLlaminar\u002Fllaminar\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fnativevnni-gemm-tuning\u002FSKILL.md",[],[20,115],"nativevnni gemm tuning"]