mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3729] [Engine] SYCL: flag Intel iGPUs as integrated so the expert cache is sized from MemAvailable #4758
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#4758
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/3729
Author: @sashebalchev
Created: 10/22/2026
Status: 🔄 Open
Base:
main← Head:fix/sycl-integrated-gpu📝 Commits (1)
6d38b62[Engine] SYCL: flag Intel iGPUs as integrated so the expert cache is sized from MemAvailable📊 Changes
2 files changed (+14 additions, -0 deletions)
View changed files
📝
sycl/include/dpct/device.hpp(+2 -0)📝
sycl/tools/fixups.py(+12 -0)📄 Description
Problem and result
get_device_info()insycl/include/dpct/device.hppnever callsset_integrated(), soget_integrated()is 0 on every SYCL device. On a shared-memory iGPUdevice_free_bytes()(sycl/src/core/expert_cache.cpp) therefore never takes itsMemAvailablebranch and sizes the expert cache from the tiny free "card" memory.On an Arc B390 (Panther Lake, xe) that gave 82 slots (0.16 GiB) even with an explicit
--expert-cache 12288, all 12,206 other experts mirrored in pinned host memory and read over PCIe. With the one-line fix the same command gets 12,288 slots (23.42 GiB). Same bug as reported for Meteor Lake in #2282 (bug 1, same fix); it was closed in the tracker reset andset_integrated()still has no caller onmain.Related discussion
#2282 (bug 1; this PR is only that part). Also touches the
MemAvailabledependency described in #2412. No default or scope change: it only makes the existing integrated-GPU path reachable on SYCL.Approach
Set the flag from
sycl::aspect::ext_oneapi_is_integrated_gpu, next to the otherprop.set_*calls inget_device_info(). Becausesycl/include/dpct/is dpct output thatmigrate.sh/normalize.shregenerate, the same line is also an idempotent entry insycl/tools/fixups.py(like theutil.hppfix), so it survives the next re-migration. Checked: runningfixups.pyon the unpatched header gives exactly the committed header, and a second run changes nothing.Side effect:
ggml_cuda_host.dp.cpp:58copies the flag intod.integrated, which has no reader in the SYCL build (grep -rn integrated sycl/src sycl/includefinds only the definition, that writer andexpert_cache.cpp:112). The behaviour change is confined todevice_free_bytes(), and per device and on Linux only. Older runtimes without the aspect report 0, i.e. the old behaviour.Validation
Hardware: Framework 13 Pro, Core Ultra X7 358H, Arc B390 (xe), 64 GB shared, Linux 7.3; Coder IQ1_M, engine 0.1.46.3,
--serve --expert-cache 12288 --stream-experts --mtp --max-context 32768 --kv int8, started throughsycl/serve/strata-sycl.sh. Only the rebuilt binary differs between the two runs (log:strata-coder-iq1_m.log, 2026-10-21 10:27 vs 10:33).Passed:
Build in the
strata-sycl-devcontainer:bash sycl/tools/build.sh strata, 75/75 targets, 0 errors (revision with the header edit). After adding thefixups.pyentry and dropping a redundant? 1 : 0:icpx -fsycl -std=c++20 -fsyntax-onlyon a TU includingdpct/dpct.hppand callingget_device_info(), RC=0; the full engine was not rebuilt at this revision.Same start command and flags before and after; only the rebuilt binary differs. Engine log of both starts (same day, 10:27 and 10:33):
expert cache 82 slots, 0.16 GiB of VRAM,12206 of 12206 experts missing from VRAM ... mirrored in pinned host memory.expert cache 12288 slots, 23.42 GiB of VRAM, profile fill 6.0 s,token graph hit path: 12288 resident experts. MinMemAvailableduring start 24.2 GiB, no xe errors.Every request I made, individually (chat completion "Write a Python function is_prime(n). Only the code.", thinking off, max 200 tokens, fresh server, no warm-up):
Compare cold with cold (rows 1 and 2). I have no second "before" request.
A coding agent session of about 8,000 prompt tokens then ran normally against the patched build (17.5 and 22.4 tok/s on its two requests).
Failed: none observed.
Not run:
sycl/only).tools/ab_engine.py/strata_bench.py --comparefor before/after. I have one cold request on the unpatched build and two on the patched one, so the tok/s figures are indicative and no speedup is claimed for other machines. The slot count is the actual finding. I can add anab_engine.pyrun if a maintainer wants it.Limits
expert_cache.cpp:666already notes that an Arc A750 caps one allocation at 4 GiB unlessUR_L0_ENABLE_RELAXED_ALLOCATION_LIMITS=1. My B390 did not hit it. Bug 3 (STRATA_WINDOW_SYNCon xe) is also not included.MemAvailablelessSTRATA_UMA_HEADROOM_GIB(default 6). Here--expert-cache 12288took 23.42 GiB against a minimumMemAvailableof 24.2 GiB during start, so the rest of the run used about 0.8 GiB of that headroom. The TTM page pool described in #2412 can lowerMemAvailablebefore a start.Engine log, both starts (paths shortened)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.