perf(qwen4): two exact decode lanes for Qwen3.8 Flash-Next (cached async PLE, pooled-key rowsel) - #2
Closed
davidtai wants to merge 1 commit into
Closed
Conversation
…ync PLE, pooled-key rowsel) Adds two decode lanes on top of the Flash-Next stack, both armed by default for a served Flash-Next pack with per-lane opt-out, an install verdict line, and a /health entry (aux_lane_defaults). - ple_cached_aux: a native CPU-stream provider stages the fixed 64 M4 n-gram rows and the auxiliary embedding plane is produced with mx.async_eval outside the compiled verifier. The stock owner-side row cache is preserved; at most two pending tickets; a failed submission marks the installation unhealthy. - qsa_pooled_rowsel: the twelve QSA indexers' pooled-key preparation binds the pool kernel metadata once per indexer at construction and shares one inv_freq object; the pooled block count derives from the write width. Measured at the 16,384-prompt / 1,024-output cell, three seeds, one build: both lanes on 81.75 tok/s decode vs 80.47 with both off (+1.59%), reasoning and text digests identical on every seed, prefill / peak / TTFT flat. ABBA retest of each lane alone: cached PLE +1.54% (separates from the 1.5% window noise), pooled rowsel +1.03% (inside noise). Data appendix and chart in docs/perf/pr391-aux-lanes.md. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C5oDbNTShwy1QS9dT8VDQD
Owner
Author
|
Superseded by youssofal#475 (same head, opened against upstream main). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two stacked decode lanes for Qwen3.8 Flash-Next
This pull request adds two decode lanes on top of the Qwen3.8 Flash-Next stack.
Both lanes keep the output identical to the stock path. Both change only the
decode timing. The server arms both by default for a served Flash-Next pack, the
same way it arms the retained stack, and every lane has an off switch.
Headline, at the canonical 16,384 / 1,024 cell, three seeds, cold prefill, one
build: both lanes on decode 81.747 tok/s against 80.468 tok/s with both off, a
+1.59% gain, byte-identical output (section 4.2). This same-build pair is the
number this pull request cites.
The two lanes on their own, from the ABBA retest (section 4.1):
ple_cached_aux): +1.54% decode over the bracketed control,and it separates cleanly from the window-to-window noise.
qsa_pooled_rowsel): +1.03% decode, positive andstable but inside the window-to-window noise band at this shape.
Both lanes are exact by construction. In the same-build pair and in the retest,
the reasoning digest and the text digest match control on every seed.
Terms:
1. Charts
The chart shows the six ABBA windows in run order (control, cached, pooled,
pooled, cached, control) with one line per seed. Each cached and pooled window
sits above both control windows at every seed. The complete data and the
did-not-work table are in
docs/perf/pr391-aux-lanes.md.2. What to merge
The server arms both lanes by default for a served Flash-Next pack. It stamps two
environment keys. Three controls turn a lane off:
0, for exampleMTPLX_FABLE_PLE_CACHED_AUX=0.MTPLX_FABLE_DISABLE=<lane>[,<lane>]orMTPLX_FABLE_DISABLE=all.--disable-optimization <lane>or--disable-optimization all.GET /healthreports the resolved state underaux_lane_defaults, and eachlane prints an install verdict. Class is
exactwhen the outputs are identical tothe stock path. Effect is measured at the 16,384 / 1,024 cell.
mx.async_evaloutside the compiled verifierMTPLX_FABLE_PLE_CACHED_AUXple_cached_aux=0mtplx/ple_cached_aux.py,mtplx/ple_cached_row_handoff.py,native_extensions/ple_cpu_rows/,mtplx/native/__init__.py;tests/test_pr391_ple_cached_aux_cpu.py,tests/test_pr391_ple_cached_row_handoff_cpu.py,tests/test_pr391_cached_sidecar_primitive_cpu.py,tests/test_pr391_cached_sidecar_producer_cpu.pyinv_freqobjectMTPLX_FABLE_QSA_POOLED_ROWSELqsa_pooled_rowsel=0mtplx/qsa_pooled_rowsel.py;tests/test_pr391_fixed_m4_pool_install_cpu.pyNotes on this table:
native_extensions/ple_cpu_rows.scripts/fable/setup_over100_venv.shbuilds it the same way it builds the QSAsparse-decode extension. When the extension is not built, the lane declines
with a printed reason and the server serves the stock path. Any other failure
fails the model load, so an armed-but-inert lane is unreachable.
layout, the per-indexer geometry, the RMS-norm epsilon, the RoPE scale, the
shared
inv_freqobject identity, and the rope and bank op-diet items, and itreports bank mode
rowselwith no weight copies. A contract failure fails themodel load.
the full-stack self-check, so the PR-391 battery counts do not move. They share
the retained stack's off switches only.
(
MTPLX_QWEN4_FIXED_VERIFY_ROWS): the pooled method derives the number of newpooled blocks from the write width, not from an assumed single block, so it
stays correct when a step writes 5 or 6 rows.
3. Benchmark method
Youssofal/Qwen3.8-Flash-Next-MTPLX-Optimized-Speed, revision29ba90f82124961d0d902a9ea9bbb1034972af2fxhigh4. Results
4.1 The 16,384 / 1,024 ABBA retest
Six guarded windows ran in the order control, cached, pooled, pooled, cached,
control (c1, a1, b1, b2, a2, c2). The bracketing controls cancel the linear drift
across the run.
The two control windows differ by about 1.52%, which is the load-bearing noise.
The cached lane clears it: every cached window beats every control window, per
seed and per window-mean. The pooled lane overlaps it: its slower window falls
below control's faster window. Prefill and peak memory are flat, and the output
is byte-identical to control on all three seeds for both arms.
4.2 Same-build served pair
Two guarded windows ran on one build of this worktree, on the canonical cell.
The
stack-bothwindow serves the defaults, so the server arms both lanes; thecontrolwindow serves the same build with both lanes off(
MTPLX_FABLE_PLE_CACHED_AUX=0,MTPLX_FABLE_QSA_POOLED_ROWSEL=0). The serverlog confirms engagement on the
stack-bothwindow:[fable] ple_cached_auxinstalls
variant=async_aux, and[fable] qsa_pooled_rowselinstalls 12 rowselbindings with one shared
inv_freqobject.The two lanes together add +1.279 decode tok/s, +1.59% over the same build
with both lanes off (per seed +2.12% / +1.25% / +1.39%). Prefill and peak memory
are flat, and TTFT is flat. The output is byte-identical: the reasoning digest
and the text digest match between the two arms on all three seeds. This
same-build pair is the number this pull request cites.
5. Original numbers at 17,408 tokens (history)
The two lanes come from an external optimization pass, first measured at a
different shape: 17,408 templated prompt tokens and 1,024 output tokens. Those
numbers are kept as history in
docs/perf/pr391-aux-lanes.md.6. Changes that did not work
Every row below is measured and rejected. The code of these rows is not in this
pull request.
7. How to run and how to disable
Build the venv and both native extensions:
Serve the pack. The server arms both lanes by default:
mtplx serve \ --model ~/.mtplx/models/Youssofal--Qwen3.8-Flash-Next-MTPLX-Optimized-Speed \ --model-id mtplx-flash-next-optimized-speedRead
GET /healthand check theaux_lane_defaultsblock. Confirm the[fable] ple_cached_auxand[fable] qsa_pooled_rowselverdicts name both lanes.Turn one lane off, or both:
8. File map
mtplx/ple_cached_aux.py,mtplx/ple_cached_row_handoff.py,mtplx/qsa_pooled_rowsel.py,mtplx/qwen4_aux_lanes.py,mtplx/native/__init__.py,mtplx/full_stack_env.py,mtplx/runtime.pynative_extensions/ple_cpu_rows/mtplx/server/openai.py,mtplx/server/__init__.py,mtplx/profiles.pytests/test_pr391_ple_cached_aux_cpu.py,tests/test_pr391_ple_cached_row_handoff_cpu.py,tests/test_pr391_cached_sidecar_primitive_cpu.py,tests/test_pr391_cached_sidecar_producer_cpu.py,tests/test_pr391_fixed_m4_pool_install_cpu.py,tests/test_qwen4_aux_lanes.pydocs/perf/pr391-aux-lanes.md,docs/perf/pr391-charts/pr391-aux-lanes-decode.svg🤖 Generated with Claude Code
https://claude.ai/code/session_01C5oDbNTShwy1QS9dT8VDQD