[PR #64] [MERGED] parity tool: a new-kernel mismatch must fail the run; dispatch comment fallback was stale #2438

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/64
Author: @pipeob0
Created: 9/28/2026
Status: ✅ Merged
Merged: 9/28/2026
Merged by: @Niko1221

Base: main ← Head: gh/avx2-followups


📝 Commits (1)

  • a3545f5 parity tool: count a new-kernel mismatch as a failure, not just print it

📊 Changes

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

View changed files

📝 src/kernels/cpu/native_expert.cpp (+3 -2)
📝 src/kernels/native_expert_parity.cpp (+16 -5)

📄 Description

The two follow-ups you listed in your #43 merge note. Both are yours to shape; nothing here changes a kernel.

1. The comment above the gate/up dispatch described a fallback that no longer exists. It said STRATA_NO_IQ512 / STRATA_NO_IQ256 fall back to ggml-cpu's single-token vec_dot. Since #43, STRATA_NO_IQ512 drops an AVX-512 CPU to the AVX-2 kernel, STRATA_NO_IQ256 drops the AVX-2 kernel, and ggml's vec_dot is reached only with both set (and on a CPU without AVX-512, STRATA_NO_IQ512 changes nothing at all). Comment-only commit.

2. The parity tool printed the new kernels' distance from ggml's vec_dot without affecting the exit code. A kernel that silently diverged still reported 0 failures, which is the one property of that tool people rely on. Both comparisons (the gate/up rows in check, and the IQ4_NL down) are now gated at 1e-5 and increment failures. Measured headroom: gate/up rows 3.1-3.4e-08, IQ4_NL down ~1e-7, so the gate sits ~100x above the observed spread.

Verified on this box (IQ2_XS, IQ2_XXS, IQ3_S, IQ4_NL layers):

  • threshold 1e-5 → native_expert_parity: 0 failures (unchanged, as it should be);
  • threshold temporarily dropped to 1e-9, i.e. below the observed spread, to prove the gate is live:
iq2_xs  avx2 gate rows MISMATCH (rel 3.12e-08 > 1e-9)
iq4_nl  down           MISMATCH (rel 9.91e-08 > 1e-9)
iq2_xxs avx2 gate rows MISMATCH (rel 3.35e-08 > 1e-9)
iq3_s   avx2 gate rows MISMATCH (rel 3.34e-08 > 1e-9)

Both sites fire, and the run exits non-zero. The threshold is back at 1e-5 in the commit.

Left alone deliberately: the q2_0 down comparison prints ~2.1e-04, which is the pre-existing Q2_0 kernel against ggml and is expected to be that coarse — gating it at 1e-5 would be a false alarm, so it stays print-only.


🔄 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/64 **Author:** [@pipeob0](https://github.com/pipeob0) **Created:** 9/28/2026 **Status:** ✅ Merged **Merged:** 9/28/2026 **Merged by:** [@Niko1221](https://github.com/Niko1221) **Base:** `main` ← **Head:** `gh/avx2-followups` --- ### 📝 Commits (1) - [`a3545f5`](https://github.com/Niko1221/Strata/commit/a3545f59e722dbc62f0e098e4c47654c3d55d2d9) parity tool: count a new-kernel mismatch as a failure, not just print it ### 📊 Changes **2 files changed** (+19 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/kernels/cpu/native_expert.cpp` (+3 -2) 📝 `src/kernels/native_expert_parity.cpp` (+16 -5) </details> ### 📄 Description The two follow-ups you listed in your #43 merge note. Both are yours to shape; nothing here changes a kernel. **1. The comment above the gate/up dispatch described a fallback that no longer exists.** It said `STRATA_NO_IQ512 / STRATA_NO_IQ256 fall back to ggml-cpu's single-token vec_dot`. Since #43, `STRATA_NO_IQ512` drops an AVX-512 CPU to the AVX-2 kernel, `STRATA_NO_IQ256` drops the AVX-2 kernel, and ggml's `vec_dot` is reached only with **both** set (and on a CPU without AVX-512, `STRATA_NO_IQ512` changes nothing at all). Comment-only commit. **2. The parity tool printed the new kernels' distance from ggml's `vec_dot` without affecting the exit code.** A kernel that silently diverged still reported `0 failures`, which is the one property of that tool people rely on. Both comparisons (the gate/up rows in `check`, and the IQ4_NL down) are now gated at 1e-5 and increment `failures`. Measured headroom: gate/up rows 3.1-3.4e-08, IQ4_NL down ~1e-7, so the gate sits ~100x above the observed spread. Verified on this box (IQ2_XS, IQ2_XXS, IQ3_S, IQ4_NL layers): - threshold 1e-5 → `native_expert_parity: 0 failures` (unchanged, as it should be); - threshold temporarily dropped to 1e-9, i.e. below the observed spread, to prove the gate is live: ``` iq2_xs avx2 gate rows MISMATCH (rel 3.12e-08 > 1e-9) iq4_nl down MISMATCH (rel 9.91e-08 > 1e-9) iq2_xxs avx2 gate rows MISMATCH (rel 3.35e-08 > 1e-9) iq3_s avx2 gate rows MISMATCH (rel 3.34e-08 > 1e-9) ``` Both sites fire, and the run exits non-zero. The threshold is back at 1e-5 in the commit. Left alone deliberately: the `q2_0` down comparison prints ~2.1e-04, which is the pre-existing Q2_0 kernel against ggml and is expected to be that coarse — gating it at 1e-5 would be a false alarm, so it stays print-only. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:00:06 +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#2438
No description provided.