Skip to content

xpu: share Qwen4 FP8 decode and preserve completion prefixes - #6426

Merged
ashhart merged 4 commits into
ashhart:mainfrom
supernovae:xpu/review-qwen4-lanes
Dec 5, 2026
Merged

ashhart merged 4 commits into
ashhart:mainfrom
supernovae:xpu/review-qwen4-lanes

Conversation

@supernovae

@supernovae supernovae commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Refs #6317. Schedules plain FP8 requests through the Flash Next shared decode lanes and preserves completion prefixes for cache reuse. Stacked on the experimental FP8 reader #6424. Incremental diff

On the submission source, the native XPU build and all seven Flash Next host tests passed. The served qualification used the official FP8 checkpoint at 4d35041fcd017a5608bd83bb65388757919d029c and the public concurrent client, three runs of 256 greedy output tokens per cell. At TP=2, one/four queued/four shared measured 68.1/66.6/154.8 tok/s. At TP=4 the corresponding values were 78.3/76.7/172.6. Four-stream throughput is aggregate. A single SSE request with four choices matched serial, and fresh and resumed outputs matched. Across six lengths through 65,152 prompt tokens all 270 warmed replies matched their solo hashes and the same rank-to-rank outputs. The official dynamic-FP8 comparison and retested four-choice, cancellation and prefix cases are posted. Full context, cold TTFT and shared-lane table

Issue #6317. Review parent #6424.

The per-request token hashes cover every repetition behind the six scheduler throughput cells and the fresh and resumed cache inputs. The receipt identifies the original benchmark source separately from the rebased chat-cache control.

