mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2205] sycl: with --expert-parallel-device, card N computes its own experts of each prompt chunk #3922
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#3922
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/2205
Author: @recutita
Created: 10/13/2026
Status: 🔄 Open
Base:
main← Head:sycl-ep-prefill-main📝 Commits (4)
a568dfbsycl: --expert-parallel-device N, two Arc cards compute each layer's experts together67aa411serve: a config with --expert-parallel-device and several GPUs gets no --layer-split68c5ad5sycl: expert parallel: system-scope barriers before the exchange flags4805fa9sycl: with --expert-parallel-device, card N computes its own experts of each prompt chunk📊 Changes
14 files changed (+1055 additions, -36 deletions)
View changed files
📝
docs/INTEL.md(+36 -0)📝
include/strata/prefill/prefill.hpp(+3 -0)📝
serve/server.py(+6 -2)📝
serve/test_server.py(+5 -0)📝
sycl/CMakeLists.txt(+2 -1)➕
sycl/include/strata/core/ep_mem.hpp(+62 -0)📝
sycl/include/strata/core/verify.hpp(+52 -0)➕
sycl/include/strata/kernels/ep_kernels.hpp(+45 -0)📝
sycl/src/core/verify.cpp(+216 -5)➕
sycl/src/kernels/cuda/ep_kernels.dp.cpp(+108 -0)📝
sycl/src/kernels/cuda/verify_kernels.dp.cpp(+42 -10)➕
sycl/src/kernels/resident_plan_ep_parity.cpp(+143 -0)📝
sycl/src/prefill/prefill.cpp(+134 -15)📝
sycl/src/program/generate.cpp(+201 -3)📄 Description
Title
Issue: none.
Summary
With
--expert-parallel-device N(#1798), card N now computes its own experts of each prompt chunk. Until now the prompt path ran every expert on card 0 and read card N's experts from the GGUF for every chunk, so a prompt's speed hung on the file cache holding them (a 7200 rpm disk read an 807-token prompt at 12.3 tok/s, reported in #1798). It is on whenever--expert-parallel-deviceis set;STRATA_EP_PREFILL=0turns it off and keeps the GGUF reads. Without--expert-parallel-devicenothing changes.Built on #1798: this branch holds its two commits and this one (c7bb8dd5); only the last is this PR.
Measured
2x Arc Pro B70 (32 GB each, xe, Linux), Flash-Next IQ3_XXS, Ryzen 9 9950X3D, 60 GB RAM, NVMe, through the server (
sycl/serve/server_intel.py, 131,072 context, INT8 KV with--kv-resident 32768,--vram-reserve-mib 2048,--prefill 4096), greedy, thinking off. Each value is the median of three fresh documents (256 tokens generated each), two runs per arm, the arms alternated. Hot: one document read first, so the GGUF pages are in the page cache (28-32 GiB of the two files before each document of the old path). Cold: the files' page cache dropped (posix_fadviseDONTNEED, 0 GiB left) before each document.STRATA_EP_PREFILL=0Decode after the prompts (99-107 tok/s) and short chats (75.7-76.2 tok/s) are the same in both arms.
Where the time goes (
STRATA_PREFILL_TIMING=1, one chunk, hot), 2,427 tokens: card 0's expert phases (dequantize, gate/up, down) take 517 ms instead of 1,252 and card N computes its share in 430 ms meanwhile; the combine, which now waits for card N and copies its rows, grows from 56 to 413 ms; the GPU timeline goes from 2,547 to 2,147 ms and the host's GGUF staging from 2,190 ms to none. 612 tokens: card 0's expert phases 924 -> 367 ms, card N 244 ms, combine 15 -> 105 ms, timeline 1,452 -> 955 ms. With the page cache dropped the old path's timeline is 4,311 ms (2,427 tokens) and 2,888 ms (612); this PR's does not change.What changed
sycl/src/prefill/prefill.cpp,include/strata/prefill/prefill.hpp:Prefill::set_ep_peer. It reuses the--peer-deviceprompt share (PeerPrefill) with card N'sExpertCacheas the source of its experts. Per MoE layer, card 0 writes the chunk's FP16 activations into a region on card N; card N gathers its rows and runs card 0's FP16 expert path on them (dequantize, oneMKL gate/up, SwiGLU, oneMKL down; this build has no MMQ, which the--peer-deviceshare uses), writing the rows into a second region; card 0 waits for card N on the host and copies the rows into its combine input past its caches. Both regions are card N's memory opened on card 0 through Level Zero IPC (ep_mem.hpp, as the decode windows' inbox), since dpct gives each card its own context.sycl/src/program/generate.cpp: the call in--serve, unlessSTRATA_EP_PREFILL=0. If card N's buffers do not fit (420 MiB of regions at--prefill 4096, plus the FP16 path's buffers) the log says so and the GGUF reads stay.docs/INTEL.md: the prompt path line of the expert-parallel section.How it was checked
STRATA_EP_PREFILL=0, two starts of each: all four outputs byte-identical across the four starts.STRATA_EP_PREFILL=0logged no expert-parallel prompt line; the other loggedcard 1 computes its experts' rows of each prompt chunk (420 MiB of exchange regions).bmg-g31),strata.Extra Notes
sycl/serve/strata-sycl.shpasses no variable whose value is0to the engine, so"STRATA_EP_PREFILL": "0"in a config's"env"does not reach it through that launcher (the measurements above used"00", which the engine reads as 0). This is the launcher's rule for every switch and is left alone here.Assisted-by: Claude Code with Opus 5.5 medium
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.