mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#4770
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/3761
Author: @phg1024
Created: 10/22/2026
Status: 🔄 Open
Base:
main← Head:sycl-mirror-drop-cache📝 Commits (1)
bbdbe45[Engine] sycl: opt-in STRATA_MIRROR_DROP_CACHE=before for the --stream-experts mirror (#3681)📊 Changes
2 files changed (+45 additions, -0 deletions)
View changed files
📝
docs/INTEL.md(+18 -0)📝
sycl/src/core/gguf_expert_source.cpp(+27 -0)📄 Description
Problem and result
With
--stream-experts,GgufExpertSource::mirror()pins the experts that miss VRAM in 2 GiBsycl::malloc_hostchunks. Each chunk is one system-memory BO that thexedriver backs as it likes. The engine's start-up reads (weights, the VRAM expert fill) leave the GGUFs in the page cache, so on a host whose RAM is close to the model's size the chunks are allocated under reclaim. MemFree at that point was 0.7–0.9 GiB on every restart below, while the mirror needs 25.7 GiB.On an Arc Pro B70, chunks allocated that way are read by the GPU at 55–85% of the bandwidth of chunks taken from free memory. CPU reads of the same chunks are unaffected. As a result, decode after a restart depends on what the page cache held. The details and microbenchmarks are in #3681.
STRATA_MIRROR_DROP_CACHE=before: restarts decoded at 42.4–44.5 tok/s; first starts at 44.1–44.5. The mirror fill takes about 1 s longer (14.2–14.4 s against 13.2–13.4 s), because it now reads from NVMe.Related discussion
#3681 (the report, the microbenchmarks and the engine A/B). There is no maintainer reply yet. The change is opt-in and confined to one function, so I am opening it as a focused fix; it is a draft until it gets a look.
Approach
STRATA_MIRROR_DROP_CACHE=beforerunsposix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED)on the source's GGUF descriptors right before the chunks are allocated. The chunks then come from free memory instead of reclaim. It prints one line:mirror: STRATA_MIRROR_DROP_CACHE=before: MemFree X -> Y GiB (the mirror needs Z GiB).#if !defined(_WIN32)). Without the variable, the default path executes no new code.before.docs/INTEL.mdhas a short section with the numbers.Validation
Passed:
Build: SYCL AOT, revision
011c9e6plus this commit (itssycl/tree is byte-identical to the one built; the docs were edited after the build). Configured withcmake -S sycl -B build -DCMAKE_BUILD_TYPE=Release -DSTRATA_SYCL_AOT=bmg-g31 -DSTRATA_NATIVE_EXPERTS=ON -DSTRATA_Q6K_EXPERTS=ON -DSTRATA_SYCL_PARITY=ON, oneAPI 2026.1 (icpx), compute-runtime 26.31.39395.16 / IGC 2.40.16. Result: 0 errors, no warnings ingguf_expert_source.cpp.Hardware: Arc Pro B70 32 GB at PCIe 4.0 x16 (0 AER during the runs), i7-12700K, 61 GiB RAM, Ubuntu 26.04, kernel 7.0.0-38 (
xe).Model and flags: Flash-Next IQ3_S native pack,
--stream-experts --expert-cache auto --vram-reserve-mib 2048 --kv int8 --kv-resident 32768 --max-context 262144 --spec 4 --spec-min-p 0.5 --mtp ... --prefill 8192,STRATA_VERIFY_DEVICE_PLAN=1 STRATA_VERIFY_NO_HOST=1. The mirror holds 13,446 experts (25.71 GiB).A/B, this build: blocks
off, before, before, off. Each block drops the model files' page cache (posix_fadvisefrom a script), then makes 4 consecutive server starts with an unrelated 22 GB file read (cat file > /dev/null) between starts. Each start runs the repo's needle benchmark at 2K and 32K prompts, 512 tokens, temperature 0. Decode in tok/s as 2K / 32K:before, MemFree went from 22.0 to 49.9 GiB at first starts and from 0.7–0.9 to 28.8–28.9 GiB at restarts.Earlier runs:
beforebranch is the same code: 24 starts (off/before/both×2), with everybeforestart at 44.1–44.5 tok/s.Failed: none observed.
Not run:
sycl/src/core/gguf_expert_source.cpp, which only the SYCL engine compiles.#if !defined(_WIN32); the default path there is unchanged but not compiled here.Limits
DMA-FQ) or from the GPU's page-table granularity on small pages.iommu=ptis untested.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.