mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2358] [CLOSED] fused_gr: STRATA_GR_NORM_FAST=1 on CUDA too (opt-in): decode +0.5-0.6% on a V100 + PG500 layer split #4002
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#4002
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/2358
Author: @Warabii1248
Created: 10/14/2026
Status: ❌ Closed
Base:
main← Head:cuda-gr-norm-fast📝 Commits (2)
16da736fused_gr: STRATA_GR_NORM_FAST=1 on CUDA too (opt-in; the register split norm is bitwise the default; decode +0.5-0.6% on a V100 + PG500 split)a8fe203fused_gr: say in the comment that CUDA opts in to the register split norm📊 Changes
1 file changed (+4 additions, -2 deletions)
View changed files
📝
src/kernels/cuda/fused_gr.cu(+4 -2)📄 Description
Title
fused_gr: STRATA_GR_NORM_FAST=1 on CUDA too (opt-in): decode +0.5-0.6% on a V100 + PG500 layer split
Issue: none (on
main, independent of other PRs; three lines in the CUDA side ofnorm_fast_on()and one comment)Summary
norm_fast_on()readsSTRATA_GR_NORM_FASTunder HIP only (on by default for gfx12); on CUDA it always returns false.gr_norm_split_fast_kernelis built for CUDA too and is documented as bitwise equal togr_norm_split_kernel(the same elements, operations and order).It is used only when the hyper-connection read runs split or staged (
variant >= kHcSplit); on this machine the engine reportsthe hyper-connection read runs as stagedon both cards.This lets CUDA opt in with the same variable, on every CUDA architecture; we measured sm_70 only. Without the variable nothing changes.
It is separate from
gr_fast()(on withSTRATA_SM70_TABLE=1), which swaps the plain read's norm kernel and the up kernel; it does not choosethe split / staged norm that this variable switches. The numbers below are with
STRATA_SM70_TABLE=1and this variable on top.What changed
src/kernels/cuda/fused_gr.cu: on the CUDA side ofnorm_fast_on()(#else), readSTRATA_GR_NORM_FASTonce and return true when it is set and not 0.The HIP side is unchanged. The comment above it, "gfx12 only until another arch is measured", now says CUDA opts in (second commit, comment only).
STRATA_ENABLE_HIPandSTRATA_HIP_GFX906) compile the.cufiles as HIP and take the unchanged__HIPCC__side.The SYCL build uses its own copy (
sycl/src/kernels/cuda/fused_gr.dp.cpp), which this does not touch.HIP builds, without a GPU in ROCm 7.14 containers:
-DSTRATA_HIP_GFX906=ON -DCMAKE_HIP_ARCHITECTURES=gfx906(themixa3607/rocm-gfx906:7.14-completeimage docs/AMD_HIP.md uses;
strata) and-DSTRATA_ENABLE_HIP=ON -DSTRATA_ENABLE_CUDA=OFF -DCMAKE_HIP_ARCHITECTURES="gfx1100;gfx1201"(rocm/dev-ubuntu-24.04:7.14.1-full;strata) both compile with 0 errors. Not run (no AMD card here). SYCL not built: it does not compile the changed file.Checks (Tesla V100-PCIE-32GB + Tesla PG500-216 (sm_70, 32 GB), layer split K=24, Linux, CUDA 12.9,
-DSTRATA_EXPERIMENTAL_SM60=ON)How we checked: a build of this branch's first commit (
maina0116b2+16da736; the second commit changes a comment only), the parity test and themicro benchmark on each card with and without the variable, then the engine with and without it in ABBA order at two power limits.
gr_parity --selftest(STRATA_HC_SPLIT=2) on the V100 and the PG500,STRATA_GR_NORM_FASTunset and=1(4 runs): every line passes.fused_gr_bench 100 1 5 48(48 weight sets in turn, read cold): the norm stage V100 9.1-9.2 -> 8.2 us, PG500 8.1-8.2 -> 7.2-7.3 us (T 1-5),0 differing.Engine: the GSQ-RCO IQ3_XXS model and pack that
setup.py --model IQ3_XXSinstalls (ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF), with setup'slaunch settings (
--mmap-experts, image input on,--spec 4 --spec-min-p 0.5), 256K context, int8 KV, layer split K=24,STRATA_SM70_TABLE=1,STRATA_PLE_PROBE=0(skips the start-up PLE read check and keeps direct reads). Every expert resident on both cards.Temperature 0, no thinking, three short questions (English, Japanese, code; generated to their caps of 400 / 600 / 400 tokens).
A fresh engine start per run, one warm-up pass, then two passes (9 requests per start). On, off, off, on (ABBA) at 170 W and at 250 W.
Decode tok/s (measured on the client from the stream; mean of two starts):
STRATA_GR_NORM_FAST=1STRATA_GR_NORM_FAST=1Per start (English / Japanese / code): 170 W on 100.5 / 111.7 / 122.8 twice, off 99.9 / 111.0 / 122.1 and 99.9 / 111.0 / 122.2;
250 W on 100.5 / 111.7 / 122.9 and 100.4 / 111.6 / 122.8, off 100.0 / 111.2 / 122.3 and 99.9 / 111.0 / 122.1.
The two starts of a setting are within 0.2 tok/s, and every start with the variable is above every start without it.
Replies: identical bit for bit per question in all 72 requests (8 starts x 9), on and off alike.
MTP drafts accepted / drafted (the 9 requests of one start): 2,712 / 3,448 in all 8 starts.
Rechecked on main at
ed4773e(271 commits aftera0116b2) with the same two commits cherry-picked onto it: it builds,gr_parityreportsgr_parity OKon both cards with the variable unset and=1, and decode (one run each way, 170 W,--spec-min-p 0.5, mean of the three short questions over two repetitions) is 112.6 tok/s with the variable and 112.1 without (+0.4%).Extra Notes
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.