[PR #4795] [CLOSED] serve: gfx1100 validates the Hadamard-folded (APR) expert path #5183

Closed
opened 2026-11-07 16:33:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4795
Author: @sefator
Created: 10/31/2026
Status: ❌ Closed

Base: main ← Head: apr-gfx1100-validated


📝 Commits (1)

  • 2f426cd serve: gfx1100 validates the Hadamard-folded (APR) expert path

📊 Changes

1 file changed (+6 additions, -2 deletions)

View changed files

📝 src/program/generate.cpp (+6 -2)

📄 Description

What this changes

One condition in src/program/generate.cpp: the load path no longer warns about
Hadamard-folded (APR) experts on gfx1100, and the message now names both
validated AMD architectures.

if (arch != "gfx1151" && arch != "gfx1100")
    fprintf(stderr, "... validated end to end on gfx1151 and gfx1100 among AMD GPUs, not yet on %s\n", ...);

Why

--draft/APR packs (Gyro-S/M/L, Gyro-Coder) store the down-projection experts
rotated (W' = W·Hᵀ) and the engine rotates the activations back in
hadamard.cpp (CPU) and hadamard_rows_kernel (GPU). That chain was validated
end to end on gfx1151 only, so every gfx1100 load printed a caution. It is a
validation gap, not a known bug — and the suite that closes it ships in the repo.

Evidence (RX 7900 XTX, gfx1100, ROCm 10.1, v0.2.7)

Model: agentionai/Qwen3.8-Flash-Next-Gyro-Coder-GGUF,
Qwen3.8-Flash-Next-Gyro-Coder-TQ2_0.gguf, packed with tools/iq_pack.py
(--compat-bf16, native_experts.txt v5, hadamard.txt 48 layers).
Reference ggml: agentionai/llama.cpp release/gyro-l (9aa51ce).

tq_cpu_parity
  AVX2 vs scalar, groups of 1..8 tokens: bitwise equal
  vs ggml-cpu vec_dot: 1.8e-07   vs to_float: 1.1e-05
  0 failures

native_hadamard_test
  FWHT vs dense normalized Sylvester: 3.35e-07
  synthetic q8_0 / tqk6 / tq2_t vs llama.cpp graph: 0.00e+00 / 1.07e-07 / 1.16e-07
  real experts (layers 0, 10, 24, 47; experts 0, 5, 128, 255): 1.05-1.20e-07
  without the rotation: 1.35-1.72   (a missing fold is caught)

native_expert_parity  (all 48 layers, tq2_t/tq2_t, blob 1,305,600 B)
  cpu vs float: <= 1.23e-02      gpu vs float: <= 2.09e-02   (bound 3e-02)
  gpu dequant vs ggml to_float: rel 0.00e+00, 0 of 4,915,200 values differ
  gpu decode-once vs per-entry kernels: bitwise equal
  0 failures

Commands:

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
  -DSTRATA_ENABLE_HIP=ON -DSTRATA_NATIVE_EXPERTS=ON -DSTRATA_BUILD_TESTS=ON \
  -DSTRATA_GGML_DIR=/path/to/agentionai/llama.cpp \
  -DCMAKE_HIP_ARCHITECTURES=gfx1100
ninja -C build tq_cpu_parity native_hadamard_test native_expert_parity

build/tq_cpu_parity
build/native_hadamard_test
build/native_hadamard_test --pack packs/gyro_coder --gguf Gyro-Coder-TQ2_0.gguf 0 0 10 5 24 128 47 255
build/native_expert_parity Gyro-Coder-TQ2_0.gguf $(seq 0 47)

Scope

This validates the expert numerics (fold + trellis kernels) on gfx1100, which is
what the warning is about. End-to-end answer quality is covered separately: the
same build serves this pack at 110-113 tok/s on the 7900 XTX with coherent code
and vision output.

Testing

  • the engine target rebuilds clean with the change;
  • the three tests above pass on the same tree with the change applied.

🔄 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/4795 **Author:** [@sefator](https://github.com/sefator) **Created:** 10/31/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `apr-gfx1100-validated` --- ### 📝 Commits (1) - [`2f426cd`](https://github.com/Niko1221/Strata/commit/2f426cd816bf07a7a2996e94533f41f4a57c595c) serve: gfx1100 validates the Hadamard-folded (APR) expert path ### 📊 Changes **1 file changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/program/generate.cpp` (+6 -2) </details> ### 📄 Description ## What this changes One condition in `src/program/generate.cpp`: the load path no longer warns about Hadamard-folded (APR) experts on **gfx1100**, and the message now names both validated AMD architectures. ```cpp if (arch != "gfx1151" && arch != "gfx1100") fprintf(stderr, "... validated end to end on gfx1151 and gfx1100 among AMD GPUs, not yet on %s\n", ...); ``` ## Why `--draft`/APR packs (Gyro-S/M/L, Gyro-Coder) store the down-projection experts rotated (`W' = W·Hᵀ`) and the engine rotates the activations back in `hadamard.cpp` (CPU) and `hadamard_rows_kernel` (GPU). That chain was validated end to end on gfx1151 only, so every gfx1100 load printed a caution. It is a validation gap, not a known bug — and the suite that closes it ships in the repo. ## Evidence (RX 7900 XTX, gfx1100, ROCm 10.1, v0.2.7) Model: `agentionai/Qwen3.8-Flash-Next-Gyro-Coder-GGUF`, `Qwen3.8-Flash-Next-Gyro-Coder-TQ2_0.gguf`, packed with `tools/iq_pack.py` (`--compat-bf16`, `native_experts.txt v5`, `hadamard.txt` 48 layers). Reference ggml: agentionai/llama.cpp `release/gyro-l` (9aa51ce). ``` tq_cpu_parity AVX2 vs scalar, groups of 1..8 tokens: bitwise equal vs ggml-cpu vec_dot: 1.8e-07 vs to_float: 1.1e-05 0 failures native_hadamard_test FWHT vs dense normalized Sylvester: 3.35e-07 synthetic q8_0 / tqk6 / tq2_t vs llama.cpp graph: 0.00e+00 / 1.07e-07 / 1.16e-07 real experts (layers 0, 10, 24, 47; experts 0, 5, 128, 255): 1.05-1.20e-07 without the rotation: 1.35-1.72 (a missing fold is caught) native_expert_parity (all 48 layers, tq2_t/tq2_t, blob 1,305,600 B) cpu vs float: <= 1.23e-02 gpu vs float: <= 2.09e-02 (bound 3e-02) gpu dequant vs ggml to_float: rel 0.00e+00, 0 of 4,915,200 values differ gpu decode-once vs per-entry kernels: bitwise equal 0 failures ``` Commands: ```bash cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \ -DSTRATA_ENABLE_HIP=ON -DSTRATA_NATIVE_EXPERTS=ON -DSTRATA_BUILD_TESTS=ON \ -DSTRATA_GGML_DIR=/path/to/agentionai/llama.cpp \ -DCMAKE_HIP_ARCHITECTURES=gfx1100 ninja -C build tq_cpu_parity native_hadamard_test native_expert_parity build/tq_cpu_parity build/native_hadamard_test build/native_hadamard_test --pack packs/gyro_coder --gguf Gyro-Coder-TQ2_0.gguf 0 0 10 5 24 128 47 255 build/native_expert_parity Gyro-Coder-TQ2_0.gguf $(seq 0 47) ``` ## Scope This validates the expert numerics (fold + trellis kernels) on gfx1100, which is what the warning is about. End-to-end answer quality is covered separately: the same build serves this pack at 110-113 tok/s on the 7900 XTX with coherent code and vision output. ## Testing - the engine target rebuilds clean with the change; - the three tests above pass on the same tree with the change applied. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:33:18 +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#5183
No description provided.