mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1101] [CLOSED] prefill: let Stager threads sleep instead of yield-spinning (Linux + --mmap-experts: prompts ~10x faster on DGX Spark, ~1 core instead of ~20) #3025
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#3025
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/1101
Author: @uncle-daddy-jp
Created: 10/6/2026
Status: ❌ Closed
Base:
main← Head:prefill-stager-sleep-2📝 Commits (1)
501ba3fprefill: let Stager threads sleep instead of yield-spinning📊 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. Re-opened on the new
mainafter today's history cleanup (replaces #1057, which GitHub closed when main was force-pushed).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). The commit cherry-picks cleanly onto the new main.
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.