mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #291] [CLOSED] PLE: the n-gram table in FP8 E4M3, as Qwen ships it (opt-in) #2557
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2557
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/291
Author: @sergqwer
Created: 9/30/2026
Status: ❌ Closed
Base:
main← Head:pr/ple-fp8📝 Commits (1)
2a76f67PLE: the n-gram table in FP8 E4M3, as Qwen ships it📊 Changes
9 files changed (+332 additions, -44 deletions)
View changed files
📝
CMakeLists.txt(+4 -0)📝
include/strata/artifact/gguf_reader.hpp(+6 -0)📝
include/strata/kernels/ngram.hpp(+10 -1)📝
include/strata/ngram/ple_reader.hpp(+7 -5)📝
src/kernels/ngram.cpp(+66 -20)➕
src/kernels/ple_fp8_parity.cpp(+84 -0)📝
src/ngram/ple_reader.cpp(+22 -15)📝
src/program/generate.cpp(+10 -3)➕
tools/ple_fp8_pack.py(+123 -0)📄 Description
Summary
The engine reads the 51.2e9-value n-gram table only as IQ4_NL (ISTA-DASLab's shard 2, 90 B a row). That table is
8.1% off the checkpoint's own values per row (correlation 0.996-0.997 on rows from all 128 shards, so it is the same
table in the same order). Qwen ships it in FP8 E4M3: 128 shards of [2500012, 160] plus one scale. NVIDIA's NVFP4
checkpoint keeps the same FP8 table.
tools/ple_fp8_pack.pycopies those FP8 bytes, unchanged, into a one-tensor GGUF:per_layer_token_embd.weight[160, 320001536] as I8, with
strata.ple.format = f8_e4m3andstrata.ple.scale. The output is 51.2 GB, streamedat flat memory.
PleTableopens either format; the row size (90 / 160 B) and the decode follow the file.PleReadertakes the rowsize at open, and its cache sizes itself by it.
general.architecture = strata-ple) is not added to the default dense-projection sources.Measured
Measured on current main (0.1.29,
d6708a4) with ISTA-DASLab's IQ2_XS, RTX 5090 32 GB, Ryzen 9 9950X3D, 128 GB DDR5, Windows 11. KL is first-token KL divergence (STRATA_DUMP_FIRST_LOGITS, #276); two runs of main itself differ by 0 on 5 of 6 short prompts and by 0.00013 on the sixth.First-token KL of the IQ4_NL table against the FP8 one: 0.0009 (1K), 0.0013 (2K), 0.0002 (4K), 0.022 (32K); mean 0.0061, top-1 4/4.
(400-token answers,
--vram-reserve-mib 1500). On an NVFP4 pack: 108-119 against 115-118.ple_fp8_parity: rows through Direct, Mmap andgather_batchmatch torch's decode of thecheckpoint bit for bit.
Switch
Opt-in:
--ple-gguf <the FP8 GGUF>. Nothing changes otherwise.🤖 Generated with Claude Code
https://claude.ai/code/session_01VZy1yKaDDiA8a7svdwaHio
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.