Skip to content

[Engine] Inkling 2 on AMD native Linux (gfx1200): prompts ~4x below an unmerged branch #309

Backlog

Description

@Tako88

Area

[Engine] (speed, kernels, models, the server and API)

Your question

I ran Inkling 2 Mini on an AMD card on native Linux, which the Inkling page lists as not run yet. It works, but prompts
are about 4x slower than an unmerged branch on the same card. Is that the expected state today, and is that branch's
work going into main?

Setup: RX 9060 XT 16 GB, gfx1200, CachyOS, kernel 7.3.5-2-cachyos, ROCm 10.1.0, no container. Main at 36e654b, built
from source with cmake -S engine -B build -DCMAKE_BUILD_TYPE=Release -DSTRATA_ENABLE_HIP=ON -DSTRATA_ENABLE_CUDA=OFF -DCMAKE_HIP_ARCHITECTURES=gfx1200 and --target strata-poly -j4. It configured and built clean in about two minutes.

The branch I am comparing against is 3bc4042 from
https://github.com/okada-shogo/PolyStrata/tree/inkling2-amd-preview (15 commits on old PR #200). It gives prompt
attention a wave32 WMMA kernel on gfx12 by default and makes NVFP4's int8 prompt tiles the HIP default. Main has
neither on AMD as far as I can see, and those two look like the whole difference.

Two questions:

  1. Is ~250-290 tok/s prompts the expected state for Inkling 2 on RDNA4, or should main do better on gfx1200 and
    something in my build or flags is wrong?
  2. Is the preview branch's work planned as PRs? poly: Inkling 2 Mini (inkling2 / inkling2_loop) #200 is closed and I could not find it in the open ones.

What you tried

  • Built main twice: the default build, and one with -DSTRATA_POLY_MMQ=ON -DSTRATA_GGML_DIR=engine/third_party/strata-llama.
    The default is faster, so the numbers below use it.
  • Ran the same two models and the same prompts on the preview build from the branch above, on the same card.
  • Compared greedy output: main and the preview build give the same token ids on both models, so only speed differs.
  • Load: UD-Q2_K_XL fits whole (3,072 of 3,072 experts, 7.3 GiB). UD-Q4_K_M keeps 1,976 of 3,072 (8.9 GiB).
  • Did not run the HIP tests, Windows, other cards, or prompts past 8,192 tokens.

Results

--max-context 32768 --vram-reserve-mib 2048 --kv q8_0, greedy, one engine a run. Prompts are 2,048 and 8,192 tokens
of text. Writing is 128 tokens after a 1,200-token prompt. Two runs of the default build differ by under 2%.

UD-Q2_K_XL 2,048 UD-Q2_K_XL 8,192 UD-Q4_K_M 2,048 UD-Q4_K_M 8,192 writing
main, default build 274 tok/s 286 215 265 39.4
main, STRATA_POLY_MMQ=ON 171 172 53 81 39.2
preview branch 3bc4042 1,188 1,304 1,019 863 44.5

