mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2226] [CLOSED] STRATA_HC_PERSIST=1 (opt-in, HIP): the verifier's hyper-connection read as one persistent kernel (gfx1030: read 1.35-2.10x, per window -4.2 % / -2.8 %) #3938
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#3938
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/2226
Author: @Vop3p
Created: 10/13/2026
Status: ❌ Closed
Base:
main← Head:hc-persist📝 Commits (4)
0e3a42cSTRATA_HC_PERSIST=1 (opt-in, HIP): the verifier's hyper-connection read as one persistent kernel33590e7tests: hc_persist_parity - the STRATA_HC_PERSIST=1 read against the default multi read at T = 1..8 (bounded 1e-4, finite, two runs bitwise), and hc_persist_default_off: with the variable unset it never runs; a skip where the card cannot hold the 80 blocks and on CUDA6ce12b4hc persist results: ten interleaved pairs on 0.1.43.1 with no other switch (-6.6 % / -4.4 % ms per verify window at 4K / 32K, 10 of 10 pairs)26649c6hc persist: builds on gfx12 (off there: no s_memrealtime), and a read that gives up poisons its window and resets📊 Changes
8 files changed (+980 additions, -0 deletions)
View changed files
📝
CMakeLists.txt(+8 -0)➕
bench/results/2026-10-12-hc-persist-gfx1030/README.md(+163 -0)➕
bench/results/2026-10-12-hc-persist-gfx1030/hc_persist_bench.cpp(+73 -0)📝
docs/AMD_HIP.md(+7 -0)📝
include/strata/kernels/fused_gr.hpp(+11 -0)📝
src/core/verify.cpp(+4 -0)📝
src/kernels/cuda/fused_gr.cu(+511 -0)➕
src/kernels/hc_persist_parity.cpp(+203 -0)📄 Description
Title
Issue: none of its own.
STRATA_GR_V3=1is another opt-in for the same read; on gfx1030 it needs the two-half split, which fails its check (#375), so it falls back to the default read.Summary
At 1-8 tokens the verifier's hyper-connection read (twice per layer) is three small launches with two global
dependencies, and on gfx1030 the down projection runs 41 blocks on 40 WGPs. Opt-in
STRATA_HC_PERSIST=1(HIP) runs itas one kernel of 80 blocks with two grid barriers: the down projection split by column slices over all 80 blocks,
a distributed reduction, then the up projection and the same epilogue as
gr_up_kernel.2x RX 6900 XT (gfx1030), ROCm 10.0, layer split:
4K 25.81 -> 24.73 (-4.2 %), 32K 24.40 -> 23.72 (-2.8 %), every round the same way; tokens per window and
prompt speed unchanged.
Not bit-identical (another summation order). Against a double-accumulation reference (
STRATA_HC_PERSIST=3) on the106K-token chat of a 3-chat
STRATA_LOGPOSrun on this branch: KL 0.0131 / argmax 96.3 % against the default read's0.0136 / 95.0 %.
What changed
src/kernels/cuda/fused_gr.cu: the persistent kernel, its start-up check andfused_gr_read_persist, all inside#if defined(__HIPCC__); CUDA and SYCL get two empty stubs.src/core/verify.cpp:Verifier::initcallsfused_gr_persist_init(); the multi read triesfused_gr_read_persistfirst and falls through tofused_gr_read_multiwhen it returns false (off, more tokensthan were checked, a Q8 / QFUSE read).
include/strata/kernels/fused_gr.hpp: the two declarations.docs/AMD_HIP.md(RDNA2 section): one bullet.bench/results/2026-10-12-hc-persist-gfx1030/: the measurements, smaller cards simulated withHSA_CU_MASK, whatwas tried and dropped, and
hc_persist_bench.cppto time the read alone.How it stays safe on cards it was not written for:
timeout keeps the default read for that count and larger ones (checked: 1 and 5 WGPs via
HSA_CU_MASKtime out andfall back, no hang). No occupancy API in front of it: it promised too many blocks on 30 WGPs and too few with
Ubuntu's HIP 7.1 runtime, which turned the read off although it runs resident there;
strata hc:line per card says what was decided.What it leaves alone: the default path (with the variable unset both entry points return in their first line), the
drafter's reads (their own stream), the prompt path, CUDA, SYCL.
Default path byte-identical: main (
a0116b27) built without and with this change, same options, variable unset: the106K chat's 481 scored positions are bitwise identical (the two shorter chats differ between two runs of the same
binary on this machine, so they cannot show it).
Extra Notes
other backends see two stubs and two declarations.
6600, RDNA 3, RDNA 4 are open. Help wanted: from any RDNA card, the
strata hc:line and aSTRATA_DECODE_TIMING=1run with and withoutSTRATA_HC_PERSIST=1.snapshot running-state copy: an illegal memory access was encountered" (the variable unset, so this code did not
run); a rerun passed. The same message as #1932; noted there would be the place if it comes back.
Developed with an AI coding assistant; every number above was measured on 2x RX 6900 XT (gfx1030, PCIe 4.0 x8 each) / Ryzen 5 5600X, ROCm 10.0.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.