[PR #865] [CLOSED] ngram: add opt-in Q8_0 PLE table support #2882

Closed
opened 2026-11-04 02:03:50 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/865
Author: @CC-David-CC
Created: 10/5/2026
Status: ❌ Closed

Base: main ← Head: feat/q8-ple-reader


📝 Commits (2)

  • 18d3da4 ngram: add opt-in Q8 PLE rows through the existing mapped reader
  • be379fc docs: record standalone Q8 PLE validation and native token parity

📊 Changes

7 files changed (+524 additions, -21 deletions)

View changed files

📝 CMakeLists.txt (+4 -0)
➕ bench/results/q8-ple-reader-token-ids.json (+1 -0)
➕ bench/results/q8-ple-reader-validation.json (+220 -0)
➕ docs/Q8_PLE.md (+99 -0)
📝 include/strata/kernels/ngram.hpp (+3 -2)
📝 src/kernels/ngram.cpp (+51 -19)
➕ src/kernels/ple_q8_parity.cpp (+146 -0)

📄 Description

The PLE reader currently rejects Q8_0 tables even when the model's expert weights are supported. Add 170-byte Q8_0 rows through the existing scalar dequantizer and mapped reader.

This is the independent Q8 follow-up discussed in #689. It starts from upstream 6f32ec0 and does not include or depend on the rotation patch in #864.

  • Off by default: requires exactly STRATA_EXPERIMENTAL_Q8_PLE=1.
  • Supports --ple-io mmap and --ple-io ram; direct Q8 PLE I/O is explicitly rejected.
  • Checks shape/size arithmetic and file bounds; clears state on close/reopen. Preserves existing prefetch behavior and other PLE formats.
  • No serving, scheduling, expert-placement, installer preset or README changes.

Validation

Fresh standalone build at 18d3da487f82c8e7b5d8e91f6fdd8c75972182f1, RTX PRO 6000 Blackwell 96GB / Ryzen 7950X / GCC 13.3 / CUDA 13.2:

  • Both CTest checks passed, covering flag values, signed/scaled rows, mmap/RAM, malformed files and lifecycle.
  • Real Q8 PLE: 1,059 probes plus batch/issue-collect checks bit-identical to ggml.
  • Fresh native run: 1,024 generated token IDs match the retained rotation-off baseline, after the same 1,024-token input. Zero offered drafts and prompt reuse, FP16 KV.

The model uses Q8 experts/PLE, compatibility BF16 small projections and a Q5_K head. The EOS sentinel forces the count. This is a correctness check, not a quality or speedup claim. Q8 PLE row data alone is about 50.66 GiB; the full-model configuration requires substantial memory. AMD and Windows GPU execution remain untested.

Enablement and tests | Fresh receipt | Raw IDs

The guide also links the older combined branch's token-identical 1K/16K/32K rotation comparisons, clearly separated from this standalone validation.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/865 **Author:** [@CC-David-CC](https://github.com/CC-David-CC) **Created:** 10/5/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/q8-ple-reader` --- ### 📝 Commits (2) - [`18d3da4`](https://github.com/Niko1221/Strata/commit/18d3da487f82c8e7b5d8e91f6fdd8c75972182f1) ngram: add opt-in Q8 PLE rows through the existing mapped reader - [`be379fc`](https://github.com/Niko1221/Strata/commit/be379fc72b4a679a901bb7c66fcdd8e218ea0e45) docs: record standalone Q8 PLE validation and native token parity ### 📊 Changes **7 files changed** (+524 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+4 -0) ➕ `bench/results/q8-ple-reader-token-ids.json` (+1 -0) ➕ `bench/results/q8-ple-reader-validation.json` (+220 -0) ➕ `docs/Q8_PLE.md` (+99 -0) 📝 `include/strata/kernels/ngram.hpp` (+3 -2) 📝 `src/kernels/ngram.cpp` (+51 -19) ➕ `src/kernels/ple_q8_parity.cpp` (+146 -0) </details> ### 📄 Description The PLE reader currently rejects Q8_0 tables even when the model's expert weights are supported. Add 170-byte Q8_0 rows through the existing scalar dequantizer and mapped reader. This is the independent Q8 follow-up discussed in #689. It starts from upstream `6f32ec0` and does not include or depend on the rotation patch in #864. - **Off by default:** requires exactly `STRATA_EXPERIMENTAL_Q8_PLE=1`. - Supports `--ple-io mmap` and `--ple-io ram`; direct Q8 PLE I/O is explicitly rejected. - Checks shape/size arithmetic and file bounds; clears state on close/reopen. Preserves existing prefetch behavior and other PLE formats. - No serving, scheduling, expert-placement, installer preset or README changes. ### Validation Fresh standalone build at `18d3da487f82c8e7b5d8e91f6fdd8c75972182f1`, RTX PRO 6000 Blackwell 96GB / Ryzen 7950X / GCC 13.3 / CUDA 13.2: - Both CTest checks passed, covering flag values, signed/scaled rows, mmap/RAM, malformed files and lifecycle. - Real Q8 PLE: 1,059 probes plus batch/issue-collect checks bit-identical to ggml. - Fresh native run: **1,024 generated token IDs match the retained rotation-off baseline**, after the same 1,024-token input. Zero offered drafts and prompt reuse, FP16 KV. The model uses Q8 experts/PLE, compatibility BF16 small projections and a Q5_K head. The EOS sentinel forces the count. This is a correctness check, not a quality or speedup claim. Q8 PLE row data alone is about 50.66 GiB; the full-model configuration requires substantial memory. AMD and Windows GPU execution remain untested. [Enablement and tests](https://github.com/CC-David-CC/Strata-a5500/blob/feat/q8-ple-reader/docs/Q8_PLE.md) | [Fresh receipt](https://github.com/CC-David-CC/Strata-a5500/blob/feat/q8-ple-reader/bench/results/q8-ple-reader-validation.json) | [Raw IDs](https://github.com/CC-David-CC/Strata-a5500/blob/feat/q8-ple-reader/bench/results/q8-ple-reader-token-ids.json) The guide also links the older combined branch's token-identical 1K/16K/32K rotation comparisons, clearly separated from this standalone validation. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:03:50 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2882
No description provided.