mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #598] [CLOSED] refill: improve multi-GPU processing speed ~27% PP improvement on 4× RTX 3060 #2714
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#2714
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/598
Author: @hash13
Created: 10/3/2026
Status: ❌ Closed
Base:
main← Head:prefill-parallel📝 Commits (1)
34db6adrefill: improve multi-GPU processing📊 Changes
2 files changed (+60 additions, -14 deletions)
View changed files
📝
include/strata/prefill/prefill.hpp(+11 -0)📝
src/prefill/prefill.cpp(+49 -14)📄 Description
Prefill: allow deeper overlap across multi-GPU pipeline stages
Problem
In the current multi-GPU prefill path, every stage launches the next stage asynchronously, but still waits for that stage to finish before returning.
With more than two GPUs this creates a recursive wait chain:
As a result, intermediate stages cannot accept the next prompt chunk while later GPUs are still processing the previous one.
On a 4-GPU setup this can lead to visibly staggered GPU utilization during prompt processing instead of a fully filled pipeline.
Change
This PR changes the lifetime of the per-stage asynchronous hand-off.
Intermediate stages now return after handing their chunk to the direct successor instead of draining the complete remaining GPU chain.
The pipeline is drained only once, when the outer/root
Prefill::run()has submitted all prompt chunks.Conceptually, the current behavior is closer to:
The intended behavior after this change is:
This does not introduce tensor parallelism and does not change the CUDA kernels or model computation.
It only increases overlap between existing layer-split prefill stages.
Implementation
The change:
std::futurefrom localPrefill::run()state to thePrefillinstancePrefillinstanceExpected effect
The main benefit should be visible on configurations with 3 or more GPUs and prompts large enough to contain several prefill chunks.
For example, with four GPUs and a 2K prefill chunk size, a 32K prompt provides enough chunks to keep all stages active concurrently after pipeline warm-up.
Short prompts or a single prefill chunk should see little or no improvement.
Decode/token-generation performance is not expected to change.
Motivation / observed behavior
On a 4× RTX 3060 system, prompt processing currently shows GPU activity progressing largely stage by stage, while decode performance is normal.
This suggests that part of the low prefill throughput may come from the recursive synchronization between layer-split stages rather than raw GPU compute.
This PR is intended as a small, isolated change to test that hypothesis without changing expert streaming, tensor parallelism, CUDA kernels, or the model architecture.
The most useful validation is whether multiple GPUs stay active concurrently during long prompt prefill and whether prompt throughput improves without affecting model output or decode performance.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.