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

オープン
#7,260 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
C++
スター
11.6k
フォーク
1k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Niko1221/Strata のほかの issue

Niko1221/Strata の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。