mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#3461
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/1448
Author: @MatthewHines
Created: 10/7/2026
Status: ❌ Closed
Base:
main← Head:fix/606-q8_1-unclamped-ds-sites📝 Commits (2)
e093c88#606: clamp the three unclamped q8_1 scale/sum emit sites via q8_1_ds1f4f9f6docs: #606 - q8_1 finite-emit criteria and the degeneration RCA📊 Changes
5 files changed (+244 additions, -3 deletions)
View changed files
➕
docs/DEGENERATION_RCA.md(+156 -0)➕
docs/Q8_1_FINITE_DS.md(+83 -0)📝
src/kernels/cuda/fused_gr.cu(+2 -1)📝
src/kernels/cuda/iq_kernels.cu(+1 -1)📝
src/kernels/cuda/verify_kernels.cu(+2 -1)📄 Description
Summary
Three kernels still emit the
(d, sum)pair of a q8_1 activation block with a rawmake_half2(d, sum), bypassing the finite helper the rest of the tree has used since19de7f4/f6601bf(include/strata/kernels/q8_1_finite.hpp):fused_gr.cu—gr_q8_tailverify_kernels.cu—gdn_q8_1_storeiq_kernels.cu—s26_swiglu_q8_1_kernelA block whose
amaxoverflows (or that reads a non-finite input) emitsd = inf/NaN; fp16 turns the pair into NaN (or the pathological(0, 0)). Nothing downstream tests for finiteness — the dot kernels assume the producer upheld the invariant, because every other producer sharesq8_1_ds(). A NaN scale poisons the fp16 dot of the quantized activation and every sum downstream of it through the layer stack; a fully non-finite logit row ends at the sampler's all-non-finite fallback — vocabulary id 0, the!face of #606.This is the same defect class already fixed at the other emit sites; these three were missed. The fix is the same one-liner pattern: route the pair through
q8_1_ds(), which clamps both halves into the fp16-finite range (finited, non-negative finitesum— the sum is a mean of|x|) and produces for the GPU paths the same bits the CPU pool and the already-clamped GPU sites produce for the same block. Content-blind producer-side clamp; nothing model-text-aware anywhere in it.Verification
nvcc -std=c++20 -arch=sm_120 -cclean on all three changed translation units (CUDA 13.4.2).!) degeneration face of #606 appears on builds where the fused/S26 paths are enabled and is absent on boots that use the clamped path exclusively — consistent with the site inventory. The wider carried-state failure (restart-cures-it, spans sessions) is analyzed indocs/DEGENERATION_RCA.md; it involves two further purity violations of the state cache that this PR deliberately does not change code for.Scope
3 clamp lines + 2 includes + 2 docs. No behavior, tuning, or policy changes. Deployment-side mitigations we use in the interim (freezing the expert migrator with the existing flag, disabling the suffix-draft source, serve-layer repetition detectors) are listed as prose in the RCA doc so maintainers can route them properly — no code for them here.
Docs added:
docs/Q8_1_FINITE_DS.md— the invariant, the missed sites, diagnostic criteria for this defect class.docs/DEGENERATION_RCA.md— the full root-cause analysis: the restart-cure and cross-session-persistence localization levers, the three purity violations ofstate = f(prefix), the falsification tests that pinned each one, a field diagnostic protocol, and recommended engine-side remedies (tier-aware checkpoint identity for the residency split; reproducible policy inputs for the drafting side).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.