Skip to content

EXL3 Flash Next: KV pages from the core pool (4/8) - #1444

Open
BlivionIaG wants to merge 165 commits into
ashhart:mainfrom
BlivionIaG:pr/exl3-s4-kv-paging
Open

BlivionIaG wants to merge 165 commits into
ashhart:mainfrom
BlivionIaG:pr/exl3-s4-kv-paging

Conversation

@BlivionIaG

@BlivionIaG BlivionIaG commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Opt-in paged K/V for EXL3 Flash Next, including TP2 page-pool sizing and all-stream cache admission. Paging remains off by default; non-EXL3 TP2 paging remains refused.

Current-head device checks

Two RTX 5060 Ti 16 GiB GPUs, Linux, CUDA 13.4.92, Zig 0.17.0; turboderp/Qwen3.8-Flash-Next-exl3 revision 69e33439ae950f17bcbe95c98f117d80f759ab6d. Native binary SHA-256: 48e7a346d4b5243071d9e85a58cfda69b823495168f8d5eb0d1e5940e92b4c08.

  • Cache lifecycle, TP1 and TP2: pass. Six fresh servers per width: cache-off, unpaged cache and paged-all cache, each plain and drafted. Cold/warm/branch/rewind full token hashes matched; warm/branch/rewind cached-token counts matched for both lanes. Cold-lane cache hits can swap with concurrent request order. Context 8192, parallel 2, 4 GiB cache, 32 expert lines and 512 MiB expert reserve.
  • Paging unset against EXL3 Flash Next: deep prefill (3/8) #1443: 16/16 cells pass. TP1/TP2, code/chat, greedy/seeded and one/two streams; --alone --serial and full output hashes match. Two-stream output overlap was observed on the candidate. One repetition per cell, 64 output tokens.
  • Exact-head receipt.

Earlier evidence and limits

  • At d329cfdb98, paged/unpaged code and chat hashes matched in 16/16 TP1/TP2 greedy/seeded one/two-stream cells; two-stream paged output overlapped. Receipt.
  • The same earlier head passed 13 page-layout cases, 7 attention-lane cases and 36 page-edge resume cases; page-test activation was not logged. Scope. Its paged-all server-cache admission failed; the fix and new-head rerun are above.
  • Earlier-head paging performance was level within observed noise against unpaged; it was not repeated on this head. Main refuses this EXL3 checkpoint, so main is not a runnable performance baseline.
  • An earlier Linux full host suite passed golden checks but had one inherited digest_cache_test failure on tmpfs with unchanged ctime. The full suite and the earlier page-boundary and performance gates have not been repeated on this head. CI and current-main integration remain with the maintainer.
  • Earlier model-fidelity testing found 70/72 top-token matches against an independent reference. The two differences remain open; no tie waiver or perfect-equivalence claim.
  • ATC 0.9.6 returned an incomplete [Draft] EXL3 Flash Next on CUDA: TP=2, BF16 paging, cache reuse, graphs #1113 snapshot due to its pull-request limit. Known overlap and owner coordination are not a complete global clearance; maintainer is handling routine coordination.

No GPU kernel or checkpoint weights are added. The checkpoint is under the Qwen Community License 1.0.

@BlivionIaG
BlivionIaG force-pushed the pr/exl3-s4-kv-paging branch 3 times, most recently from be465ae to 3d5601c Compare October 27, 2026 10:51
@ashhart

ashhart commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Thanks for the careful paging work. As I said on #1113, a second BF16 paging system beside main's core KV pool won't
land. This PR adds its own pager and shared arena next to TF_FLASHNEXT_KV_PAGES:
exl3/kv/cuda_exl3_kvpage*.zig, exl3/offload/exl3_shared_kv.zig, cuda_exl3_shared_kv.zig and the six kvp_*
kernels. cuda_prompt.zig:177 also reads TF_FLASHNEXT_KVPAGE on every Flash Next engine.

The way in is to extend core/kv_pool.zig and the paging that cuda_kv_lanes.zig already does. A host-RAM tier for
that pool would be welcome as its own issue, since other families could use it too.

Two other points:

  • The PR has no measurements yet.
  • tools/exl3_serve_tp2.sh:12 turns paging on, so every later receipt depends on it. Please measure later slices
    without it too.

