[Feature]: DFlash2 speculative decoding for Inkling-2-Mini (like qwen3.8-dflash2)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- cpp
- Área
- ai, machine-learning, performance
Línea de trabajo
Start with flm-dev-kit/FLM_DLL/detail/inkling2_npu, the speculation hook in include/AutoModel/model_extension.h, and the closest template qwen3_8mtp_npu/speculate/dflash2_draft.hpp. Trace multi-token verification, target-layer hidden states, and checkpoint/restore behavior before modifying the NPU path. Done means Inkling-2-Mini can use the DFlash2 drafter, reject invalid speculative tokens correctly, and demonstrate the expected decode-throughput gain with the reported model settings.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Suggestion Description
Please add DFlash2 speculative decoding for inkling-2 (Inkling-2-Mini-NPU2), the way qwen3.8-dflash2 does it for Qwen3.8.
The drafter exists. incoai/Inkling-2-Mini-DFlash2 is Apache-2.0 and comes with an sglang reference (sglang_inkling_dflash2.py). From its config.json:
- 5 sliding-window layers, hidden size 2304, block size 8;
- a low-rank selector (rank 256, top-k 16);
target_layer_ids[5, 23, 41, 48], counted over the 48 logical layer visits (num_target_layers48).
What it gains on the iGPU. We ran it with llama.cpp on the Radeon 890M (Vulkan, --spec-type draft-dflash2):
- Setup: target Inkling-2-Mini with NVFP4 experts and Q8_0 elsewhere; drafter converted to Q8_0; draft length 2.
- Method: decode throughput on the same 24 chat prompts with and without the drafter, paired per prompt.
| machine | draft 2 | prose prompts only | draft 3 | draft 4 |
|---|---|---|---|---|
| Ryzen AI 9 HX PRO 375 | +13.7 % (p < 0.05) | +0.5 % | +11.1 % | +4.5 % (n.s.) |
| Ryzen AI 9 HX PRO 370 | +12.2 % (p < 0.05) | -1.7 % (n.s.) |
Why we'd like it on the NPU. Same requests on the HX PRO 375, FLM v1.0.14 against llama.cpp Vulkan without a drafter (document summaries at 1k to 32k context, 128 decoded tokens each):
| 1k | 2k | 4k | 8k | 16k | 32k | |
|---|---|---|---|---|---|---|
| FLM NPU prefill, tok/s | 387 | 552 | 564 | 642 | 644 | 606 |
| Vulkan prefill, tok/s | 157 | 166 | 162 | 156 | 140 | 118 |
| FLM NPU decode, tok/s | 12.4 | 12.5 | 12.2 | 11.7 | 10.9 | 9.7 |
| Vulkan decode, tok/s | 13.2 | 12.8 | 12.8 | 12.4 | 11.7 | 10.5 |
So the NPU prefills 2.5 to 5 times faster and decodes 6 to 8 % slower. With a drafter at the iGPU's gain, FLM would lead on both.
An honest caveat. On these long-document summaries the drafter helped less on Vulkan:
- decode 13.4 / 14.6 / 12.9 tok/s at 1k / 2k / 4k;
- 11.5 / 11.1 / 10.2 tok/s at 8k / 16k / 32k, below plain decode.
We think the cost there is the verify pass. On the 890M a 3-token verify takes about 135 ms against 78 ms for a 1-token decode, mostly because the MoE expert matmuls run once per token (2.9 times the expert time of one decode step). We don't know what a 3-token pass costs on the NPU. If it is close to one decode step, the NPU should gain at least as much as the iGPU.
What the engine would need, as far as we can tell from flm-dev-kit/FLM_DLL/detail/inkling2_npu and the speculation hook in include/AutoModel/model_extension.h:
- a verify pass over 1 + n tokens that returns logits for every position;
- the hidden states at the drafter's four target layers;
- rollback of rejected positions.
checkpoint()/restore()already exist, but we haven't checked whether they cover the cross-pass loop state.
qwen3_8mtp_npu/speculate/dflash2_draft.hpp looks like the closest template.
Related: #1110 (Inkling-2-Mini support). Happy to test a build on Strix Point under Linux and report numbers.
Operating System
Linux (Kali, kernel 7.2.15)
GPU
Ryzen AI 9 HX PRO 370 / HX PRO 375 (Strix Point: XDNA2 NPU, Radeon 890M)
ROCm Component
FastFlowLM
Assisted-by: Claude Code
- Lenguaje dominante
- C++
- Estrellas
- 2.1k
- Forks
- 184
- Merge medio
- 12 h 22 min
- PR fusionados (30 d)
- 239
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ROCm/FastFlowLM
-
Update Gemma tokenizer.json after Google's recent fixPosiblemente ocupada @four1er la tomó hace 6 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ROCm/FastFlowLM#1057 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ROCm/FastFlowLM#757 ·
Los mantenedores suelen responder en 1 día
-
No valid checkpoint to restore + Max length reached on multi-turn tool calls (Qwen3.6-MoE, NPU)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
ROCm/FastFlowLM#744 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Truncated tool call is emitted as a complete one (unterminated heredoc reaches the client)Posiblemente ocupada @Javinator9889 la tomó hace 72 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ROCm/FastFlowLM#741 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Download timeoutPosiblemente ocupada @stdevPavelmc la tomó hace 200 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
ROCm/FastFlowLM#520 · 7 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de ROCm/FastFlowLM
Issues similares
-
bug good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
difficulty:easy func:gui prio:normal type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NatronGitHub/Natron#2118 ·
Los mantenedores suelen responder en 1 día
-
bug difficulty:easy prio:low
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
NatronGitHub/openfx-io#523 ·
Los mantenedores suelen responder en 1 día
-
area:text difficulty:easy prio:low type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
NatronGitHub/openfx-arena#293 ·
Los mantenedores suelen responder en 1 día
-
Bug: Potential ?
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
MarlinFirmware/Marlin#28935 ·
Los mantenedores suelen responder en 1 día