Skip to content

test: extend paged KV cache parity to llama3 - #169

Merged
inureyes merged 1 commit into
mainfrom
feat/121-multimodel-parity-scope
Jun 7, 2026
Merged

inureyes merged 1 commit into
mainfrom
feat/121-multimodel-parity-scope

Conversation

@inureyes

@inureyes inureyes commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

Final sub-step (c) of #121, completing its a/b/c decomposition (a: scheduler→pool wiring #167 → b: radix↔pool unification #168 → c: this). Closes #121.

Extends the real-model paged-KV parity coverage from qwen3 to both pool-backed families — qwen3 and llama3 (Fp16 dense-natural backend) — and reinforces the documented pool-backing scope.

Changes

tests/paged_scheduler_parity.rs — generalized to per-family helpers (assert_single_sequence_parity, assert_batched_decode_parity, parameterized load_or_skip). Runs single-sequence and batched (B=2) paged-vs-dense parity for qwen3 (qwen3-0.6b-4bit) and llama3 (llama-3.2-1b-4bit).

tests/paged_prefix_share_parity.rs — generalized to a per-family helper (assert_prefix_share_parity, parameterized load_or_skip + cache key). Runs the radix-store adopt/share-vs-cold DoD for qwen3 and llama3.

The shared deterministic prompt ids are < 128k, valid for both vocabularies; parity compares identical-input runs, so the (semantically arbitrary) tokens only need to match across backends.

Scope (documented, not changed here)

Pool-backing is gated to Fp16 dense-natural-backend sequences (qwen3/llama3) at CachePool::allocate_with_layout (cache.rs). Model-owned-state families (gemma3/llama4/qwen3.5) and quantized-KV (Int8/Turbo) paths keep the dense backend and are out of scope for pool parity — their decode path is unchanged by #121. Bringing those onto the pool is future work (overlaps #124). The gate comment already states this; both test module docs now reinforce it.

Validation (orchestrator-run, M1 Ultra, metal+accelerate, release)

All six cases pass with byte-identical greedy tokens (stronger than the RMS<5e-3 DoD):

  • paged_scheduler_parity (4): qwen3/llama3 × {single-sequence, batched B=2} — paged == dense.
  • paged_prefix_share_parity (2): qwen3/llama3 — adopted prefix-share == cold no-cache run.

Cold cargo clippy --tests and cargo fmt --check clean.

Generalize the scheduler and prefix-share real-model parity tests to cover both pool-backed families — qwen3 and llama3 (Fp16 dense-natural backend) — via shared per-family helpers, completing sub-step (c) of #121's a/b/c decomposition. The scheduler test runs single-sequence and batched (B=2) paged-vs-dense parity per family; the prefix-share DoD test runs the radix-store adopt/share-vs-cold parity per family. All six cases produce byte-identical greedy tokens.

Model-owned-state families (gemma3/llama4/qwen3.5) and quantized-KV (Int8/Turbo) paths keep the dense backend and are out of scope for pool parity; the pool-backing gate in cache.rs already documents this, and both test module docs now reinforce it.
@inureyes inureyes added the type:test Test related changes label Jun 7, 2026
@inureyes
inureyes merged commit b041f55 into main Jun 7, 2026
5 checks passed
@inureyes
inureyes deleted the feat/121-multimodel-parity-scope branch June 7, 2026 07:03
@inureyes inureyes added this to the 0.2 milestone Jun 21, 2026
@inureyes inureyes self-assigned this Aug 31, 2026
@inureyes inureyes added status:done Completed priority:high High priority labels Sep 6, 2026
be-free-snowboy pushed a commit to freestylejs/snowbrain-mlxcel that referenced this pull request Oct 27, 2026
…ablup#169)

Generalize the scheduler and prefix-share real-model parity tests to cover both pool-backed families — qwen3 and llama3 (Fp16 dense-natural backend) — via shared per-family helpers, completing sub-step (c) of lablup#121's a/b/c decomposition. The scheduler test runs single-sequence and batched (B=2) paged-vs-dense parity per family; the prefix-share DoD test runs the radix-store adopt/share-vs-cold parity per family. All six cases produce byte-identical greedy tokens.

Model-owned-state families (gemma3/llama4/qwen3.5) and quantized-KV (Int8/Turbo) paths keep the dense backend and are out of scope for pool parity; the pool-backing gate in cache.rs already documents this, and both test module docs now reinforce it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:high High priority status:done Completed type:test Test related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 4: Radix-trie and block-pool unification (scheduler wiring)

1 participant