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#4779
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/3779
Author: @linxuhao
Created: 10/22/2026
Status: 🔄 Open
Base:
main← Head:sm80-all📝 Commits (10+)
48dc535Dense dequant: the wide kernels by default on sm_80 too (bitwise)eaedca8MMVQ-IL: sm_80 row tables measured on a CMP 170HX056d36aPrefill fused IQ experts on sm_80: 256 threads (STRATA_PF_FUSED_NT=256), whole-layer launches (STRATA_PF_BATCH=N), two-pass weight loads in the 256-thread kernels (bitwise)da81826Prefill PLE: STRATA_PLE_COMPACT=1 uploads the raw IQ4_NL rows and dequantizes them on the device0ba47e6Prefill: STRATA_PLE_COPY_STREAM=1 uploads the compact PLE rows on their own stream952dd78Native head: STRATA_EMBED_VRAM=1 keeps the token-embedding table in VRAM741fc6aPrefill: STRATA_DEQUANT_SIDE=1 dequantizes the dense weights on a side stream into a double-buffered scratch579cbfbPrefill fused IQ experts on sm_80: an f16 mma path (STRATA_PF_FUSED_F16=1) and a warp-specialized kernel (STRATA_PF_FUSED_WS=1)f1cabc9Prefill GDN: STRATA_GDN_TC=1 runs the DeltaNet recurrence as a chunked scan on the tensor cores (sm_80+, opt-in)0d51292Conversation checkpoints: STRATA_CKPT_ASYNC (background device-to-host copy) and STRATA_CKPT_VRAM_SLOTS (recent GDN states kept in VRAM)📊 Changes
32 files changed (+3971 additions, -178 deletions)
View changed files
📝
docs/DETAILS.md(+33 -0)📝
docs/MMVQ_IL_TABLE.md(+15 -0)📝
include/strata/core/conversation_buffer.hpp(+19 -4)📝
include/strata/core/conversation_cache.hpp(+17 -0)📝
include/strata/core/conversation_snapshot.hpp(+42 -1)📝
include/strata/core/native_head.hpp(+4 -1)📝
include/strata/core/verify.hpp(+11 -1)📝
include/strata/kernels/native_mmvq.hpp(+3 -0)📝
include/strata/kernels/ngram.hpp(+4 -0)📝
include/strata/kernels/ple.hpp(+4 -0)📝
include/strata/prefill/gemm.hpp(+20 -0)📝
include/strata/prefill/moe_fused.hpp(+15 -0)📝
include/strata/prefill/moe_fused_iq.hpp(+6 -0)📝
metal/src/engine/stubs_0145.cpp(+5 -0)📝
src/core/conversation_copy.hpp(+64 -2)📝
src/core/conversation_snapshot.cpp(+416 -4)📝
src/core/conversation_state.cpp(+319 -15)📝
src/core/native_head.cpp(+29 -0)📝
src/core/verify.cpp(+157 -10)📝
src/kernels/cuda/dequant_bf16.cu(+4 -2)...and 12 more files
📄 Description
Problem and result
sm_80 has no entry in the engine's per-card tables, so on a GA100 card most of the prompt and decode path runs on choices made for other architectures. #3712 has the measurements from a CMP 170HX (GA100, sm_80, 70 SMs, PCIe Gen2 x4) running Qwen3.8-Flash-Next IQ3_S with every expert resident. On our working branch, with these features and the switches turned on, prompts run up to 2.0x the speed of stock 0.2.1.4, decode +20 %, and conversation park/restore 5-10x faster.
This PR puts all of it in front of you in one place, rebased on current main. It is not meant to be merged as it is. Each feature is its own commit (or a few consecutive ones), so you can cherry-pick, or ask us to split it into the five thematic PRs listed in #3712, or into finer ones.
Related discussion
#3712 (scope proposal; no agreement yet). Also #3252 (A100 slowdowns, where sm_80 also falls back to the shared MMVQ-IL table) and #3453 (the sm_89 MMVQ-IL table, which touches the same table list).
Approach
Every switch is opt-in. With all of them unset, the default path is byte-identical to main on every card, with two exceptions on sm_80 only. Both exceptions are bitwise: the output stays identical.
48dc535eSTRATA_DEQUANT_WIDE=0turns it off)eaedca84STRATA_MMVQ_IL_SM80=0restores the shared table)056d36a9STRATA_PF_FUSED_NT=256256-thread fused IQ prompt experts,STRATA_PF_BATCH=Nwhole-layer launches (WideBatch)da818261,0ba47e61STRATA_PLE_COMPACT=1raw IQ4_NL PLE rows dequantized on the device;STRATA_PLE_COPY_STREAM=1their upload on its own stream952dd784STRATA_EMBED_VRAM=1token-embedding table in VRAM (only while 512 MiB stay free)741fc6abSTRATA_DEQUANT_SIDE=1dense dequant on a side stream579cbfbbSTRATA_PF_FUSED_F16=1/STRATA_PF_FUSED_WS=1f16 mma fused experts (rounding-level)f1cabc99STRATA_GDN_TC=1DeltaNet prompt recurrence as a chunked tensor-core scan (rounding-level; sm_80+, 48+ SMs)0d512925STRATA_CKPT_ASYNC=1,STRATA_CKPT_VRAM_SLOTS=Nconversation checkpoints3e0c141c,56088e71STRATA_PARK_ASYNC=1,STRATA_CKPT_POOL=N,STRATA_CKPT_GATHER=1background park, ready checkpoint poolbafca410STRATA_PARK_VRAM_MIB=Nparked K/V in VRAMa04f439968c487c3STRATA_GRAPH_PRIO=1verify-window graph nodes keep their stream priority1f4b8139116992abSTRATA_MMVQ_IL_PF=1hoisted-load, exact-integer MMVQ-IL kernels for Q6_K6d6f0f39Compatibility effects:
STRATA_CKPT_POOL=1now also pre-allocates 2 ready checkpoints (+236 MB of host RSS).GRAPH_PRIOare CUDA only. On HIP, gfx906 and Metal they are off.Validation
Passed:
011c9e60) with configure=0, build=0, 0 errors, and the same warning count as main built the same way:tools/quant_quality.py prompt/pcompare, set v1) of the rounding-level switches against the bitwise base. GDN_TC: mean 0.0157, median 0.0011. F16 / WS: mean 0.0062, median 0.00006. Both on: mean 0.0165. Top-1 agreement is 100 % in every arm. Details: https://github.com/Niko1221/Strata/pull/3779#issuecomment-6362825058.Failed: none observed in builds. During the GPU runs, in 3 of about 35 engine starts the engine stopped answering after a park with evictions, each time on upstream's conversation-cache path (the PR 4 switches off). It did not reproduce in 15 reruns of the same sequences (5 greedy runs, 10 full benchmark runs on the stock build); details are in the results comment.
Not run:
011c9e60and were not repeated after it. Upstream did not change those files.Limits
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.