mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #239] [CLOSED] verify: stage the mode-2 PCIe share on the copy stream inside the captured window #2522
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#2522
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/239
Author: @hireymage
Created: 9/30/2026
Status: ❌ Closed
Base:
main← Head:perf/verify-copy-stream📝 Commits (1)
fec7133verify: stage the mode-2 PCIe share on the copy stream inside the captured window📊 Changes
4 files changed (+79 additions, -5 deletions)
View changed files
📝
include/strata/core/verify.hpp(+11 -0)📝
include/strata/kernels/verify_kernels.hpp(+4 -0)📝
src/core/verify.cpp(+47 -5)📝
src/kernels/cuda/verify_kernels.cu(+17 -0)📄 Description
What
Mode 2 (
--pcie-mode kernel) staged a layer's PCIe-blob share withfetch_blobs+rebase_ptrsrunning on the decode stream, inside the captured verify window. The window therefore spent a stage in awaitBspin until that ~1.3 MB staging copy had landed - 31-39 ms per window on the profiled stage line before this change.This moves the staging copy to the copy stream (
copy_) so it runs beside the layers' own work, as captured graph nodes, with the rendezvous carried by device flags in the verifier's arena instead of host events.The three capture traps (all hit, all handled)
The window is a captured CUDA graph, so copy-stream work has to become graph nodes:
copy_joins through an event record/wait (joint_ev_), which becomes a graph edge and replays with the graph.EndCapturerefuses a graph whose secondary stream has no path back to the capturing stream's end (capturing stream has unjoined work), soend_copy_sharecloses the loop with a second edge (joint_bwd_).pipe_flags_, 8 words: plan(2) | staged(2) | pcie done(2) | window start), cleared by a kernel at the start of every window and raised by kernels; the ordering hazards the flags cover are the plan's device copy (plan) and the staging slot's reader - the previous layer's grouped kernel (pcie done).Safety
else if (pcie_mode == 2)branch is gone.wait_flag_ge_oron a nullskip_(device plan off) is guarded; the pre-existing decode-side waits (flag B, stage done) stay.cudaStreamSynchronize(copy_)covers the graph's copy-stream tail), so nothing leaks across windows.Measured (RTX 2070 + i7-8700K AVX-2, qwen3.8-flash-next 125B-MoE Q2_0, T up to 6)
waitCPUof 16-21 ms is the bottleneck here, not the PCIe staging).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.