[Benchmark] RX 6600M / Inkling-2 Mini SQ-15: exact Q8ROW attention output projection on HIP

Aperta
#7,260 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

Read the HIP output projection and ShortConv path at engine/src/inkling2/hip/ink_hip_backend.hip.cpp near line 4095, then inspect the attached reproduction patch and instructions. Rebuild and compare the flag-off and flag-on paths on supported HIP hardware, checking exact output and performance against the reported measurements. Done means the opt-in path reproduces the BF16 results and its performance and memory tradeoffs are independently verified.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What did you measure, or what went wrong

On an RX 6600M, keeping the original row-scaled Q8 attention output weights from the native SQ-15 file reduced the full-model wo_post stage from 6.05 to 4.38 ms per generated token (−27.6%). All 6,401,856 FP32 logits matched bit for bit across 32 fixed input positions. I would welcome an independent HIP/RDNA2 reproduction and feedback on an opt-in implementation.

What changes. The HIP loader currently expands these matrices to BF16. For one-token decode the prototype reads the original signed bytes and row scales, reconstructs the same BF16 values inside the fused output projection / ShortConv kernel and keeps the accumulation order. This applies to 20 of 24 physical matrices, covering 40 of 48 layer visits per token in this pack. Other batch sizes and verification use the original BF16 math with one shared expansion buffer. The calculated net saving for these weights, including that buffer, is about 121 MiB. Upstream HIP path. The related CUDA work uses GGUF Q8_0; this report covers native SQ-15 Q8ROW on HIP. Related CUDA commit.

Measurement Baseline Direct Q8ROW Change
Full-model WO stage, profiled separately 6.05 ms/token 4.38 ms/token −27.6% time
Native decode, 136-token prompt, 128 generated tokens 13.898 tok/s 14.021 tok/s +0.88%
HTTP decode, 136-token prompt, 192 generated tokens 13.634 tok/s 14.172 tok/s +3.95%

Method and limits. The stage and native comparisons used the same binary with STRATA_INK_EXACT_Q8_WO=0/1 in A/B/B/A order. Stage medians pool the last 30 positions from each of two processes per arm. Native measurements had identical output token IDs. HTTP compared the previous local executable with the candidate in four fresh processes, keeping the existing local optimizations and expert placement fixed. The experimental packed-router switch was off. HTTP decode rates in order were 13.916, 14.178, 14.167 and 13.363 tok/s. The two pairs favored Q8 by 1.88% and 6.01%. All four replies were identical, with zero prompt-cache reuse and zero process storage reads during the timed requests. A separate post-rollout request measured 14.197 tok/s. Two pairs per interface on one card give a preliminary end-to-end estimate. An earlier HTTP series stopped at the system RAM reserve; its baseline-only request was excluded.

Environment. Ubuntu 24.04, Ryzen 5 5600H, 16 GB RAM, Radeon RX 6600M (gfx1032, 8 GiB), local strata-inkling 0.1.67, Inkling-2-Mini-SQ-15.strata, 4K context, one slot, FP8 KV, drafting off, six CPU workers. Both arms kept 1,148 experts in VRAM and 1,924 in RAM. The isolated microbenchmark also reproduced the BF16 values of 28,311,552 weights bit for bit and matched 737,280 output, history and snapshot values on four real SQ-15 matrices.

Reproduction. The attachment contains the opt-in HIP patch, instructions and measurement data. After building the patched engine, set the flag to 0 and then 1, restarting the process for each arm. The native serving command used these arguments (substitute local paths):

STRATA_INK_EXACT_Q8_WO=1 ./strata-inkling --serve --native "$MODEL" \
  --max-context 4096 --kv fp8 --draft off --vram-experts-gb 4.87 \
  --vram-reserve-mib 512 --chunk 128 --threads 6 --ram-experts-gb 7.00
Reproduction status

Measured locally

strata-rdna2-q8-wo-repro.zip

Lingua principale
C++
Stelle
11.6k
Fork
1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Niko1221/Strata

Tutte le issue di Niko1221/Strata

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.