mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4715] [Engine] layer-major prefill: expand the hyper-connection projections on the path's stream #5146
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#5146
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/4715
Author: @cedrik-fuoco
Created: 10/30/2026
Status: 🔄 Open
Base:
main← Head:fix/layer-major-hc-req8📝 Commits (2)
bd14107[Engine] layer-major prefill: expand the hyper-connection projections on the path's streamd5a0d82[Engine] test that hc_q8_to_bf16 expands on the stream it is given📊 Changes
3 files changed (+119 additions, -3 deletions)
View changed files
📝
CMakeLists.txt(+6 -0)📝
src/prefill/prefill.cpp(+5 -3)➕
tests/cuda/hc_q8_stream_test.cu(+108 -0)📄 Description
Problem and result:
I found that with
STRATA_PREFILL_LAYER_MAJOR=1andSTRATA_HC_REQ8=1the layer-major prompt path loses the prompt. My probe is a needle copy: a six-character code sits near the start of the prompt and the question at the end, and the code stops coming back at every length I tried, 1,567, 4,045, 12,037 and 100,003 tokens. It happens on the Q2_0 pack and on IQ3_XXS, with the needle at the start, middle or end, and withSTRATA_PREFILL_MMQ=0. WithHC_REQ8off the same prompts answer exactly, and after this change they answer exactly with it on.Related discussion: #3976, where this path was proposed and measured. I do not think anything in that thread contradicts this finding. Its quality evidence was measured without
STRATA_HC_REQ8, which is the switch this needs, andSTRATA_HC_REQ8refuses a layer split, so the multi-stage path where the walk is on by default cannot reach the defect today.Approach
The three hyper-connection
bf16_projcalls inrun_layer_majorwere not passing the optionalstreamargument. UnderHC_REQ8those projections are stored as int8 andbf16_projexpands them into a static scratch buffer on whichever stream it is given. With the argument missing that is the default stream, and the GEMM that reads the buffer runs on the prompt path's own stream.run_implpassesm.csat the equivalent call sites. My change passes the same stream at the down, up and inject calls and touches nothing else.The second commit adds a regression check for the property that broke, because
bf16_projis file-static and no test can reach it. I did not carry two other arguments that this path also misses,ldxforSTRATA_PF_HCDOWNandSTRATA_HCD_EXACT, andxf16for them.xn_f16image. Neither is set in my configuration and I am not claiming either one fixed here.Validation
Everything below was run at
bd14107andd5a0d82on an RTX 3070 Ti with 8 GiB and compute capability 8.6, one GPU and no layer split. The machine is a Ryzen 9 9900X with 61.6 GiB of DDR5-6000 on Windows 11. The engine is 0.1.53 from the 0.2.7.1 tree plus this change, built with CUDA 12.6 and MSVC 18.4 at-DCMAKE_CUDA_ARCHITECTURES=86. The model is Qwen3.8-Flash-Next GSQ-RCO on the Q2_0 pack, with--expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp --max-context 131072 --kv int8 --kv-resident 16384 --vram-reserve-mib 1400,STRATA_HC_REQ8=1, and the config's ownSTRATA_*set.rc=0ctest -R hc_q8_streamPrefill with the walk on and off
Same build and same prompts, only
STRATA_PREFILL_LAYER_MAJORflipped, with--expert-cache 600pinned on every arm so the expert cache is not part of the comparison.Two runs per arm, needle at 50 % depth, and all twelve runs recalled the needle exactly.
The two runs of each arm agree within 4 % and every arm ran at the same 600 slots, so these numbers show the switch rather than the state of the machine. They are about the switch and not about this fix anyway. The fix only changes which stream a matrix is expanded on, so it adds no work. With three lengths I am not going to claim a trend, but all three came out between +45 % and +61 %, which is a good deal more than the earlier runs with an auto-sized cache suggested.
Limits: verified only on the single-GPU configuration above. The timings above measure the switch's effect on this configuration, not the fix.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.