perf: Batched DFlash2 drafting for concurrent Raon-1 mini requests
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
- rust
Línea de trabajo
Read the batched Qwen 3.5 path in src/server/batch/dflash_target.rs, the Raon speculative forward in src/models/raon1_mini_speculative.rs, and the sampling checks in src/server/batch/speculative_burst.rs. First establish whether batched verify can meet the 2-row width-3 cost gate while staying bit-identical to single-row decode; also investigate per-row token history in src/lib/mlxcel-core/src/speculative/mtp/target.rs. Done means both preconditions hold, exactness and sampling tests pass, and either benchmarks show the required throughput win or a benchmark document records the result.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem / Background
Concurrent Raon-1 mini requests decode classically: the DFlash2 burst is B = 1 only, so with a drafter loaded two or more queued requests never share a speculative window. #3458 item 3 asked for batched DFlash2 and PR #3461 dropped it on measurement (docs/benchmark_results/raon-perf-m3ultra-2026-11-26.md, section 7, M3 Ultra):
| Rows | Batched decode step (ms) | Exact verify, width 3 (ms) | Width 5 (ms) |
|---|---|---|---|
| 1 | 21.8 | 35.7 | 46.7 |
| 2 | 23.7 | 50.7 | 72.4 |
| 4 | 28.2 | 79.7 | over the 16-row limit |
A batched decode step costs 9% more for two rows than one; an exact verify block costs 42 to 59% more. The ceiling on batched drafting (rows * tokens emitted per verify / verify time, solo acceptance, draft cost free) is 13 to 22% below classic batched decode at four rows (110 to 123 against 141 tok/s) and 3 to 15% above it at two rows and width 3, a margin the draft cost (about 2 ms per row per round) and the uniform accept of the batched round loop consume. This issue records the two preconditions under which the work is worth doing, and is closed either by a measured win or by a recorded measurement.
Current Behavior
impl DFlashTargetModel for crate::models::Raon1MiniModelinsrc/server/batch/dflash_target.rs:444returnsfalsefromsupports_batched(), so the scheduler collects no window and a window that reaches the batched gate declines to classic decode.Raon1MiniModel::forward_speculative(src/models/raon1_mini_speculative.rs:146) asserts B = 1 (:160). In a verify block (2 torow_invariant::MAX_ROWS= 16 rows) every row is formed alone so it equals its decode step bit for bit: RDA projections throughrow_invariantproducts with the conv and delta-rule recurrence stepped per position (RaonDeltaAttention::forward_recording), MLA as one decode-shaped attention per position (:189), mHC, router and SiTU MLPs throughrow_invariantproducts (row_scope,:81). OffMLXCEL_RAON_ROW_INVARIANT, each dense weight is read once per row, which is why verify cost grows almost linearly with rows.sampling_config_eq(src/server/batch/speculative_burst.rs:3127) requires!needs_token_history()on both configs because the batched path samples each row's first bonus with an empty history (prefill_and_seed_batched,run_dflash_batched_on_targetatdflash_target.rs:980). Since #3459 the server applies the checkpoint'spresence_penalty1.5 by default (src/server/startup.rs:2185), which makesSamplingConfig::needs_token_history()(src/lib/mlxcel-core/src/generate.rs:1765) true, so default-setting Raon requests would never join a batched window even ifsupports_batched()weretrue.
Preconditions to revisit
- A cheaper exact multi-row verify. A verify block of B rows whose cost grows like a batched decode step, not like B separate steps, while each row stays bit-identical to its decode step. Candidates: the row-invariant matvec kernel (
src/lib/mlxcelverse/kernels/row_invariant_matvec.cpp) made fast enough to be the default for RDA, mHC and the SiTU MLPs, or a batched RDA and MLA verify that matches the per-position decode form. Gate: a probe (as in section 7) shows a 2-row width-3 verify at or under 1.2x the 1-row verify. - Per-row token history in batched windows. Thread each row's token history through the batched round loop (
MtpTarget::prefill_and_seed_batched,src/lib/mlxcel-core/src/speculative/mtp/target.rs:501, and the batched DFlash runner) so penalty-bearing rows sample like their B = 1 burst, then drop the two!needs_token_history()clauses fromsampling_config_eq. This is shared with the Qwen 3.5 batched path and must keep its existing tests green.
Do not flip supports_batched() for Raon until both hold. Precondition 2 is independently useful and may land alone.
Scope
In scope: the two preconditions, a B > 1 Raon verify forward and rollback, the drafter side, supports_batched() -> true, the measurement.
Out of scope: the B = 1 burst, the DFlash2 default width (3, raon_dflash2::DEFAULT_VERIFY_WIDTH), prefill batching for drafting (rows stay prefilled alone for exactness).
Implementation Notes
- Reuse: the Qwen 3.5 batched burst (
supports_batched() == truepath indflash_target.rs) for windowing, per-row rollback and accept;compare_block_against_chain/mtp_exactness_gatefor the exactness probe at B > 1. - Constraints: greedy drafted text must equal plain decode for every row; a row whose exactness probe fails declines to classic decode, never to a non-exact verify.
- Edge cases: rows of unequal prompt length (current window collection requires equal lengths), rows at different reasoning efforts (alpha is per cache; a window must not mix alphas unless steering is per row), a row finishing mid-window.
Acceptance Criteria
- Either: at 2 and 4 concurrent requests (
mlxcel-server --parallel 4 --model-draft models/raon-1-mini-dflash2, 128 tokens each, the section 7 client) aggregate tok/s beats classic batched decode of the same binary on the short prose, code and long prompts, with the server's defaultpresence_penaltyof 1.5 in force; or a benchmark doc underdocs/benchmark_results/records the measurement that justifies closing this issue. - Greedy text of every row in a batched burst equals plain decode of that prompt (server check over the three prompts at 2 and 4 rows).
- Test: with precondition 2, a batched window of two rows carrying
presence_penalty = 1.5produces the same tokens as two B = 1 bursts (fails today becausesampling_config_eqrefuses the window). - Test: the Raon B > 1 verify forward equals stacked B = 1 decode steps bit for bit on the tiny steered model (
raon1_mini::steering_tests::steered_model). - Integrated: the scheduler routes concurrent Raon requests with a DFlash2 drafter through the batched burst by default, not behind a test-only path.
Verification
make test-fast FILTER=speculative_burst
make test-fast FILTER=raon1_mini
make test-fast FILTER=dflash_target
make verify-fmt verify-clippy
Benchmark on Apple Silicon under the host GPU lock, arms interleaved, with uptime per table as in the section 7 run. Pass: batched drafting above classic batched decode at both 2 and 4 rows, text equal.
- Lenguaje dominante
- Rust
- Estrellas
- 505
- Forks
- 81
- Merge medio
- 14 h 2 min
- PR fusionados (30 d)
- 448
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una 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 lablup/mlxcel
-
area:core priority:high status:ready type:security
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
priority:medium status:ready type:security
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
area:models modeltype:text priority:medium status:in-progress type:bug
Dificultad 4/5 3-5 días Aptitud para principiantes 57/100
Los mantenedores suelen responder en 1 día
-
area:models priority:low status:ready type:test
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
area:models modeltype:omni priority:medium status:ready type:bug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
Todos los issues de lablup/mlxcel
Issues similares
-
area:ui effort:medium enhancement P7 source:agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
marketing
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Read a requested CodeRabbit PR review's findings with `coderabbit pullrequest --show-threads`Abiertodocumentation priority: low tech-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
nledford/Ladderback#1823 ·
Los mantenedores suelen responder en 1 día
-
psmux-resurrect: restoring a session with a numeric name puts its windows into the wrong session (`new-window -t 4` is read as window 4)Posiblemente ocupada @ealwanlee la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
psmux/psmux-plugins#47 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 87/100
Los mantenedores suelen responder en 1 día