mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1057] [CLOSED] prefill: let Stager threads sleep instead of yield-spinning (Linux + --mmap-experts: prompts ~10x faster on DGX Spark, ~1 core instead of ~20) #2998
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#2998
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/1057
Author: @uncle-daddy-jp
Created: 10/6/2026
Status: ❌ Closed
Base:
main← Head:prefill-stager-sleep📝 Commits (10+)
f4e96d5tests: gdn_rec_head also compares the PP (variant 4) and two-column (variant 5) recurrence kernels, bitwise16bc95aprefill: STRATA_HCD_EXACT=1 - the HC down projection by a WMMA kernel with hipBLASLt solution 1176/1177 k order (StaggerU included), bitwise502fcef#606: the fused SwiGLU q8_1 quantizers keep the block's scale and sum finite too64d0136cache: preserve checkpoints when split allocation failsa0d0056prefill: fused-expert exact wins (table16 via direct selector, float4 moe_combine, LDS alias + occupancy)5f5452bserve: park_current's try covers the checkpoint split too (#752): a host OOM skips parking8b19a38Layer split: --vram-reserve-later-mib, a separate reserve for the later cardsea83d0dResident RAM mode with a layer splitd2d981fsetup: the low-RAM mode's resident variant on several GPUs (#642)cd62e5eserve: a split's stage-0 GPU profile line keeps its text (#848); later stages say which stage📊 Changes
2 files changed (+7 additions, -2 deletions)
View changed files
📝
include/strata/hip_compat/cuda_runtime.h(+1 -0)📝
src/prefill/prefill.cpp(+6 -2)📄 Description
Fixes #1056.
Fixes the prefill slowdown and CPU burn described in the linked issue: the
Stagerthreads waited by spinning (ayieldloop onissued, andcudaEventSynchronizeon events created withoutcudaEventBlockingSync, which spins under the default scheduler). With--mmap-expertsthere are 32 of them; on Linux they inherit the host thread's single-core pin and starve it (prompts read ~10x slower on a DGX Spark), and unpinned they take every core for the whole prompt.This change makes both waits sleep:
std::atomic::wait, withnotify_allinissued_one()andfinish();dma_doneevents are created withcudaEventDisableTiming | cudaEventBlockingSync;cudaEventBlockingSync -> hipEventBlockingSync(not tested on HIP).No affinity changes. Measured on a DGX Spark (GB10, CUDA 13.0, Ubuntu 24.04) with IQ3_S, all experts in the GPU cache, prompts of 7,031 / 26,383 tokens:
44df8fd/ same code as main)Output tokens are unchanged (greedy, same prompts).
git apply --checkpasses on main (1735d64) and on PR #409's branch.Measured with the help of Claude (Anthropic).
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.