mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2014] SYCL resident RAM mode: resident_stage_swaps stages the exchange without copying the evicted expert back #802
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#802
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?
Originally created by @kuhlsnu on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2014
The SYCL port of
resident_stage_swapshas no device-to-host copy where the CUDA version has one. I found this reading the code while porting an exchange check; I have no Intel GPU, so nothing here ran.CUDA,
src/program/generate.cpp:292-299(7695859a):SYCL,
sycl/src/program/generate.cpp(resident_stage_swapsat :318), same spot:The migration comment is there but the memcpy itself is not, and the swap is still staged (
staged.push_back, thenstage_exchange). If this path runs, the RAM copy would take whatever is already in exchange bufferqas the evicted expert, so a later request routed to it on the CPU reads wrong weights, with no error.What I could not check:
If it is reachable, this could be related to the silent wrong answers in #1484, though that one points at the expert kernels. A quick check: run resident RAM mode with adaptive swaps on SYCL and compare a swapped expert's RAM bytes with the model file.
@Niko1221 commented on GitHub (Oct 12, 2026):
Thank you, this was a real bug and your reading is exactly right. In the SYCL port of resident_stage_swaps the dpct migration had dropped both the device-to-host copy (cudaMemcpyAsync into the exchange buffer) and the stream synchronisation that follows it, but stage_exchange still ran. So with the resident RAM mode (--resident-experts, whose adaptive tier is the blocking one by default) the RAM copy took whatever the exchange buffer held as the evicted expert: that expert was lost and a later CPU read of it used the wrong weights, with no error. It is reachable on any SYCL build with a host mirror (an Arc B70/A750 without STRATA_VERIFY_NO_HOST).
The fix puts the copy and the wait back, as in the CUDA version. I also added a test aid, STRATA_CHECK_SWAPS=1, which compares each staged exchange buffer with the model file and, at the end of a CLI run, every RAM-copy blob with the file. On an Arc Pro B70 (IQ3_S, 300 tokens, adaptive swaps every round): the build without the copy-back had every staged buffer differ from the file (1,854 of 1,854) and 2,012 RAM blobs differing at the end; with the fix, 0 of 2,226 and 0 differ. On an A750 (IQ3_XXS, 1,500 tokens, 495 rounds, 3,841 swaps): 0 differ. The fix lands in 0.1.43.1 (out now). (It is not the cause of #1484: that one is in the expert kernels.)