Skip to content

[Engine] pool_determinism fails for Q4_K gate/up rows on an AVX2-only CPU since 4414c2988 (the rows differ from run to run) #6754

Open

Description

@Vop3p

Area

[Engine] (speed, kernels, models, the server and API)

Desktop app, Terminal or source?

Source (START-HERE.bat, setup.sh or a build)

What happened

ctest on current main fails pool_determinism and pool_determinism_dep_off with "gate/up rows differ". The test prints the first failures and folds the rest into summary lines without the format numbers, so I ran the pairs one at a time with --type: only Q4_K as the gate/up format fails, whatever the down format.

--type G,D (reps 5) result
12,2 (Q4_K / Q4_0) FAIL, 12-16 of ~160-180 checks (the count changes from run to run)
12,6 / 12,8 / 12,12 FAIL (14 / 16 / 14)
2,12 and 21,12 (Q4_K as down) PASS
gate/up 2, 3, 6, 7, 8, 10, 11, 13, 14, 16-23, 40, 42 with down 2 PASS, 0 failures

So Q5_K, Q6_K, Q8_0, IQ4_XS, IQ3_XXS and IQ3_S, which the same commit also changed, pass as gate/up here. The full run's output:

FAIL gu 12 down 2 default nt=1 rep 2 threads 4: gate/up rows differ
FAIL gu 12 down 2 default nt=2 rep 0 threads 1: gate/up rows differ
FAIL gu 12 down 2 default nt=3 rep 2 threads 4: gate/up rows differ
FAIL gu 12 down 2 invariant nt=1 rep 9 threads 16: gate/up rows differ
FAIL gu 12 down 2 invariant nt=2 rep 2 threads 4: gate/up rows differ
FAIL gu 12 down 2 invariant nt=3 rep 3 threads 8: gate/up rows differ
     112 x gu  down  default nt= rep  threads : gate/up rows differ
     110 x gu  down  invariant nt= rep  threads : gate/up rows differ
pool_determinism: 294 format pairs, 120945 checks, 222 failures -> FAIL

One of the failing checks is threads 1, so it is not only the multi-thread row split.

I bisected it with pool_determinism --reps 20 (the ctest arguments) between 6e38f58 (passes: 124656 checks, 0 failures) and 94e1fc4 (fails: 222 failures). No commit was skipped; each bad commit's full run reported 222 failures. First bad commit: 4414c29 "Optimize Unsloth CPU SIMD quant kernels and all-tier VRAM/RAM planning", which changes engine/src/quant/x86/dot_avx2.cpp (+581) among others. Its parent bbced6d passes.

I have not looked for the cause inside the kernel.

Smallest steps or command that reproduce it

cmake -S engine -B build -DCMAKE_BUILD_TYPE=Release -DSTRATA_ENABLE_HIP=ON -DCMAKE_HIP_ARCHITECTURES=gfx1030 \
  -DCMAKE_HIP_COMPILER=/opt/rocm/core-10.0/lib/llvm/bin/clang++ -DSTRATA_BUILD_TESTS=ON -DSTRATA_NATIVE_EXPERTS=ON \
  -DSTRATA_OWN_CPU_QUANT=ON -DSTRATA_AMD_COMMUNITY_TUNING=ON
cmake --build build --target pool_determinism
./build/pool_determinism --reps 20

Reproduction status

Reproduced locally

Strata version

main 94e1fc4 (after the 0.2.20 release, engine 0.1.66), built from source; first bad 4414c29

Graphics card, memory and system

AMD Ryzen 5 5600X (AVX2, FMA, F16C; no AVX-512) · 2x RX 6900 XT 16 GB · 128 GB RAM · Ubuntu 26.04, GCC 15.2, ROCm 10.0

Model, size and settings

Not relevant (unit test, no model)

Logs

The output above is the whole failing part of pool_determinism --reps 20 at 4414c29 and at 94e1fc4; 222 failures at both. The single-pair runs above are at 4414c29.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions