Skip to content

Qwen3.8-27B on M5: the lane loop for one stream by default, and measured shared row prices (#1621) - #1726

Merged
ashhart merged 13 commits into
mainfrom
q27-m5-lane-loop
Oct 31, 2026
Merged

ashhart merged 13 commits into
mainfrom
q27-m5-lane-loop

Conversation

@ashhart

@ashhart ashhart commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Part of #1621. On M5 Macs one Qwen3.8-27B stream is served through the 16-row lane loop by default (TF_QWEN27_LANES=0 keeps the serial loop), and lane rounds shared by several streams price and fill their rows from measured costs instead of extrapolating from the lone window. Replies are token-identical: 1,644 replies and controls equal to serial, solo and "draft": false.

Against main, alternating base/new/new/base, Qwen3.8-27B MLX 4-bit with DFlash2:

  • M5 Ultra: one stream +2.6% code, +4.6% chat; four greedy code streams +18.6%; all 20 cells no slower.
  • M3 Ultra: 1/2/4/8/16 streams +1.9/+1.0/+0.4/+1.9/+3.5%; without a drafter 1/4/16 streams +1.3/+1.3/+2.2%, prefill within 0.6%.

Wider 32- and 64-row lone windows stay opt-in (TF_QWEN27_WINDOW, TF_QWEN27_COPIES).

Admit 16, 32 and 64 rows on either Metal projection path, with costs measured through the active width and context copies beside the drafter tree. Wide tensor-unit requests use the priced lane loop. Add host policy and backend-fact checks and a complete 1-64-row timing sweep (#1621).
Keep the existing 16-row serial default. Explicit 32/64-row windows select lanes and enable context copies by default, with the existing opt-out. Pin the default choice in the host tests; the measured ordinary greedy cells favor the legacy loop (#1621).
A lone lane request explores up to 15/31/63 nodes from the same masked block and considers all sixteen retained candidate siblings. Choose the parent-closed prefix by expected accepted tokens per measured window cost. Keep shared grants, zero-grant pauses and the legacy serial loop bounded as before; the target verifier and keyed samples remain authoritative (#1621).
Retain the original lone price prefix. Price wider unfused row shapes without allocating another stream or changing served arithmetic. Restore the borrowed backend fields in place. Keep earlier-chip and one-slot timing unchanged. Refs #1621.
Use the existing shared reservation policy on tensor units. Count the proposed and granted nodes through actual native facts and the production lane engine, and preserve its plain target tokens. Keep lone drafting and sampling unchanged. Refs #1621.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant