Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

hc persist (#2226): not offered on gfx11 and gfx12

Niko1221595686f6a112
diff --git a/docs/AMD_HIP.md b/docs/AMD_HIP.md
index d5b5147fb..ef633086a 100644
--- a/docs/AMD_HIP.md
+++ b/docs/AMD_HIP.md
@@ -523,7 +523,11 @@ run it; the report below is from a community machine: an RX 6900 XT 16 GB (gfx10
says so. On 2x RX 6900 XT (ROCm 10.0, layer split): the read 1.35-2.10x, ms per verify window -4.2 % / -2.8 % at
4K / 32K (6 rounds), not bit-identical (as close to a double-accumulation reference as the default read):
[bench/results/2026-10-12-hc-persist-gfx1030](../bench/results/2026-10-12-hc-persist-gfx1030/README.md). Other
- RDNA cards are untested; the `strata hc:` line and a `STRATA_DECODE_TIMING` run from one are welcome.
+ RDNA cards are untested; the `strata hc:` line and a `STRATA_DECODE_TIMING` run from one are welcome. Not offered on gfx11 and
+ gfx12 (RDNA3, RDNA4): the barrier timeout needs `s_memrealtime`, which gfx1100 and gfx1200 / gfx1201 do not have, and an R9700 (#2226 thread) measured the
+ read +0.7 % / +1.0 % per window slower than the default one; the start-up line says so. A barrier that times out at run time
+ (never seen in a working run) leaves the partial outputs of that read in place and every later persistent read of the
+ process aborts at once, without a log line; the opt-in is for measurement on gfx103x until that is closed.
- **gfx1031** (RX 6700 XT, #524): setup knows it (the `gfx103X-all` wheels, unvalidated); its reporter runs it daily
on one card. More reports: an RX 6700 XT 12 GB run as gfx1030 on ROCm 7.2.4 (#1027: IQ2_XS, decode 30-32 tok/s, prompt about 300 tok/s, 6 of 6
needles), and an RX 6800M 12 GB on Windows with a self-built engine (#915, #1078: Q2_0, decode 9-27 tok/s, prompt 50-114 tok/s; the
diff --git a/src/kernels/cuda/fused_gr.cu b/src/kernels/cuda/fused_gr.cu
index 2653a92b6..e62315fca 100644
--- a/src/kernels/cuda/fused_gr.cu
+++ b/src/kernels/cuda/fused_gr.cu
@@ -2363,6 +2363,14 @@ struct PArgs {
// start-up check finds that out by running every T with a short timeout) or another block aborted. Then every block
// leaves the kernel; the outputs are not written completely and bar[48] stays set until the host clears the words.
__device__ __forceinline__ bool grid_sync(unsigned* bar, unsigned long long ticks) {
+#if defined(__GFX11__) || defined(__GFX12__)
+ // gfx11 and gfx12 have no s_memrealtime (clang: "needs target feature s-memrealtime"), so no barrier clock: this read is not
+ // offered there (fused_gr_persist_init refuses it; an R9700 measured it neutral to 1% slower in #2226), and a launch that gets
+ // here anyway aborts at once instead of waiting for a barrier it cannot time.
+ (void) ticks;
+ if (threadIdx.x == 0) __hip_atomic_store(&bar[48], 1u, __ATOMIC_RELAXED, __HIP_MEMORY_SCOPE_AGENT);
+ return false;
+#else
__shared__ int s_abort;
__syncthreads();
if (threadIdx.x == 0) {
@@ -2391,6 +2399,7 @@ __device__ __forceinline__ bool grid_sync(unsigned* bar, unsigned long long tick
__syncthreads();
__threadfence();
return s_abort == 0;
+#endif
}
// STRATA_HC_PERSIST=3 (a reference only, slow): every dot and sum accumulated in double
__device__ __forceinline__ double dot8d(const uint4 w, const float* x) {
@@ -2623,6 +2632,11 @@ void fused_gr_persist_init() {
"(this card runs %d)\n", dev, prop.warpSize);
return;
}
+ if (strata::kernels::gfx_arch_is_gfx12(prop.gcnArchName) || strata::kernels::gfx_arch_is_gfx11_wmma(prop.gcnArchName)) {
+ std::fprintf(stderr, "strata hc: CUDA%d: STRATA_HC_PERSIST=1 is off here: gfx11 / gfx12 have no s_memrealtime for the barrier "
+ "timeout (written and measured for gfx1030; an R9700 saw no gain from it, #2226)\n", dev);
+ return;
+ }
const int mp = prop.multiProcessorCount; // only for the confirmation line (WGPs on RDNA)
bool ok = cudaMalloc((void**) &st.part, (size_t) kFusedGrMaxT * hcp::NR * hcp::NB * sizeof(float)) == cudaSuccess &&
cudaMalloc((void**) &st.ssp, (size_t) kFusedGrMaxT * hcp::NB * sizeof(float)) == cudaSuccess &&