[Issue]: HRX preview (v1.0.8, Linux): flm bench gemma4-it:e2b fails at 32k with 'ert state 8'; XRT completes, serve works

Aperta
#785 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
8/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp, docker, linux

Direzione di ricerca

The failing call is in the HRX runtime path at native_linux_kmq.cc:1140, which reports ert state 8 during hrx_stream_wait, and the failing command is flm bench at its 32k stage. Reproduce with the Docker command in the report and compare the bench path against flm serve, which handles the same prompt sizes. Done means the 32k bench stage completes on HRX with valid results, or the dispatch size or timeout cause is identified.

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

Descrizione

Summary

With the v1.0.8 HRX preview package on Linux, flm bench gemma4-it:e2b aborts in its first stage (32k context) on a Ryzen AI 7 PRO 350 (Krackan Point, XDNA2).
Every dispatch fails with amdxdna dispatch did not complete: ert state 8, and the run ends with hrx_buffer_allocate failed.
The same bench with the standard XRT package completes all 6 stages on the same machine, same container image, same weights.
HRX otherwise works here: flm validate passes and flm serve with the same model handles a 31,242-token prompt without errors.
So the failure looks specific to the flm bench path (or its 32k stage), not to HRX in general.

Environment

Laptop Lenovo ThinkPad T14s Gen 6 (21TBCTO1WW), BIOS R33ET31W (1.14)
CPU / iGPU AMD Ryzen AI 7 PRO 350, 8C/16T, Radeon 860M
RAM 30 GiB
NPU 1022:17f0 rev 0x20 (Strix/Krackan/Strix Halo NPU), aie2p, 8 columns
NPU firmware 1.1.2.64
Host OS / kernel Slackware 15.0 -current, Linux 7.2.10, in-tree amdxdna ("amdxdna version: 0.10" in flm validate)
Module params present aie2_max_col, force_cmdlist, force_iova, tdr_timeout_ms (values not readable as non-root)
Container Docker 29.3.0, ubuntu:26.04, --device /dev/accel/accel0 --ulimit memlock=-1 --ipc host
FLM v1.0.8; HRX: HRX_fastflowlm_1.0.8_linux.tar.gz (bare Ubuntu, no extra packages); XRT: fastflowlm_1.0.8_ubuntu26.04_amd64.deb (system libxrt2/libxrt-npu2 from the Ubuntu archive)
Model gemma4-it:e2b (Gemma4-E2B-IT-NPU2), pulled with v1.0.8

flm validate output (HRX package, container): kernel 7.2.10, NPU /dev/accel/accel0 with 8 columns, FW 1.1.2.64, amdxdna 0.10, memlock infinity, platform aie2p.

Reproduce

docker run --rm --device /dev/accel/accel0 --ulimit memlock=-1 --ipc host \
  -v <HRX_tree>:/opt/flm:ro -v <models>:/app/models:ro -v $PWD/out:/out -w /out \
  -e FLM_MODEL_PATH=/app/models -e FLM_DISABLE_UPDATE_CHECK=1 \
  ubuntu:26.04 /opt/flm/flm bench gemma4-it:e2b --pmode performance --bench-iterations 2

Result on HRX (invalid)

Reproduced twice with identical output. Log, with the repeated line collapsed:

[FLM]  Starting benchmark with 6 stages...
[FLM]  Starting benchmark for 32k and iteration 1...
[hrx][ERROR] run::wait hrx_stream_wait: .../amdxdna/native_linux_kmq.cc:1140: INTERNAL; amdxdna dispatch did not complete: ert state 8   (x515)
[FLM]  Creating checkpoint at context length 31017
[FLM]  	TTFT: 11.7753s, Prefill Speed: 2649.89 tokens/s, Decoding Speed: 253.331 tokens/s
[FLM]  Starting benchmark for 16k and iteration 1...
[hrx][ERROR] ... ert state 8
[FLM]  Failed to allocate hrx::ext::bo: hrx::ext::bo: hrx_buffer_allocate failed
Error: Failed to allocate hrx::ext::bo: hrx::ext::bo: hrx_buffer_allocate failed

The "TTFT 11.8 s / 2650 tok/s" line should not be trusted: the dispatches had failed, and the model output is <unusedNN> tokens.
The process exits after the 16k stage starts, so no result table is produced.

Valid results on the same machine

XRT, flm bench gemma4-it:e2b --pmode performance --bench-iterations 2 (completes)
Context TTFT (s) Prefill (tok/s) Decode (tok/s)
1k 1.623 ± 0.008 603.57 ± 3.01 23.54 ± 0.01
2k 2.494 ± 0.009 781.56 ± 2.86 22.59 ± 0.05
4k 4.542 ± 0.051 856.43 ± 9.58 21.14 ± 0.05
8k 9.136 ± 0.116 850.32 ± 10.72 18.70 ± 0.04
16k 20.697 ± 0.237 749.98 ± 8.56 15.02 ± 0.01
32k 41.140 ± 0.027 754.40 ± 0.37 10.79 ± 0.02
XRT vs HRX through flm serve gemma4-it:e2b --ctx-len 32768 --pmode performance (both complete, HRX has no dispatch errors)

One request per length, max_tokens=16, temperature=0, numbers from the response usage block:

Prompt tokens XRT TTFT (s) HRX TTFT (s) XRT prefill (tok/s) HRX prefill (tok/s) XRT decode (tok/s) HRX decode (tok/s)
3,487 3.79 3.96 920.8 880.4 21.8 22.1
10,648 14.38 15.60 740.5 682.7 17.4 16.7
21,736 35.13 34.61 618.7 628.0 13.1 13.1
31,242 63.29 58.48 493.6 534.2 10.8 10.8

gemma4-it:12b, flm serve --ctx-len 8192, 24-token prompt, 200 generated tokens, 3 runs each: decode XRT 6.12 / 6.04 / 5.87 tok/s, HRX 6.04 / 5.31 / 5.62 tok/s; TTFT XRT 1.69-1.86 s, HRX 1.85-2.18 s.

Single runs, so roughly ±5% noise. HRX is at parity with XRT in serve mode on this machine.

Questions

  1. Is flm bench on HRX known to fail at 32k? ert state 8 looks like a command timeout; could a single large dispatch in the bench path exceed the amdxdna TDR timeout, while serve chunks the prefill differently?
  2. Is there a recommended tdr_timeout_ms (or other amdxdna module parameter) for the HRX path?
  3. Is --prefill-chunk-len honoured by flm bench? I did not try changing it.

Happy to run more tests (other models, --prefill-chunk-len, smaller contexts) and attach full logs.

Lingua principale
C++
Stelle
2.1k
Fork
184
Merge medio
12h 22m
PR unite (30g)
239

Preparare l'ambiente

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 ROCm/FastFlowLM

Tutte le issue di ROCm/FastFlowLM

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.