mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1390] [CLOSED] Windows: native Intel Arc build and setup (OpenCL), plus three Windows-SDK macro fixes #3423
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#3423
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/1390
Author: @demetree
Created: 10/7/2026
Status: ❌ Closed
Base:
main← Head:intel-windows-v2📝 Commits (10+)
781f0b0Windows: native Intel Arc build and setup on 0.1.40.2, verified on a B7070403cfdocs/INTEL.md: the Windows path, measured on a B70 (OpenCL), and what it costsce0b24csetup: stage the DLLs a fresh Windows build needs to start at all03ae962docs/INTEL.md: the Windows A/B, measured the way this file measures - and a correction7694de3prefill: tile the plain-SYCL GEMM fallback (5-9x on the prompt path)6ab6dd0docs/INTEL.md: the tiled prompt fallback, and two traps in measuring here5fedf1bprefill: STRATA_FALLBACK_NAIVE=1 sends every call to the naive kernelebb2abcsycl: keep the B-series spin bound on Windows (decode 40.9 -> 42.9, +67% atf4cb017docs: the spin bound is worth 46-67% of decode on Windows (0.1.40.3 default)184a44bserve: warn when the engine runs without --mtp (the short spin bound drafts nothing)📊 Changes
29 files changed (+1688 additions, -140 deletions)
View changed files
📝
docs/INTEL.md(+224 -4)📝
include/strata/core/expert_cache.hpp(+43 -0)📝
setup.py(+115 -7)📝
src/program/generate.cpp(+11 -1)📝
sycl/CMakeLists.txt(+91 -5)📝
sycl/include/dpct/device.hpp(+15 -1)📝
sycl/include/strata/core/mtp.hpp(+5 -0)📝
sycl/include/strata/core/verify.hpp(+13 -2)📝
sycl/include/strata/kernels/resident_plan_mirror.hpp(+4 -2)➕
sycl/probe/vram_pressure.cpp(+120 -0)📝
sycl/serve/server_intel.py(+20 -0)➕
sycl/serve/strata-sycl.bat(+44 -0)📝
sycl/serve/xe_telemetry.py(+191 -2)📝
sycl/setup_intel.py(+66 -14)📝
sycl/src/core/expert_cache.cpp(+49 -0)📝
sycl/src/core/gguf_expert_source.cpp(+43 -4)📝
sycl/src/core/mtp.cpp(+75 -28)📝
sycl/src/core/pinned.dp.cpp(+4 -1)📝
sycl/src/core/verify.cpp(+44 -10)📝
sycl/src/kernels/cuda/verify_kernels.dp.cpp(+16 -6)...and 9 more files
📄 Description
What
Native Windows support for the SYCL port (
setup --backend sycl): no Docker, the engine is built from source withIntel oneAPI (
sycl\tools\build.bat) and run directly (sycl\serve\strata-sycl.bat). Plus the fixes the port needsto compile on Windows at all, and the no-command-graph paths ΓÇö this Windows driver exposes no user-mode Level Zero
adapter, so the OpenCL adapter has no Graph extension.
Replaces #1295: that branch predates 0.1.40.2, and the release merged most of its forward-port (and has its own
STRATA_VERIFY_EAGERwindow replay), so this one carries the Windows deltas only ΓÇö 4 commits.Measured
Arc Pro B70 32 GB, Windows 10, driver 32.0.101.8976, i9-9900 / 64 GB, conda-forge
dpcpp_win-642026.1.1, OpenCLbackend,
STRATA_VERIFY_EAGER=1. Coder IQ1_M, 12,288/12,288 experts resident,--stream-experts, INT8 KV, greedy.Each row is this branch's engine (0.1.40-sycl) against the previous 0.1.39-based build of this port, run
interleaved from the command line (v1, v2, v1, v2, …), which is how the numbers in docs/INTEL.md were taken:
| | 0.1.39-sycl | 0.1.40-sycl (this PR) | Linux / Level Zero / graphs |
|---|---|---|---|
| decode, 256 tokens,
--spec 4 --mtp, 3 pairs | 69.6-69.9 (median 69.7) | 77.2-77.3 (median 77.3) | 78.2 || decode, 128 tokens after a 2,048-token prompt, 2 pairs | 37.6 | 38.2-41.1 (median 39.6) | ΓÇö |
| decode, 256 tokens,
--spec 2(no draft layer), 3 pairs | 53.4-53.9 (median 53.6) | 22.0-22.9 (median 22.3) | 33.6 || prompt reading, 2,048 tokens | 8.0-14.5 tok/s | 71-73 tok/s | 790-1,002 tok/s |
|
quantize_act_parity --selftest,sampler_parity| byte-exact, 0 failures | byte-exact, 0 failures | ΓÇö |Two traps in measuring this backend, both worth passing on. With a 2,048-token prompt the engine is not
run-to-run deterministic: the same binary diverges at token 60 and its state hash differs between two runs. And the
web app answers a
temperature: 0.0request with its own Chat defaults (temperature 1.0, top_p 0.95), so a "greedy"run through it is sampled. The kernel-level self-tests and the CLI's
--greedyare the checks that hold.And short runs are not comparable on this backend. The same build and mode gave 48.9 and
67.5 tok/s on two consecutive 128-token runs, and a 155-token answer through the API contradicted a 256-token run by
25%. My first pass at this table used those short runs and wrongly read as a ~25% regression; interleaved medians over
256 tokens are the numbers above.
The one reproducible regression is
--spec 2ΓÇö 22.3 against 53.6 tok/s, interleaved, same card and flags. It isthe no-draft-layer path, so it is either the drafter-free window or the suffix drafter's cost; not attributed.
STRATA_VERIFY_PROFILE=1puts 24 of a 65 ms 4-token window in the GDN hyper-connection read, nearly flat from T=2(23.6 ms) to T=6 (25.6 ms): a per-layer fixed cost of ~0.5 ms over 48 layers ΓÇö kernel dispatch, not arithmetic.
sycl-lslists onlyopencl:gpuhere, so there is neither the Graph extension nor sysman's free-VRAM query.Two things a fresh Windows build needs, both found by building it clean
The DLLs to start at all.
strata.exestatically importslibmmd.dll(Intel's runtime, besideicx), and theUR adapters load
ur_loader.dll/ur_win_proxy_loader.dllfrom beside the exe. Without those three staged theengine exits
0xC0000135(STATUS_DLL_NOT_FOUND) before printing anything ΓÇö it only ran in my earlier builddirectory by accident.
sycl/CMakeLists.txtnow stages all three with the rest.sycl/tools/build.batfindslibircmt.libthrough the build dir's CMakeCache when the shell has noicxonPATH, so the script works from a plain prompt; otherwise the link fails
LNK1104.Three compile bugs in the port's own code
<sycl/sycl.hpp>reaches the Windows SDK, whose headers defineOUT(minwindef.h),small(rpcndr.h) andnear(windef.h) as macros. An identifier with one of those names is macro-expanded away:
sycl/src/kernels/cuda/verify_kernels.dp.cpp:template <bool OUT>loses its parameter, so every use becomeserror: expected expression. RenamedWRITE_OUT.sycl/src/program/generate.cpp:const int64_t smallbecomesconst int64_t char;memmemis POSIX (nowstd::searchover the same bytes).sycl/src/kernels/sampler_parity.cpp:const bool near.Without command graphs
STRATA_VERIFY_EAGER=1(set bysycl/serve\strata-sycl.bat) replays the window, the commit and the drafter'schains on the queue instead of launching captured graphs:
record_commit()is the commit graph's body;capture_*()record it where there is a graph backend.The
capture_round/capture_step/capture_prefillbodies becamerecord_*()functions the drafterreplays.
prepare_chain()refuses: its per-step events only exist inside a recorded graph.Eager replay refuses a host-served expert plan instead of running it ΓÇö the mid-record waits expire into stale
plans, which is silently wrong rather than slow.
oneMKL SYCL BLAS has no OpenCL Xe2 backend and the failed attempt poisons the queue, so the prompt GEMM is a
plain SYCL kernel there - and the first version of that kernel read the whole weight matrix once per row (a
2,048-row chunk of one 2,560 x 4,096 projection moved 86 GB of weights).
fallback_gemm_tiledblocks a 64 x 64corner of Y per work-group and walks K in 16-wide tiles with the operands in local memory: **8.0-14.5 -> 71-73
tok/s** on a 2,048-token prompt, decode unchanged. Same arithmetic - both kernels accumulate over k in ascending
order with the fma spelled out - and
STRATA_FALLBACK_SELFTEST=1runs both over a problem that crosses every tileedge and prints the bitwise difference: 0 of 4,189 values, largest 0.
sampler_parity's fixture 18 skips its graph half without the extension instead of ending the process.Also
Setup names the Intel Arc on Windows (display adapters + the display-class registry's 64-bit VRAM, which is the
true VRAM ΓÇö WMI's
AdapterRAMstops at 4 GB), and--backend syclhands over tosycl/setup_intel.pythere too.sycl/CMakeLists.txt: IntelLLVM / MSVC flag branches (/fp:preciseis load-bearing ΓÇöquantize_act_paritygoesfrom byte-exact to 303k mismatches without it), installer-free oneMKL, and the runtime DLLs staged beside
strata.exe.GgufExpertSourcereads at an offset throughOVERLAPPED(there is nopreadon Windows).The free-VRAM query needs Level Zero sysman, so setup writes
STRATA_DEVICE_FREE_MIB/_TOTAL_MIBfrom theregistry, and keeps them across a rewrite when detection flakes.
The expert mirror on Windows (a model that does not fit in VRAM)
The mirror's default size came from
/proc/meminfo, which does not exist here, so nothing was ever mirrored onWindows: a model that does not fit entirely in VRAM refused to run ("6889 experts are neither in VRAM nor mirrored").
GlobalMemoryStatusExis the same reading the process stats already take there, so with it IQ3_XXS runs on the B70(17,687 of 24,576 experts in VRAM, the other 6,889 - 11.15 GiB - in pinned host memory the GPU reads over PCIe).
Decode absorbs the misses; the prompt does not, and not at the bandwidth bound (535 GiB over PCIe in 1,988 s is
~2% of the link). Reported with the profile that would settle it as
#1549.
The Monitor tab on this card
GPU load and VRAM come from the counters Windows keeps for every WDDM adapter -
GPU Engine(per process, per engine,summed per card as Task Manager does) and
GPU Adapter Memory(dedicated bytes) - filtered to the LUID of the adapterholding the most dedicated memory, so an iGPU beside the card does not add to the numbers. Measured through the API on
the B70: 2.9% idle, 100% while decoding, 30.01 of 32.00 GiB in use (the 23.4 GiB of experts, the KV and the driver's
own buffers), which agrees with the engine's own "12,288 of 12,288 experts resident".
Temperature, power and the PCIe link have no Windows counter at all, so those three tiles stay empty - now with the
dashboard saying why instead of showing a bare dash.
Two traps in that path, both found by measuring rather than reading, both in the commit message: PDH's wildcard API
answers
PDH_INVALID_ARGUMENTon this machine for every path (core counters included), so instances come fromGet-Counter -ListSetand each gets its own counter; and a byte counter must be asked for asPDH_FMT_LARGE, becausewith
PDH_FMT_DOUBLEPDH fills the union with a double and 4.4 GB comes out as 4,437,051,947 GB.Limits
Needs an admin account for VS Build Tools and the Intel driver; the conda + VS + PyPI/NuGet oneMKL pieces install
per-user.
A model whose experts do not all fit needs a RAM mirror (
STRATA_MIRROR_MIB) or all-resident sizing; IQ3_XXS(17,687/24,576 experts resident here) stalls without one.
Windows-SDK macro names have to be avoided as identifiers in the port.
Tests:
tools/test_setup_intel_windows.py(new),tools/test_setup_sycl.py,tools/test_setup_amd.py,tools/test_setup_choices.pyΓÇö 87 pass, no GPU and no network.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.