mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#591
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?
Originally created by @lineape on GitHub (Oct 7, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1470
Summary
On a GTX 1080 + GTX 1070 layer split, decode goes from about 33 t/s on 0.1.40.1 to about 18 t/s on 0.1.40.2 and
0.1.40.3. Prefill drops about 3%. Expert-cache slot counts, draft acceptance and hit rates are the same in both arms.
The cause is the compile-time part of
2e4ddf6("verify window: PDL on sm_90+, …", #904). Ininclude/strata/kernels/pdl.hpp,STRATA_PDL_RESTRICTbecame empty andkPdlPrefetchbecametrueon all CUDAarchitectures, not just sm_90+. On sm_61 the multi-column MMVQ kernel loses its read-only (
LDG.nc) loads. Restoringboth (a 2-line change, below) brings 0.1.40.3 back to 0.1.40.1's speed on Pascal. On an RTX 3080 it makes no
measurable difference.
Hardware and config
Box 1 (regressed):
STRATA_EXPERIMENTAL_SM60=1, archs[61],setup.sh --build. The CMakeCache ofthe two versions is identical apart from the source.
--expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp <rt> --max-context 524288 --kv int8 --kv-resident 32768 --conversation-cache-mib 16384 --conversation-cache-slots 8 --layer-split 26 --trim-stage-weights --pipeline-windows 2 --pcie-frac 0.10 --rope-scaling yarn --rope-scale 2.STRATA_IQ256_GATHER=1 STRATA_RING_BYTES=0.data/expert-profile.bin, no eviction.Box 2 (control):
[86].--expert-cache auto --prefill auto --spec 4 --spec-min-p 0.70 --mtp <rt> --max-context 524288 --kv int8 --kv-resident 32768 --rope-scaling yarn --rope-scale 2 --conversation-cache-mib 12288 --conversation-cache-slots 6 --vision --pcie-frac 0.35 --prefix-cache-dir <one dir per arm>.Method
This follows the paired method from #1373: arms alternate in one session, nothing else changes between them, and
each arm's
expert cache N slotsline is listed.binary changes, or one env var.
but the first decode after a load is still 10–20% slower. So each round reports the median of three decodes, and
the raw runs are listed too.
temperature: 0), from a ~115-token prompt (a fresh UUID prefix each request, sono cache reuse), three requests per round. The figure is Strata's own
timings.predicted_per_second, median of three.prompt_per_second.requests. Each restores a parked conversation (
cache_n≈ 10,965), so it times the snapshot restore plus ashort verify.
Results: box 1 (GTX 1080 + GTX 1070, IQ2_XS)
Paired run 1: 0.1.40.1 vs stock 0.1.40.3
conversation_snapshot_testpasses on 0.1.40.3 on these GPUs (3901 checks).Paired run 2: 0.1.40.2 bisects the range
(Rounds 3 and 5 of that session tested another model.)
Paired run 3: the 2-line fix
A later session with the fix built into the full tree (not a probe build) gave 32.4 and 33.9 t/s decode, and
388.7 / 385.8 t/s prefill. The fix recovers decode, prefill and switch-back fully on this box.
Across all of these sessions, MTP draft acceptance per 400-token decode is 177–264 of 274–345 in every arm, with no
pattern by engine.
Results: box 2 (RTX 3080, IQ3_XXS), the control
Mean decode: 0.1.40.1 72.3, 0.1.40.3 74.1, 0.1.40.3 + fix 74.5. All three are within this box's spread.
The fix is neutral on Ampere, and 0.1.40.3 did not regress there.
Ruled out on box 1 (each against stock 0.1.40.3 in the same paired session)
STRATA_STAGER_SLEEP=0STRATA_MMVQ_IL=0--pipeline-windows 1--pipeline-windows 1)STRATA_MMVQ_IL:il_arch_ok()already requires sm_80+, so this is expected.--pipeline-windows 1: regresses just as much, so the cause is a kernel, not the window scheduling.--pipeline-windows 1: 3367 + 2574 on 0.1.40.1, 3365 + 2572 on 0.1.40.3.applies to sm_61. dp4a is gated
< 610, the IL path is sm_80+, PDL launches are sm_90+, and the file-tier I/Ochanges don't apply (this box uses the in-RAM expert arena).
d6850f3(IQ2_S/IQ3_S AVX2 decode) and5208b32(AVX2 Q8_K quantizer), were nottested on the GPU. The fix alone recovers the full gap, so they are not needed to explain it.
Root cause
2e4ddf6changedinclude/strata/kernels/pdl.hppfor every CUDA build:The SASS.
cuobjdump -sassof the shipped sm_61 engines, summed over all 334native_mmvq_multi_kernelinstances. This is the 2–8-token verify-window projection, so it runs in every speculative decode step:
LDG.E.CI/.CONSTANT)LDG2e4ddf6^(native_mmvq.cubuilt alone)2e4ddf6(native_mmvq.cubuilt alone)kPdlPrefetch = falseonlynative_quantize_q8_1_kernelalso goes fromLDG.ncto plainLDG.Why this hurts GP104 and not newer cards. On GP104 (GTX 1070/1080), as on Maxwell, global loads are cached in
L1/tex only through the read-only
LDG.ncpath. A plainLDGgoes to L2. With__restrict__gone, the compilercan no longer prove the q8_1 activations are read-only, so every block re-reads them from L2. GP100 and sm_70+ cache
ordinary global loads in L1 too. That is consistent with the RTX 3080 result above, and with nobody noticing on
current cards.
Not covered by the fix:
2e4ddf6also replaced the q/gate split'scudaMemcpy2DAsyncwith acopy_rows_stridedkernel in
verify.cpp. The fix doesn't touch that, and it doesn't need to: the gap closes fully without it.The fix we run (2 lines)
Caveat: this is a workaround, not a proposed upstream patch.
__restrict__is safe there withSTRATA_DF_PDLon, so we keep that unset. Neither of our cards is sm_90.signature, which is what the header comment says ruled out
__CUDA_ARCH__.check), rather than per translation unit;
xthrough__ldgafterpdl_wait(). Theasm volatilewait carries a memory clobber, so the loadcan't be hoisted above it.
Related
drop that turned out to be a cold-engine measurement artifact. This report follows the paired method and slot
reporting asked for there. Unlike that case, the gap here is about 2× rather than 10–20%, it is the same in every
pair, and a one-file rebuild removes it.
consumer-class Pascal (GP102), so its stage runs the same
native_mmvq_multi_kernelcode. It may be affectedtoo; we have not measured it.
pdl.hpp's CUDA branch doesn'tapply there, so it is probably unrelated.
Investigation, bisect and A/B runs were done with the help of Claude Code (AI-assisted); all numbers come from real paired runs on the hardware above.
@lineape commented on GitHub (Oct 7, 2026):
Duplicate of #1469 (same bisect to
2e4ddf6and the same two-line fix, filed a few minutes earlier). My extra data — GTX 1080 + 1070 layer split, the SASS load counts, and an RTX 3080 showing no regression — is in a comment there.@Niko1221 commented on GitHub (Oct 8, 2026):
Duplicate of #1469, same cause and same fix (see there):
__restrict__back on the activation pointers and no PDL prefetch below sm_70, with sm_70 and newer compiling to the same code as before. Please confirm on the GTX 1080 + 1070 with 0.1.40.4 (released now).The fix is in v0.1.40.4: https://github.com/Niko1221/Strata/releases/tag/v0.1.40.4 . Please run UPDATE.bat / ./update.sh and tell us the decode tok/s on your card.