Checks on this head

  • Head 509407483acdc4aebe8e8c4f5ba7153377e1e90a, tested runtime head fd8ad21e6cf4a9cd741a791563245ddac8ebf439, upstream merge base 5e7e5b2e2c384e709594c0e3d6549fe5428b1678. Public checks run python3 tools/pr_check.py --base origin/main --pr 6426. Lean recorded 88 findings on base and head, zero new. Zig format and diff whitespace checks passed.
  • Native build/test targets: zig build test-flashnext-xpu-host xpu-native. Counts and tested devices are above. The runtime revision passed changes, fast-gate, verify, fmt, pytest and zig. The refreshed head includes that receipt and the maintainer’s FP8 geometry tests. The native build passed all 63 steps and 11/11 focused tests. The serving runtime and kernel sources match the hardware-tested lane head. Upstream CI is running.
  • ATC reported incomplete coverage. A paginated scan covered 432 open PRs. A direct Git comparison for the capped PR (tp ranks: every byte after the key proof crosses the bootstrap, fate and plan links in sealed records #3101) found no overlapping Flash Next source or additional merge conflicts.

Receipt

Linux x86-64, Arc Pro B70 (BMG-G31), Zig 0.17.0, Intel ocloc and native Level Zero. Official FP8 target 4d35041fcd017a5608bd83bb65388757919d029c. Users supply the checkpoint. The upstream merge base cannot load it on XPU. The FP8 reader is the first runnable comparison point. Testing covered the listed Intel configurations. CUDA, HIP and Metal use separate backends and were outside the hardware qualification.
Existing --parallel controls admission. Serial and shared hashes, throughput and cold TTFT are linked above. No new checkpoint, kernel or precision mode.

Checklist

  • Head, incremental diff, prerequisites and exactness evidence identified.
  • Formatting, diff whitespace, public commit identity and new lean findings checked.
  • Tested arithmetic, target hardware and model revision identified.

@supernovae

Copy link
Copy Markdown
Contributor Author

I reran the live HTTP checks on the published shared-lane changes with the official FP8 checkpoint and four simultaneous choices. On both TP=2 and TP=4, all four streamed choices matched their serial controls. The common interval with all four choices generating was 1.492 s on TP=2 and 1.324 s on TP=4. The separate concurrent runs returned 8 comparisons equal and 0 unequal or failed on each configuration. A resumed conversation reused its cached prefix and returned the expected continuation on both. Closing a client socket mid-generation and retrying also passed on both.

@ashhart

ashhart commented Dec 5, 2026

Copy link
Copy Markdown
Owner

Thanks @supernovae. First review of this head (fd8ad21, on top of #6424): small and clean. It touches only xpu_flashnext.zig, xpu_lane.zig and the CHANGELOG, and shared decode reuses the lanes machinery's tested plain_share path.

One ask: the commit message says "The B70 cache receipt checks cold versus reused token hashes", but docs/receipts/qwen4-b70-fp8/ holds only the teacher-forced parity files. Please add the cold-versus-reused token-hash check as a receipt file there (or tell us where it lives), together with the shared-versus-queued token hashes behind the 68.1/66.6/154.8 tok/s cells. We have no B70s, so those hashes are the exactness evidence for this PR.

  • Synthena

@supernovae

Copy link
Copy Markdown
Contributor Author

Added the requested hashes in d0734b6e9. The receipt includes both hashes for every queued/shared reply behind the published throughput cells. All 15 replies per rank matched, including all three repetitions on TP2 at 68.1 solo, 66.6 queued and 154.8 shared tok/s. The same comparison covers TP4 at 78.3 solo, 76.7 queued and 172.6 shared tok/s.

For the 2,571-token completion, the cold call reported zero cached tokens, each warm call reused 2,570, and all seven output hashes matched on each rank count. The separate 2,603-token chat fixture also retained its hash after the rebase. The file separates the original throughput benchmark revision from the rebased chat-cache run. Per-request evidence on the PR branch

@ashhart

ashhart commented Dec 5, 2026 •

Copy link
Copy Markdown
Owner

READY to land on this head. Re-check of this head: since the reviewed runtime it adds the receipt's token-hash file and merges main and its parent #6424, every conflict resolved to the reviewed side; in the hash file every queued and shared reply in it matches its solo reply (TP2 and TP4, widths 1 and 4, three repetitions, every lane), with cache reuse rows equal across TP counts. XPU-only; we have no XPU hardware. Stacked on #6424: lands after it.

  • Synthena

@supernovae

supernovae commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor Author

The prerequisite #6424 landed at c47006e60. I prepared a clean integration of the reviewed head with main for landing. The served XPU, native adapter and kernel files match reviewed head 509407483acd byte-for-byte. The merge retains the intervening server changes and both changelog entries from main 0b9102458dcd. Native build and focused host tests: 63/63 steps succeeded; 11/11 tests passed. The TFQ stack uses this same integration as its incremental comparison.

Rebased head

I verified the latest integration with the rebased head 12b4d03f9fda. The integrated adapter keeps shared sequences and retained completion prefixes enabled for both FP8 and the experimental TFQ format. The native adapter and XPU kernels are byte-identical to the previous tested integration. The native build, limits audit and focused host tests reported 100/100 steps succeeded; 42/42 tests passed.

@ashhart
ashhart force-pushed the xpu/review-qwen4-lanes branch from 5094074 to 12b4d03 Compare December 5, 2026 10:24
@ashhart

ashhart commented Dec 5, 2026

Copy link
Copy Markdown
Owner

READY to land on this head. Our rebase onto 0b91024 keeps only the PR's own three commits (earlier copies already on main dropped); code as on the READY head 5094074.

  • Synthena

supernovae and others added 4 commits December 5, 2026 11:26
Reuse existing Flash Next shared forwards, prompt snapshots and lane scheduling. Refs ashhart#6317.
Use the shared prompt-cache tail policy for plain FP8 streams. The B70 cache receipt checks cold versus reused token hashes. Refs ashhart#6317.
@ashhart
ashhart force-pushed the xpu/review-qwen4-lanes branch from 12b4d03 to ae13571 Compare December 5, 2026 11:26
@ashhart
ashhart merged commit e342dc8 into ashhart:main Dec 5, 2026
8 of 12 checks passed
@ashhart

ashhart commented Dec 5, 2026

Copy link
Copy Markdown
Owner

Thank you @supernovae. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

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.

2 participants