mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #281] [CLOSED] numerics: saturate the prompt path's FP16 SwiGLU products; log1pf in the unfused GDN gate #2547
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#2547
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/281
Author: @sergqwer
Created: 9/30/2026
Status: ❌ Closed
Base:
main← Head:pr/numerics📝 Commits (1)
a3af1ednumerics: saturate the prompt path's FP16 SwiGLU products; log1pf in the unfused GDN gate📊 Changes
2 files changed (+6 additions, -3 deletions)
View changed files
📝
src/kernels/cuda/native_gdn_preprocess.cu(+1 -1)📝
src/prefill/kernels.cu(+5 -2)📄 Description
Summary
Two numerical edge cases found in a read-only audit of the prompt path:
FP16's range (±65504) before rounding. A token with a massive activation otherwise becomes
infthere, andNaNafter the GEMM. Decode's q8_1 path (range ~8e6) stays finite for the same token.
logf(1 + expf(v)), which returns 0 for v below ~-16 (1 + e^vrounds to 1). The fused kernels,
gdn.cuandverify_kernels.cualready uselog1pf(expf(v)); now the unfusedpath does too.
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. On ordinary prompts nothing moves: first-token KL to main 0, 0.00013 and 0 on three prompts(1K, 2K and 4K tokens), which is the run-to-run noise itself.
🤖 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.