[GH-ISSUE #149] RTX 5090 numbers from the StrataGP fork, a few fixes, and which PRs you'd want #79

Closed
opened 2026-11-04 01:39:40 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @gputier on GitHub (Sep 29, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/149

Hi Niko,

I keep a fork, gputier/StrataGP, based on your f1b1d96 (0.1.21). It started as an audit of the engine and grew into 16 small packages of performance and precision changes, each documented in docs/perf/ with a switch back to your code path. Before sending any code I'd rather ask what you want, since you have already done several of the same things between 0.1.22 and 0.1.24 (C-2, C-3, D-2, D-4, F-1, PR #109, the tensor-core top-k).

What was measured

One RTX 5090 (170 SMs), Ryzen 9 9950X3D, 128 GB, Windows 11, IQ3_S, 262K context, greedy, 256 tokens, mean of 3 runs. Reference: your f1b1d96 built with the same compiler (MSVC 2022, CUDA 13.4, sm_120).

f1b1d96 fork
decode, prompts of 32 / 2.5K / 23K tokens 115 / 132 / 140 tok/s 122 / 151 / 155 tok/s +5% to +15%
prompt, 2,520 tokens 1,397 tok/s 1,982 tok/s +42%
prompt, 23,019 tokens 2,074 tok/s 3,090 tok/s +49%

Part of that prompt gain comes from work you have since done yourself (indexer append per chunk, tiled GDN conv, split GDN recurrence), so it is not all on the table. With the expert cache held at the same size in both engines, two of the three prompts give your exact tokens; the third diverges at its 229th token and I have not found why yet (gputier/StrataGP#55). Nothing has run on several GPUs.

Small correctness fixes that still apply to 0.1.24

I checked each against your current main (3ce2523):

  • s_gemv_q8_split_kernel returns before the __syncthreads() that follows the codebook load (src/kernels/cuda/s_gemv.cu:150); the fix loads first, then returns.
  • bf16_from_f32 turns a NaN into -0 (include/strata/kernels/bf16_bits.hpp:31-36); the fix keeps it a quiet NaN, checked over all 2^32 inputs.
  • qsa_decode_attn has no guard when a KV-streaming page is -1 (src/kernels/cuda/qsa_decode_attn.cu:98-117).
  • expert_pool_dispatch_multi fills fixed arrays (kind[128], distinct[128]) without a bound check (src/core/expert_source.cpp:314).
  • gguf_reader.hpp includes windows.h without NOMINMAX; any file that reaches it and uses std::min/std::max fails under MSVC. Defining it in the header, right before windows.h, fixes all includers at once.

Each is a few lines. I can send them as one PR or separately, as you prefer.

Performance changes that are still new against 0.1.24

Ordered from the most self-contained:

  1. sampler: top-k for sampled requests without the O(k²·V) scan, spread over the whole GPU (sampler.cu is untouched since f1b1d96).
  2. grouped-experts: the Q2_0 grouped kernel without the 8-way bank conflicts and with hx computed once per token.
  3. iq-kernels: IQ grids decoded once per weight instead of once per column.
  4. grids: fetch_blobs/gather_rows sized from the SM count instead of 48 * 8, and the GDN step on a 4-block cluster on sm_90+.
  5. qsa-small: the QSA step and positions uploaded once per token instead of once per layer, and no FP64 RoPE table when nothing reads it (64 MiB at 262K).
  6. cpu: a flat task split in the CPU pool (run_split) and MADV_HUGEPAGE on the Linux arena.
  7. Python only: the prompt encoded incrementally in the server, and make_profile.py giving the routing traces a weight.

Every default path in these packages is meant to be bit-identical and has a STRATA_OLD_* switch; their parity tests pass on the 5090.

Which of these, if any, would you take? I'll rebase each one on your main and re-run its parity test and an A/B on the 5090 before opening the PR.

Image
Originally created by @gputier on GitHub (Sep 29, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/149 Hi Niko, I keep a fork, [gputier/StrataGP](https://github.com/gputier/StrataGP), based on your `f1b1d96` (0.1.21). It started as an audit of the engine and grew into 16 small packages of performance and precision changes, each documented in [`docs/perf/`](https://github.com/gputier/StrataGP/tree/main/docs/perf) with a switch back to your code path. Before sending any code I'd rather ask what you want, since you have already done several of the same things between 0.1.22 and 0.1.24 (C-2, C-3, D-2, D-4, F-1, PR #109, the tensor-core top-k). ## What was measured One RTX 5090 (170 SMs), Ryzen 9 9950X3D, 128 GB, Windows 11, IQ3_S, 262K context, greedy, 256 tokens, mean of 3 runs. Reference: your `f1b1d96` built with the same compiler (MSVC 2022, CUDA 13.4, sm_120). | | f1b1d96 | fork | | | --- | ---: | ---: | ---: | | decode, prompts of 32 / 2.5K / 23K tokens | 115 / 132 / 140 tok/s | 122 / 151 / 155 tok/s | +5% to +15% | | prompt, 2,520 tokens | 1,397 tok/s | 1,982 tok/s | +42% | | prompt, 23,019 tokens | 2,074 tok/s | 3,090 tok/s | +49% | Part of that prompt gain comes from work you have since done yourself (indexer append per chunk, tiled GDN conv, split GDN recurrence), so it is not all on the table. With the expert cache held at the same size in both engines, two of the three prompts give your exact tokens; the third diverges at its 229th token and I have not found why yet (gputier/StrataGP#55). Nothing has run on several GPUs. ## Small correctness fixes that still apply to 0.1.24 I checked each against your current `main` (3ce2523): - `s_gemv_q8_split_kernel` returns before the `__syncthreads()` that follows the codebook load (`src/kernels/cuda/s_gemv.cu:150`); the fix loads first, then returns. - `bf16_from_f32` turns a NaN into -0 (`include/strata/kernels/bf16_bits.hpp:31-36`); the fix keeps it a quiet NaN, checked over all 2^32 inputs. - `qsa_decode_attn` has no guard when a KV-streaming page is -1 (`src/kernels/cuda/qsa_decode_attn.cu:98-117`). - `expert_pool_dispatch_multi` fills fixed arrays (`kind[128]`, `distinct[128]`) without a bound check (`src/core/expert_source.cpp:314`). - `gguf_reader.hpp` includes `windows.h` without `NOMINMAX`; any file that reaches it and uses `std::min`/`std::max` fails under MSVC. Defining it in the header, right before `windows.h`, fixes all includers at once. Each is a few lines. I can send them as one PR or separately, as you prefer. ## Performance changes that are still new against 0.1.24 Ordered from the most self-contained: 1. `sampler`: top-k for sampled requests without the O(k²·V) scan, spread over the whole GPU (`sampler.cu` is untouched since `f1b1d96`). 2. `grouped-experts`: the Q2_0 grouped kernel without the 8-way bank conflicts and with `hx` computed once per token. 3. `iq-kernels`: IQ grids decoded once per weight instead of once per column. 4. `grids`: `fetch_blobs`/`gather_rows` sized from the SM count instead of `48 * 8`, and the GDN step on a 4-block cluster on sm_90+. 5. `qsa-small`: the QSA step and positions uploaded once per token instead of once per layer, and no FP64 RoPE table when nothing reads it (64 MiB at 262K). 6. `cpu`: a flat task split in the CPU pool (`run_split`) and `MADV_HUGEPAGE` on the Linux arena. 7. Python only: the prompt encoded incrementally in the server, and `make_profile.py` giving the routing traces a weight. Every default path in these packages is meant to be bit-identical and has a `STRATA_OLD_*` switch; their parity tests pass on the 5090. Which of these, if any, would you take? I'll rebase each one on your `main` and re-run its parity test and an A/B on the 5090 before opening the PR. <img width="1338" height="1004" alt="Image" src="https://github.com/user-attachments/assets/536a0053-9aaa-4595-bb34-2c83fe25b4e0" />
Author
Owner

@Niko1221 commented on GitHub (Sep 29, 2026):

Thank you for the careful audit and the documented packages. We'll review #154 first. For performance, one PR per package rebased on 0.1.26 works best, starting with the sampler top-k, the grouped Q2_0 kernel and the IQ grid decode (some of the prompt-path items, like the indexer append and the tiled GDN conv, were done independently on main meanwhile). Each should keep the default path byte-identical and include its parity test. We'll gate them (no-repeat on every quant, long prompts, 2-GPU) and credit you in the release notes.

<!-- gh-comment-id:5898196032 --> @Niko1221 commented on GitHub (Sep 29, 2026): Thank you for the careful audit and the documented packages. We'll review #154 first. For performance, one PR per package rebased on 0.1.26 works best, starting with the sampler top-k, the grouped Q2_0 kernel and the IQ grid decode (some of the prompt-path items, like the indexer append and the tiled GDN conv, were done independently on main meanwhile). Each should keep the default path byte-identical and include its parity test. We'll gate them (no-repeat on every quant, long prompts, 2-GPU) and credit you in the release notes.
Author
Owner

@Niko1221 commented on GitHub (Sep 30, 2026):

The correctness fixes (#154) and the sampler top-k (#197) are in 0.1.29, which is in testing. Thanks! Please send the grouped Q2_0 kernel and the IQ grid decode as their own PRs, as agreed. Closing this umbrella issue.

<!-- gh-comment-id:5910285050 --> @Niko1221 commented on GitHub (Sep 30, 2026): The correctness fixes (#154) and the sampler top-k (#197) are in 0.1.29, which is in testing. Thanks! Please send the grouped Q2_0 kernel and the IQ grid decode as their own PRs, as agreed. Closing this umbrella issue.
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#79
No description provided.