mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5096] [CLOSED] [Engine] Order empty DMA notifications behind pending uploads #5307
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#5307
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/5096
Author: @AlanJager
Created: 11/3/2026
Status: ❌ Closed
Base:
main← Head:fix/dma-empty-completion-order-5093📝 Commits (1)
47068bdEngine: order empty DMA completion notifications behind uploads📊 Changes
1 file changed (+18 additions, -1 deletions)
View changed files
📝
src/core/verify.cpp(+18 -1)📄 Description
Problem and result
In CUDA DMA split windows, a later group with zero PCIe experts can directly raise cumulative
flagBpast an earlier group's in-flight upload. The earlier GPU consumer'sflagB >= ringwait then passes before its staging weights are ready. This patch queues that empty-group notification on the copy stream after DMA has been used, preserving upload/completion order.Fixes https://github.com/Niko1221/Strata/issues/5093. That issue contains source-linked timing diagrams, a standalone ordering litmus, real-weight provenance checks, and the captured-input replay evidence. Its scope is this explicit DMA mechanism, not every symptom in #879.
Change and cost
Only
Verifier::fetch_dma()changes. The pre-DMA direct-notification fast path stays; after DMA has been used, empty notifications use the existingFlagSetstorage andcopy_stream. Callback submission failure ends the run rather than publishing a false completion. No additional expert buffer or worker thread is introduced, and expert arithmetic kernels are unchanged.The cost is an additional queued host callback for empty groups after DMA, and notification latency behind earlier uploads.
copy_used_is conservative: it records use since the last drain/reset, not necessarily a currently pending copy.Validation actually performed
Tested base:
ffa80d73133ea5c548aefe57889a16e8085a938f(engine0.1.56), still upstream main when preparing this PR. RTX3090 24GiB/sm_86, CUDA12.8, driver580.126.09, Linux5.15/KVM, 64GiB RAM, 32 vCPU Xeon Platinum8260; Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS native pack. LOOKAHEAD=0, official rotation=1, tail skip=0, DMA/PCIe fraction1, lookupT12/MTP4, workers7, prefill2048, context32768/int8KV, official16 staging slots. Shared actual cache12756 slots/17501MiB, arena17490MiB. CPU fallback was not asserted to be zero.The
verify.cppin this PR is byte-identical to the earlier GPU-tested candidate, SHA256e7855cf96947eaf45134ad37a180a97b6f15e12bea74525e78b3596cb6c0e2ec. Release comparison replaced onlyverify.cpp.o; original GPU/other libraries retained their hashes. The PR adds no diagnostic instrumentation.Additional passed checks:
ctest --test-dir "$BUILD" -R '^(exchange_storage_test|file_expert_source_test|nv_defaults_test)$' --output-on-failure, 3/3 passed in the CUDA build.git diff --checkpassed. Original service, source/files and GPU selector state restored after the GPU experiments; no new kernel-log entries during the final diagnostic round.Observed failures and performance limits:
OverflowError; it remains a model-output quality failure, with no trace establishing this race as its cause. No general quality improvement is claimed.Draft: verification still needed
fetch_dma()automatically. The runnable standalone protocol litmus and real-model reproductions are in #5093; a maintainable in-tree regression test remains to be agreed.--pcie-mode dma; they do not establish a defect or a speed change in the kernel-copy mode.AI-assisted investigation and patch preparation; all reported measurements were checked against retained experiment artifacts.
Prepared with GPT-6 via Codex.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.