Activity

  1. added
    needs-format
    on Nov 24, 2026
  2. github-actions commented on Nov 24, 2026

    @github-actions

    Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

    • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".

    Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

    Details: CONTRIBUTING.md

  3. changed the title [-]Inkling 2 on AMD: native Linux, RX 9060 XT (gfx1200), ROCm 10.1[/-] [+][Engine] Inkling 2 on AMD native Linux (gfx1200): prompts ~4x below an unmerged branch[/+] on Nov 24, 2026
  4. removed
    needs-format
    on Nov 24, 2026
  5. github-actions commented on Nov 24, 2026

    @github-actions

    Thanks, this follows the format now.

  6. okada-shogo commented on Nov 24, 2026

    @okada-shogo
    Contributor

    Thanks for the careful numbers. Short answers:

    1. No, ~250-290 tok/s is not what RDNA4 can do. On main, RDNA4's prompt expert products dequantize each expert to FP16 and call rocBLAS once per expert. ROCm 10.x looks much slower on that path: on our RX 9070 XT, one build of main read a 2,048-token prompt 4.6x slower on Windows (setup's ROCm 10.2) than on native Linux (ROCm 7.2.4).
    2. Yes. The work is now in separate open PRs ([Engine] AMD: --prompt-int8 runs prompts on the int8 matrix cores #292 int8 prompt tiles on RDNA3/RDNA4, [Engine] Inkling 2 on AMD under WSL2: simpler decode graph #293-[Engine] Inkling 2 on AMD: fuse the clip and KV-store kernels #295, [Engine] Inkling 2 on AMD: GPU doorbell for experts in RAM #306 and others).

    To try them together now, there is a new preview branch:
    https://github.com/okada-shogo/PolyStrata/tree/inkling2-amd-preview-2
    See PREVIEW-AMD.md for what is in it and how to build it.
    Build it as you built main, with -DCMAKE_HIP_ARCHITECTURES=gfx1200. It runs the prompt expert products on the int8 matrix cores by default, not through rocBLAS (STRATA_POLY_HIP_INT8=0 turns that off).
    If you use setup or a run config it wrote: setup adds --attn-requant q5_0 --loop-bf16 --tail-skip 4 whenever the card cannot hold every expert of the size, on any OS. Run setup with --inkling-small-card off or remove the three flags; --tail-skip skips experts and changes the output.

    What we measured on an RX 9070 XT (gfx1201, native Linux, ROCm 7.2.4, --threads 11 --vram-reserve-mib 700 --kv fp16, mean of 3 runs, the same flags for both). Your card has half the compute units, so expect lower numbers:

    Card Model Measure main preview-2
    RX 9070 XT 16 GB IQ4_NL prompt 2,048 (tok/s) 1,121.7 1,685.8
    RX 9070 XT 16 GB IQ4_NL decode after 302 (tok/s) 63.9 78.0
    RX 9070 XT 16 GB UD-Q2_K_XL prompt 2,048 (tok/s) 1,405.6 2,583.8
    RX 9070 XT 16 GB UD-Q2_K_XL decode after 302 (tok/s) 65.7 84.0

    We have not run gfx1200 or ROCm 10.1. Could you post your table again with a column for preview-2? If prompts are still far below the old preview's 1,188-1,304, a run with ROCm 7.2.x would tell us whether ROCm 10.1 is the cause.

    I'm still working on porting changes from the old AMD preview branch based on #200, but once the currently open PRs merge it should be a touch faster I think.

  7. okada-shogo commented on Nov 24, 2026

    @okada-shogo
    Contributor

    Correction on the ROCm part: ROCm 10 itself isn't slower (on our RX 9070 XT, main reads 2K prompts at 1,372 tok/s on 10.2 vs 1,286 on 7.2.4). The likely cause on your system is Arch's rocblas package (which CachyOS uses): it's built with -DBUILD_WITH_HIPBLASLT=OFF, and without hipBLASLt main's prompt path runs 57% slower (same on both ROCm versions). The preview's int8 path doesn't use rocBLAS for the expert products, so it should be much less affected. A ROCm 7.2.x run isn't needed.

  8. Tako88 commented on Nov 25, 2026

    @Tako88
    Author

    Built inkling2-amd-preview-2 (a15b75516) for gfx1200 as PREVIEW-AMD.md says, with no small-card flags. Here is the table you asked for.

    Setup. RX 9060 XT (gfx1200, 16 GB), native Linux (CachyOS, kernel 7.3.5-2), ROCm 10.1.0. Built with:

    cmake -S engine -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DSTRATA_ENABLE_HIP=ON \
      -DSTRATA_ENABLE_CUDA=OFF -DCMAKE_HIP_ARCHITECTURES=gfx1200 -DSTRATA_NATIVE_EXPERTS=ON
    

    Runs: --max-context 32768 --vram-reserve-mib 700 --kv q8_0 --threads 5, the same flags on every build, greedy, one engine per run, median of 3, the three runs within 0.5%. Prompts are 2,048 and 8,192 tokens of real text; decode is 128 tokens after a 1,200-token prompt.

    Prompt tok/s:

    Model Measure main 36e654b1 preview-2 HIP_INT8=0 BELL=0 old preview 3bc4042c
    UD-Q2_K_XL 2,048 287.4 781.8 363.7 782.0 1,202.6
    UD-Q2_K_XL 8,192 295.3 798.4 366.8 798.2 1,304.4
    UD-Q4_K_M 2,048 262.8 863.8 264.3 836.2 1,049.0
    UD-Q4_K_M 8,192 282.0 985.4 281.5 973.2 886.2

    Decode tok/s after 1,200:

    Model main preview-2 HIP_INT8=0 BELL=0 old preview
    UD-Q2_K_XL 40.08 50.54 51.00 50.53 55.83
    UD-Q4_K_M 40.73 45.97 46.19 42.05 44.96

    Experts in VRAM: UD-Q2_K_XL 3,072 of 3,072 (7.3 GiB) on every build. UD-Q4_K_M: preview-2 2,627 (11.8 GiB), main 2,372 (10.6 GiB) at 2,048 and 2,420 (10.8 GiB) at 8,192.

    The int8 path works on gfx1200, and it is most of the win: 782 against 364 on Q2 prompts (+115%), 864 against 264 on Q4 at 2,048 (+227%), 985 against 282 at 8,192 (+250%). The rest of the merged PRs add some on their own: with HIP_INT8=0, Q2 is 364 against main's 287 (+27%) and decode 51.0 against 40.1.

    BELL=0 leaves prompts as they are and costs Q4 decode: 45.97 with the bell, 42.05 without. Q2 decode is unchanged (50.54 against 50.53).

    Where it still falls short on this card. inkling2-amd-preview (3bc4042c) reads Q2 at 1,202.6 / 1,304.4 and Q4 at 1,049.0 / 886.2. So preview-2 wins Q4 at 8,192 (+11%) and decode at both sizes, and loses everywhere else: Q2 prompts 0.61x to 0.65x, Q4 at 2,048 0.82x, Q2 decode 0.90x.

    Q2 is the case I would like an answer on, because every expert is in VRAM on all three builds and no work goes to the CPU or through the stage buffer, so it can only be the kernels. One difference I noticed: the expert-MMQ gate takes an extra argument in the old branch,

    L.mmq = ... gu_fits && Mmq::fits((int) L.d_type, n_embd_, n_ff_exp_, ea);   // 3bc4042c
    L.mmq = ... gu_fits && Mmq::fits((int) L.d_type, n_embd_, n_ff_exp_);       // preview-2
    

    Is something in that selection picking a slower tile for Q2_K on gfx1200, and is the old branch's Q2 prompt path still coming into main, or is the int8 path meant to replace it and be faster?

    Row 3 of your table cannot run. --draft-model with the published drafter fails on main and on preview-2 alike:

    dspark-Inkling-2-Mini-Q8_0.gguf: not a DSpark drafter of this model (dflash.dspark.markov_rank)
    

    The two files HF lists, the repo-root dspark-Inkling-2-Mini-Q8_0.gguf and Mainline_Support/dspark-Inkling-2-Mini-Q8_0.gguf_file, are byte-identical (md5 f9f7cbbbf2e8613a471572a72bdd196a, 503,889,952 bytes), and neither carries dflash.dspark.markov_rank, which ds_open() in engine/src/poly/inkling2.cpp requires. Is there a newer drafter file somewhere, or does the reader need to accept this one?

    On the rocBLAS correction: you are right, and it is the likely cause here too. Arch's rocblas 10.1-2 has no hipBLASLt dependency (ldd librocblas.so.5.7 lists none), even though hipblaslt 10.1-1 is installed. That is why main reads 2,048-token Q2 prompts at 287 tok/s here rather than somewhere near your 1,372.

    I did not compare greedy ids against main on this branch, so I have nothing to say about the rounding yet.

  9. okada-shogo commented on Nov 25, 2026

    @okada-shogo
    Contributor

    Thanks for the careful table, this is really useful: same flags on every build, medians, and the HIP_INT8=0 / BELL=0 columns make it easy to read.

    Prompts. You're right that preview-2 leaves speed on the table: some of the old preview's AMD prompt work isn't in it yet. Your Q2 case, with every expert in VRAM, is a clean test of exactly those kernels. We're putting together another branch with them and will post it here with numbers, so you can rerun the same table.

    The drafter. It looks like the root dspark-Inkling-2-Mini-Q8_0.gguf on Hugging Face was replaced on 2026-11-23 with a file in a different (newer) format, which our reader doesn't take. We're still confirming the details. In the meantime, the older file still seems to be there as dspark-Inkling-2-Mini-Q8_0_Old.gguf, which should load. We'll follow up once we know more.

    rocBLAS: thanks for checking ldd. That matches what we saw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions