[Benchmark] RX 6600M / Inkling-2 Mini SQ-15: reuse FP8 K/V across GQA heads on HIP

Aperta
#7,313 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
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp, linux

Direzione di ricerca

Read ink_hip_ops.hip.h and ink_hip_backend.hip.cpp, then reproduce the two opt-in FP8 attention switches on an RX 6600M (gfx1032) using the provided command and baseline settings. Compare kernel timings and outputs for the grouped prefill and single-token split-KV paths; done means the changes are independently evaluable and preserve the reported bitwise-equal outputs. The issue requests interest in a PR, so confirm maintainer direction before investing in implementation.

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

Descrizione

On an RX 6600M, two opt-in FP8 attention changes reduced full-model time to the first token from 26.95 to 25.78 s for a 1,024-token prompt across five paired runs. The separate global attention kernel at position 32,768 went from 543.33 to 141.43 ms with a 256-token prefill chunk. Would you be interested in an opt-in PR for the HIP/RDNA2 path?

Changes. In ink_hip_ops.hip.h and ink_hip_backend.hip.cpp, one wave loads and unpacks K/V once for the three query heads that share it in the 24:8:128 GQA geometry. Each query head still computes its own scores and softmax in its original order. A 256-entry FP32 table in LDS is built using the existing E4M3 conversion, and the single-token split-KV path can use the same lookup technique. The grouped path is gated to gfx1032, FP8 KV, contiguous single-slot prefill, and B ≥ 64. The two switches can be evaluated independently.

Full-model median Baseline Both switches
Prefill, 1,024 tokens 38.00 tok/s 39.73 tok/s
Decode, 80-token response to that prompt 13.44 tok/s 13.67 tok/s
Total time, same prompt and response 32.94 s 31.56 s
Decode, 136-token prompt 13.53 tok/s 14.50 tok/s

strata-rdna2-fp8-attention-repro.zip

All five pairs favored the candidate on total time for the 1,024-token prompt. All ten 80-token responses to that prompt matched. Short-prompt free generations varied even across baseline runs. A separate fixed-input check (64-token batch followed by a single token) matched 13,003,770 FP32 logits bit for bit. The timings use one local engine binary with fresh processes in AB/BA pairs, zero prefix reuse and zero storage reads during the requests.

Kernel-only results. HIP events with synthetic FP8 K/V, production head geometry and bitwise-equal outputs: at B=256 and position 32,768, global attention took 543.33 → 141.43 ms and sliding-window attention 16.25 → 5.49 ms. One-token global split-KV attention at position 30,720 took 2.193 → 1.006 ms. These numbers cover attention kernels. The 32K full-model speedup remains unmeasured. The candidate run on 3,072 input tokens stopped at the system RAM guard and is excluded from paired timings.

Reproduction. RX 6600M (gfx1032, 8 GiB), Ryzen 5 5600H, 16 GB RAM, Ubuntu 24.04, local HIP strata-inkling 0.1.67, native Inkling-2-Mini-SQ-15.strata. Both arms held 1,148 experts in VRAM and 1,924 in RAM. Both retained the same earlier local optimizations, including the Q8ROW projection reported in #7260.

STRATA_INK_FP8_ATTN_LUT=1 STRATA_INK_GROUPED_FP8_PREFILL=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

Use 0 for both switches in the baseline arm. The related CUDA prefill report #7031 covers repeated packing across query blocks. This report concerns shared FP8 reads and conversion across HIP query heads.

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.