[PR #5095] [Other] nvfp4_verify_gguf: check every PLE table type the engine reads #5306

Open
opened 2026-11-07 16:34:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/5095
Author: @Tsury
Created: 11/3/2026
Status: 🔄 Open

Base: main ← Head: fix-nvfp4-verify-ple-formats


📝 Commits (1)

  • bfe8362 nvfp4_verify_gguf: check every PLE table type the engine reads

📊 Changes

2 files changed (+106 additions, -7 deletions)

View changed files

📝 tools/nvfp4_verify_gguf.py (+25 -7)
➕ tools/test_nvfp4_verify_gguf_ple.py (+81 -0)

📄 Description

Problem and result

On v0.2.10 (ffa80d73), tools/nvfp4_verify_gguf.py --ple-gguf ple-fp8.gguf reports a problem for every FP8 PLE table:

PLE table:
  PLE file: ple-fp8.gguf I8, 320001536 rows x 160
  PLE: the engine reads IQ4_NL only
RESULT: 1 problems

The rule is stale. src/kernels/ngram.cpp's format table also reads Q4_0, Q5_0, Q5_1, Q8_0, BF16 and the FP8 table that tools/ple_fp8_pack.py writes (I8 with strata.ple.format = f8_e4m3). The NVFP4 packs ship that FP8 table.

After this change, check_ple decodes each of those table types. The FP8 table is decoded with its strata.ple.scale and gives cosine 1.0 against the checkpoint. A different table is still refused. An I8 table with another strata.ple.format (NVFP4 x16) is refused with a message that names the format, as before.

Validation

On ffa80d73 + this change, Linux, Python 3.14, gguf-py from the llama.cpp commit setup pins:

  • Passed: python -m unittest tools.test_nvfp4_verify_gguf_ple (new, 3 tests: an FP8 table and a Q8_0 table pass, a different table is refused). Without the change the two pass cases fail with the message above.
  • Passed: the metadata read on a real 51.2 GB ple-fp8.gguf (d0xin Swift-1.5 NVFP4-FP8PLE) gives f8_e4m3 and scale 0.00019931793. Its rows matched the checkpoint's FP8 shards byte for byte in a separate check.
  • Not run: the full verifier against that checkpoint, because the raw checkpoint was removed after conversion. No engine or setup code changes.

🤖 Generated with Claude Code


🔄 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/5095 **Author:** [@Tsury](https://github.com/Tsury) **Created:** 11/3/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-nvfp4-verify-ple-formats` --- ### 📝 Commits (1) - [`bfe8362`](https://github.com/Niko1221/Strata/commit/bfe836244d2bff2acf7827a1c68d0021f7f0e036) nvfp4_verify_gguf: check every PLE table type the engine reads ### 📊 Changes **2 files changed** (+106 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `tools/nvfp4_verify_gguf.py` (+25 -7) ➕ `tools/test_nvfp4_verify_gguf_ple.py` (+81 -0) </details> ### 📄 Description ## Problem and result On v0.2.10 (ffa80d73), `tools/nvfp4_verify_gguf.py --ple-gguf ple-fp8.gguf` reports a problem for every FP8 PLE table: ``` PLE table: PLE file: ple-fp8.gguf I8, 320001536 rows x 160 PLE: the engine reads IQ4_NL only RESULT: 1 problems ``` The rule is stale. `src/kernels/ngram.cpp`'s format table also reads Q4_0, Q5_0, Q5_1, Q8_0, BF16 and the FP8 table that `tools/ple_fp8_pack.py` writes (I8 with `strata.ple.format = f8_e4m3`). The NVFP4 packs ship that FP8 table. After this change, `check_ple` decodes each of those table types. The FP8 table is decoded with its `strata.ple.scale` and gives cosine 1.0 against the checkpoint. A different table is still refused. An I8 table with another `strata.ple.format` (NVFP4 x16) is refused with a message that names the format, as before. ## Validation On ffa80d73 + this change, Linux, Python 3.14, gguf-py from the llama.cpp commit setup pins: - **Passed:** `python -m unittest tools.test_nvfp4_verify_gguf_ple` (new, 3 tests: an FP8 table and a Q8_0 table pass, a different table is refused). Without the change the two pass cases fail with the message above. - **Passed:** the metadata read on a real 51.2 GB `ple-fp8.gguf` (d0xin Swift-1.5 NVFP4-FP8PLE) gives `f8_e4m3` and scale 0.00019931793. Its rows matched the checkpoint's FP8 shards byte for byte in a separate check. - **Not run:** the full verifier against that checkpoint, because the raw checkpoint was removed after conversion. No engine or setup code changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5306
No description provided.