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#2479
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/154
Author: @gputier
Created: 9/29/2026
Status: ❌ Closed
Base:
main← Head:fix/correctness📝 Commits (6)
9c1a8a1s_gemv: the q8 split kernel reaches its barrier before a rowless warp returnsdc6022dbf16: a NaN stays a quiet NaN in f32 -> bf16, as in ggmldf94c1dqsa: mask cells whose page did not resolve; refuse a clock sweep over fewer slots than the resolve block7426fe2expert_source, s2_expert_grouped: guard the verify window's fixed tablesf51ad78gguf_reader.hpp: define NOMINMAX before windows.hde33f38build: guard the last two bench/micro targets on their file, as upstream does for the others📊 Changes
12 files changed (+316 additions, -16 deletions)
View changed files
📝
CMakeLists.txt(+10 -6)📝
include/strata/artifact/gguf_reader.hpp(+3 -0)📝
include/strata/kernels/bf16_bits.hpp(+7 -0)📝
src/core/expert_source.cpp(+17 -3)➕
src/kernels/bf16_bits_test.cpp(+80 -0)📝
src/kernels/cuda/dequant_bf16.cu(+3 -0)📝
src/kernels/cuda/kv_stream.cu(+8 -0)📝
src/kernels/cuda/qsa_decode_attn.cu(+7 -4)📝
src/kernels/cuda/s2_expert_grouped.cu(+4 -0)📝
src/kernels/cuda/s_gemv.cu(+11 -3)📝
src/kernels/elementwise_parity.cpp(+59 -0)📝
src/kernels/s_gemv_q8k_parity.cpp(+107 -0)📄 Description
The correctness fixes offered in #149, on top of 0.1.26 (
ac8b251). One commit per fix; each is small and changes no result outside the case it fixes.s_gemv: ins_gemv_q8_split_kernel, a warp with no row returned before the__syncthreads()that follows the codebook load. The codebook is now loaded first, then the rowless warp returns.s_gemv_q8k_paritygains output widths that are not a multiple of the eight rows per block.bf16: the rounding add inbf16_from_f32carried a NaN out of the mantissa (0x7FFFFFFF came back as -0, 0x7F800001 as +inf). A NaN now stays a quiet NaN, as in ggml;bf16_bits_testchecks all 2^32 inputs against ggml's rule, andelementwise_paritycovers the device side, including the second copy indequant_bf16.cu. The HIP__builtin_memcpybranch is kept as is; the NaN check comes right after it, so it applies to every backend.qsa: a cell whose KV-streaming page did not resolve (-1) was read anyway inqsa_decode_attn; it is now masked with weight 0.kv_streamstops with a message when asked to sweep fewer slots than the resolve block, where two threads could take the same slot (the engine never goes below 5,120 slots, so this is a guard).expert_source: the verify window's fixed tables (kind[128],distinct[128]) are bounded by astatic_assertand a runtime check onn_tok * k, ands2_expert_groupedasserts its group limit covers the window.gguf_reader.hpp:NOMINMAXbeforewindows.h, so every file that reaches this header can usestd::min/std::maxunder MSVC (gguf_reader_test.cpp,native_dense.cppandnative_head.cppinclude it without defining it).graph_registry_testandpinned_captureon their file. The twobench/micro/targets still unguarded,native_mmvq_multiandhit_cpu_order_parity, get the sameEXISTScheck, with the backend variables.Before the rebase: tested on an RTX 5090 (Windows 11, MSVC 2022, CUDA 13.4, sm_120), ctest 30 of 33, the three failures being missing model files on my side (
ple_paritywants a Q2_0 PLE table,expert_parityandpool_testwantpack/full/experts.bin).After the rebase on 0.1.26: the four code fixes are byte-identical to the tested ones (
git range-diff); only thebf16_bits.hppconflict and the CMake commit changed. Checked on x86-64 Linux, CPU only: configure and build clean,bf16_bits_testpasses (0 differences from ggml over 2^32 inputs), 10 of 11 CPU tests pass, and the failing one,expert_multi_test, fails the same way on plain 0.1.26. The CUDA and HIP paths were not rebuilt after the rebase, so your byte-identity gate is the check there.qsa_decode_attnands2_expert_groupedhave no ctest target, so the build is their only check.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.