mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3827] [CLOSED] [Engine] q36: parallelise the expert copy at load #4795
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#4795
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/3827
Author: @ggeorgovassilis
Created: 10/23/2026
Status: ❌ Closed
Base:
main← Head:parallel-expert-copy📝 Commits (1)
85bad71q36: parallelise the expert copy at load (STRATA_Q36_PARALLEL_PLACE)📊 Changes
1 file changed (+32 additions, -1 deletions)
View changed files
📝
src/qwen35/q36_engine.cu(+32 -1)📄 Description
Problem and result
Loading a routed-expert model copies each expert into the host arena one at a time on a single thread. On
main(5c8dd322), placing the 18.75 GiB of routed experts forQwen3.6-35B-A3B-UD-Q4_K_XL.gguftook 18.7 s (median, serial). Splitting the copy across threads cuts it to 13.5 s (median), ~1.3x, with byte-identical output.Related discussion
Re-submission of #2889 (closed during the 0.2.0-beta tracker reset; the original head branch was force-pushed during the rebase, so GitHub will not reopen that PR number).
Approach
place_experts()chunks the expert copy acrossSTRATA_Q36_PARALLEL_PLACEthreads:0is the serial path,Nuses N threads, and unset uses one thread per logical core (capped at 128). Each thread copies a disjoint expert range, so the bytes written are identical to the serial path by construction. Only the load-time host-side copy changes; no kernels or memory layout change.Validation
Passed:
main(5c8dd322) and builtstrata+strata-q36with CUDA 13.0 / nvcc, sm_89 (RTX 4060 Laptop 8 GB, 62 GB RAM, Linux): clean build, no errors.strata-q36 --model Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf --max-context 2048 --tokens 1,2,3 --n 24withSTRATA_Q36_PARALLEL_PLACE=0vs unset: 24 greedy tokens identical.tools/test_setup_*.py: 46/48 pass.Failed:
tools/test_setup_download.py(parallel-download race) andtools/test_setup_golden.py(stale golden snapshots): both pre-existing and unrelated to this change.Not run:
serve/test_*.pyandtests/terminal.Limits
The added code is pure C++ (
std::thread) and only parallelises the host-side expert copy at load; generation is unaffected. The speedup is smaller than the original measurement on the old baseline because upstream has since optimised the load path.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.