@BlivionIaG
BlivionIaG force-pushed the pr/exl3-s4-kv-paging branch 3 times, most recently from 48789c4 to cbc4a99 Compare October 27, 2026 17:11
@BlivionIaG BlivionIaG changed the title EXL3 Flash Next: BF16 KV paging (4/7) EXL3 Flash Next: KV pages from the core pool (4/7) Oct 27, 2026
@BlivionIaG
BlivionIaG force-pushed the pr/exl3-s4-kv-paging branch from cbc4a99 to dec5973 Compare October 27, 2026 17:56
@BlivionIaG
BlivionIaG force-pushed the pr/exl3-s4-kv-paging branch from dec5973 to fa88fd0 Compare October 27, 2026 20:27
@BlivionIaG BlivionIaG changed the title EXL3 Flash Next: KV pages from the core pool (4/7) EXL3 Flash Next: KV pages from the core pool (4/8) Oct 27, 2026
@BlivionIaG
BlivionIaG force-pushed the pr/exl3-s4-kv-paging branch from fa88fd0 to 7a0f3c6 Compare October 27, 2026 23:35
@ashhart ashhart mentioned this pull request Oct 27, 2026
6 of 18 tasks
@BlivionIaG
BlivionIaG force-pushed the pr/exl3-s4-kv-paging branch 13 times, most recently from 70b4527 to 4ea4504 Compare November 1, 2026 14:34
BlivionIaG and others added 28 commits November 20, 2026 07:49
--
2.54.0 (Apple Git-157)
--
2.43.0
--
2.54.0 (Apple Git-157)
--
2.43.0
# Conflicts:
#	zig/src/families/flashnext/cuda_prompt.zig
--
2.54.0 (Apple Git-157)
--
2.43.0
Preserve strict setting admission and inherited runtime fixes; retain original measurement identities.
--
2.54.0 (Apple Git-157)
--
2.43.0
Merge the repaired ashhart#1443 manifest and recompute the actual pins for the 6 intentional ashhart#1444 serving source changes; no source or approved-list change.
--
2.54.0 (Apple Git-157)
--
2.43.0
…xl3-fp64-paging-nov12

--
2.54.0 (Apple Git-157)
--
2.43.0
…xl3-fp64-paging-nov12

--
2.54.0 (Apple Git-157)
--
2.43.0
…xl3-fp64-paging-nov12

--
2.54.0 (Apple Git-157)
--
2.43.0
…aging-nov12

# Conflicts:
#	zig/tests/fixtures/gradient-serving.tsv
--
2.54.0 (Apple Git-157)
--
2.43.0
# Conflicts:
#	zig/tests/fixtures/gradient-serving.tsv
--
2.54.0 (Apple Git-157)
--
2.43.0
--
2.54.0 (Apple Git-157)
--
2.43.0
# Conflicts:
#	zig/tests/fixtures/gradient-serving.tsv
--
2.54.0 (Apple Git-157)
--
2.43.0
--
2.54.0 (Apple Git-157)
--
2.43.0
--
2.54.0 (Apple Git-157)
--
2.43.0
--
2.54.0 (Apple Git-157)
--
2.43.0
--
2.54.0 (Apple Git-157)
--
2.43.0
…aging-nov12

--
2.54.0 (Apple Git-157)
--
2.43.0
--
2.54.0 (Apple Git-157)
--
2.43.0
--
2.54.0 (Apple Git-157)
--
2.43.0
--
2.54.0 (Apple Git-157)
--
2.43.0
--
2.54.0 (Apple Git-157)
--
2.43.0
…aging-nov12

# Conflicts:
#	zig/tests/fixtures/gradient-serving.tsv
--
2.54.0 (Apple Git-157)
--
2.43.0
…aging-nov12

# Conflicts:
#	CHANGELOG.md
--
2.54.0 (Apple Git-157)
--
2.43.0
…aging-nov12

--
2.54.0 (Apple Git-157)
--
2.43.0
@ashhart
ashhart force-pushed the pr/exl3-s4-kv-paging branch from 12c9100 to f379513 Compare November 20, 2026 07:51
@AIFlowML

Copy link
Copy Markdown
Contributor

On f379513d, zig build test-kv-pool test-kv-safety-host test-flashnext-exl3-host -Dcpu=apple_m1 -j5 --summary all passed 278/278 on M5 Max with Zig 0.17.0. A trial merge into 9ba855b3 has four conflicts. After the initial scratch resolution, the EXL3 and pool checks passed, but adding test-environment-host exposed three failures. The merged rule table had duplicate TENSORFOLD_MEMORY_RESERVE_GIB and TF_FLASHNEXT_SHARD_HEAD entries. The older fixtures also disagreed with main about whitespace on the GiB value and zero for TF_FLASHNEXT_CHUNK_SOLO.

I kept main's single entries and aligned the legacy parser fixtures with current behavior, where finite reserve values are parsed and the EXL3 consumer applies its floor. With test-environment-host test-gradient-serving added, the resolved build succeeded, with 237 freshly run tests passing and the unchanged pool and pin results reused. This verifies a host merge resolution. The TP1/TP2 paging and lifecycle receipts remain the device evidence.

Igor Lessio - AIFLOW LABS

This branch has not been deployed

No deployments
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.

4 participants