mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4712] [Engine] SYCL: Intel Arc on Windows, and an integrated Arc B390 (shared memory, oneAPI build, served) #5143
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#5143
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/4712
Author: @yangweijie
Created: 10/30/2026
Status: 🔄 Open
Base:
main← Head:pr-arc-b390📝 Commits (7)
6435673[Engine] SYCL: Intel Arc on Windows, and an integrated Arc B390 sized from its shared-memory budget6139053[Other] The Terminal on Windows with an Intel card: the card is seen, and the plan says build rather than download649b856[Other] setup's Intel route on Windows: pin Level Zero only where it answers, and say what to do where it does not0d00df4[Engine] SYCL: an integrated Arc is sized against the RAM the computer can give, and waits for the CPU as an A-series does44e7e88[Other] doctor: an Intel run on Windows that cannot reach oneAPI says so, in the words that fix itc745d7c[Docs] INTEL_ARC: the Windows build has to run in the setvars window, and doctor says when oneAPI is unreachablee985fe0[Other] The launcher folds a built-in chip that the registry names several times into one card📊 Changes
24 files changed (+744 additions, -89 deletions)
View changed files
📝
docs/DOCKER.md(+1 -1)📝
docs/INTEL_ARC.md(+87 -12)📝
include/strata/platform/memory.hpp(+13 -0)📝
packaging/README.md(+1 -1)📝
setup.py(+4 -6)📝
src/platform/memory.cpp(+96 -0)📝
strata_cli/launch/catalog.py(+47 -3)📝
strata_cli/launch/runner.py(+25 -1)📝
strata_control/doctor.py(+19 -0)📝
strata_control/engine_component.py(+19 -0)📝
strata_control/targets.py(+9 -0)📝
sycl/CMakeLists.txt(+8 -0)📝
sycl/include/strata/core/gguf_expert_source.hpp(+4 -2)📝
sycl/include/strata/sycl_doorbell.hpp(+10 -1)📝
sycl/setup_intel.py(+94 -14)📝
sycl/src/core/expert_cache.cpp(+67 -10)📝
sycl/src/core/gguf_expert_source.cpp(+81 -13)📝
sycl/src/core/pinned.dp.cpp(+6 -7)📝
sycl/src/kernels/cuda/verify_kernels.dp.cpp(+2 -2)📝
sycl/src/prefill/prefill.cpp(+7 -0)...and 4 more files
📄 Description
The problem and the result
Strata had no Intel Arc path on Windows:
setup --backend syclstopped with "the Intel Arc engine has no Windowssetup yet", the SYCL build was only ever invoked with
icpx, the cache sizing's unified-memory rule sat behind#if defined(__linux__)on a flag the SYCL port never sets, and the Terminal saw no graphics card at all on a PCwhose only GPU is Intel. An integrated Arc - the B390 of a Panther Lake PC, issue #515 - had nothing: it has no
memory of its own, so everything (experts, KV, draft layer) competes for the same RAM as the desktop.
The engine now builds and serves on Windows, and this PC's Arc B390 answers requests through Strata's
OpenAI-compatible API.
Base
main, headyangweijie:pr-arc-b390(branchpr-arc-b390, 7 commits, 24 files, +744/-89):[Engine] SYCL: Intel Arc on Windows, and an integrated Arc B390 sized from its shared-memory budget[Other] The Terminal on Windows with an Intel card: the card is seen, and the plan says build rather than download[Other] setup's Intel route on Windows: pin Level Zero only where it answers[Engine] SYCL: an integrated Arc is sized against the RAM the computer can give, and waits for the CPU as an A-series does[Other] doctor: an Intel run on Windows that cannot reach oneAPI says so, in the words that fix it[Docs] INTEL_ARC: the Windows build has to run in the setvars window, and doctor says when oneAPI is unreachable[Other] The launcher folds a built-in chip that the registry names several times into one cardThe approach
Building on Windows.
sycl/CMakeLists.txtlinks the MKL SYCL/ILP64/core import libraries, which-qmkladds byitself on Linux and not at all on Windows. The rest are the places where the port assumed a POSIX platform: the
streamed GGUF expert source reads its shards through a read mapping (there is no
pread, and an OVERLAPPED read on ahandle shared between threads answered 0 bytes while another read was in flight);
prefill.cppgets_mkdir;generate.cppamemmemreplacement;verify_kernels.dp.cpprenames a template parameterOUTandgenerate.cppthe ring-budget locals
small, both of which the Windows SDK defines as macros.Knowing the card.
strata::platform::gpu_shared_memory_budget_intelasks Windows (IDXGIAdapter3) for an Inteladapter's memory budget and whether it runs in system RAM. The SYCL runtime names no adapter by LUID, so it is matched
by PCI device id and, when that answers nothing (the OpenCL device answers with the CPU's id), as the Intel adapter
with the largest pool. Measured on a B390, driver 32.0.101.9150: 0.12 GiB dedicated, 26.67 GiB in the LOCAL segment
and none in NON_LOCAL - the driver puts an iGPU's usable pool in the local segment, so the pool is the larger of the
two segments, not the non-local one. An adapter with under 1 GiB of its own is one that shares the machine's memory.
Sizing the cache.
device_free_bytes()raises the driver's figure to that budget minusSTRATA_UMA_HEADROOM_GIB(the setting the Linux unified-memory rule already used) and then caps it by what the OS can actually hand out
(
available_physical_memory: ullAvailPhys on Windows, MemAvailable on Linux), because the budget is a per-processpermission while the model, the KV, the draft layer and the desktop all live in the same RAM. The Windows
pinned-arena limit (#243) uses the same query instead of CUDA device properties.
Waiting for the CPU. An integrated Arc computes the experts that do not fit the cache on the CPU, exactly like an
Arc A-series on i915, so its window waits must complete rather than expire; with the B-series bound of 20,000 reads
the GPU went on with the experts' outputs missing - the crash
sycl_doorbell.hppalready documents for the A750. Theshared-memory sizing sets the long bound before any launch.
STRATA_SPIN_MAXstill overrides; a card with its ownmemory is untouched.
The route the person is shown.
sycl/setup_intel.pyreads the Intel adapter from Windows' device list (there is no/sys/class/drm), usesbuild-win\strata.exe, and writes a native config:lib_dirsfor the oneAPI runtime DLLs and,when Level Zero answers for that process,
ONEAPI_DEVICE_SELECTOR=level_zero:gpu+ZES_ENABLE_SYSMAN=1. WhereLevel Zero is not reachable nothing is pinned (a forced selector with no Level Zero device leaves the engine with no
graphics device at all) and setup says to run Strata where
setvars.bathas run.strata launch --planon such a PCsays "no Intel engine to download: build it with Intel oneAPI and run
setup --backend sycl" instead of promising adownload;
targets.pykeeps the package matrix Linux-only because no Intel package exists for any system.Validation
All on the machine this change targets: Intel Arc B390 iGPU (
8086:b082), Core Ultra X7 358H, 31.5 GB RAM, Windows,driver 32.0.101.9150, oneAPI 2026.1.1, engine 0.1.54 built from source with
icx, Qwen3.8-Flash-Next IQ1_M,--spec 6, 8K context.Passed
cmake -S sycl -B build-win(icx, Ninja) +ninja strata: 0 errors.separated." -> red, blue, green. 48 tokens in 45.8 s and 57 tokens in 30.1 s; cache 2,861 of 12,288 experts,
hit rate 58-67%.
32 greedy tokens at 10.5 tok/s, 14 of 14 drafts accepted, first token after 15.7 s, exit 0.
session refused; after, 15.05 GiB and 6,075 slots.
with 318 MiB of RAM left on the computer and died
0xC0000005; with the 20,000-read bound the served request diedthe same way at 5.95 GiB of cache (twice). Both fixes together serve correctly.
src/platform/memory.cpp(shared with the CUDA and HIP builds) compiles with MSVCcl.sycl/setup_intel.py's ownto_sycl()was run on this PC (in awindow where
setvars.bathas run, so itslevel_zero_answers()answers True). It saw the card('Intel Arc B390', 31.5 GB, integrated=True)and wrotebackend: sycl,exe: build-win\strata.exe, the threeoneAPI
lib_dirs,env: {ONEAPI_DEVICE_SELECTOR: level_zero:gpu, ZES_ENABLE_SYSMAN: 1}and absolute model paths.Serving exactly that config answered "Reply with the number only: what is 128 + 256?" with content
384(49 tokens in 27.0 s).
strata serve --engine strata --config <that sycl config> --planplans it(
ok: true, engine and files resolved);strata launch --plan --model-path <the IQ1_M files already on disk> --data-dir <Strata-data>recognises them ("These files are coder IQ1_M"), says nothing to download and prints theIntel build instruction instead of a download promise. Both changed nothing.
strata doctor --profile <a config with "backend": "sycl">on this PC, both sides: from a plain shell it reportsONEAPI_NOT_REACHABLEwith the setvars fix; from a shell wheresetvars.bathas run,sycl-lsanswers oneLevel Zero GPU and the same report is quiet.
python tools/test_setup_sycl.py27 (5 new Windows cases),pytest tests/terminal/test_archive_gaps.py12passed, 1 skipped (2 new doctor cases),
pytest tests/terminal/test_sycl_package.py test_flow2_022.py test_tui2_023_plan.py test_linux_aarch64.py test_engine_component.py test_launch.py tests/sycl131 passed, 1skipped, 1 failed (that failure is pre-existing, see below).
tests/terminal, this branch andmainrun on the same PC at the same time: branch 13 failed, 1,714passed, 90 skipped;
main13 failed, 1,708 passed, 90 skipped. Twelve names are identical on both -test_dsv41_own_files_and_mmproj(3),test_install_scripts_env,test_launch,test_lifecycle_matrix(2),test_monitor_bundle(2),test_tui3,test_tuiqa_browser,test_bundle_imports- and none of them is Intel orSYCL code; several need
textual, which is not installed here. The two that differ are timing flakes under theload of two suites plus engine runs, not regressions:
test_bench_standard.py::...never_finishes_times_outfailedonce on the branch inside that run and then passed 8/8 in isolation on the branch and 4/4 on
main;test_no_acquisition.py::test_update_still_installsfailed once inmain's run and passed 2/2 on the branch.The branch's own run also had two full engine sessions competing for the same 31.5 GB of RAM.
Failed - nothing of this change failed. Each failure named above is a pre-fix failure, kept deliberately as the
evidence that the two rules are load-bearing.
Not run
src/platform/memory.cppandits header, both additions; no existing function changed, and
clcompiles them.strata-sycl.sh: no Linux machine. The Linux branch ofdevice_free_bytes()isunchanged except that it now calls one shared helper for the same headroom value.
B390, the desktop app, and answer quality beyond the two prompts above.
Limits
One card on one PC. 31.5 GB of shared RAM is the real ceiling: with IQ1_M most experts do not fit, so serving runs at
1-2 tok/s while the one-shot run with more experts resident reached 10.5 tok/s - speed here is a memory question, not
a kernel one, and the engine now caps the cache to protect the machine instead of filling the budget. Windows still
has no Intel engine package: the user builds with oneAPI, as on Linux. An integrated Arc's figures come from Windows'
per-process budget, so other programs and the desktop take memory first; the engine prints which number it used. The
GPU's generation is classified as Battlemage from its marketing name (the runtime reports no architecture for Xe3),
which is what engages the B-series kernels; those were exercised by the runs above but not compared kernel-by-kernel
against a discrete B-series card.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.