Repository navigation
Add Arc native Windows support - #1940
K8-and-a-half-1000 wants to merge 1 commit into
Conversation
This commit adds support for running Strata on Arc Intel, tested on a B70 pro. This work was done over the course of a week in a different project at first, but I've decided to contribute upstream based on the project activity and direction. So, in short: I like what I see, so here's a contribution to support the project.
Two things that came out of measuring the port on an Arc Pro B70 on Windows. **1. `strata-sycl.bat` gains `STRATA_SYCL_LEVEL_ZERO=1`, off by default.** The port assumed the OpenCL backend because `sycl-ls` never listed a Level Zero device on this card. That turned out to be a graphics-driver version, not the card: the Intel Arc **Pro** line's newest (32.0.101.8976) does not expose Level Zero through any SYCL adapter at all, while the **generic** Arc line's 32.0.101.9034 does. With it, `ext_intel_free_memory` and `ext_oneapi_graph` both appear, which is exactly what the OpenCL workarounds existed for. The settings it turns on, all measured on that card, 2047-token prompt, coder-IQ1_M: | | OpenCL (eager) | LZ v2 | LZ v1 | |---|---|---|---| | decode, 128 tokens | 66.6 tok/s | 87.9 tok/s | **108.8 tok/s** | | prefill, 2047 tokens | 81.1 tok/s | 64.5 tok/s | 81.1 tok/s | | verify graph capture | skipped | 9,495 ms | **276 ms** | `SYCL_UR_USE_LEVEL_ZERO_V2=0` is the v1 adapter: +24% decode over v2 and 34x faster graph capture. Niko1221#1940 pins v2 on for graph replay (intel/llvm#23073); on this card that trade is the wrong one. It stays opt-in and off by default because it is not reliable yet: through the serve request path the device-plan verify window occasionally never gets its doorbell and the engine stalls ("waiting for the GPU to finish the window; the GPU rang 0"). The engine itself is stable in the CLI and through the launcher (512 decode tokens at 74.5 tok/s, prefill 121.4 tok/s against OpenCL's 81.1), so the trigger is narrower than "Level Zero is broken", but it is not fixed, and a default that stalls after a few requests is worse than a default that is merely slower. **2. `LEVEL_ZERO_FINDINGS.md` records how that was established**, including the parts that turned out to be wrong. The two most useful entries for anyone reading this PR: - The Level Zero **driver** on this card was never broken. Walking the Level Zero API directly, with no SYCL or UR in the way, gives a driver handle, a device handle and full device properties (`TYPE_GPU`, `0x8086`/`0xe223`, 31.2 GiB). The failure was entirely in the loader and adapter above it. - `ur_adapter_level_zero.dll` imports `UMF.dll` and the `VCRUNTIME140*` set, and `sycl/CMakeLists.txt` stages neither beside `strata.exe`. The adapter therefore fails to load, the UR loader reports only OpenCL, and `ONEAPI_DEVICE_SELECTOR=level_zero:0` kills the process with `0xC0000409` before `main` prints anything. That is a real gap in the copy list, and the silence is what makes it expensive: every Level Zero adapter failure looks like "there is no Level Zero here". **This is the piece of the PR I would most want reviewed.** ## What this leaves alone The default path is untouched — `STRATA_SYCL_LEVEL_ZERO` unset is exactly the previous behaviour, including `ONEAPI_DEVICE_SELECTOR`, `SYCL_UR_USE_LEVEL_ZERO_V2` and `ZES_ENABLE_SYSMAN` staying unset. Every variable is only written when it is not already defined, so an explicit `ONEAPI_DEVICE_SELECTOR` for a two-card split or an OpenCL run still wins. No engine source changed. Built and run on SYCL/Windows only; I have no CUDA, HIP or Linux toolchain here.
|
Thanks for the contribution. It is Windows platform support that we cannot test, so it is not part of the speed round. |
|
Thanks for the pull request. We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to review properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected. To reopen it takes about two minutes:
The rules are in CONTRIBUTING.md. |
Would you mind sharing the compiled version? Also, the PR got closed but my B70 is begging for this PR to be merged :D |
|
Sure, I'll have a look in the weekend. 👍
…________________________________
From: FeliciaFiction ***@***.***>
Sent: Thursday, October 22, 2026 20:51
To: Niko1221/Strata ***@***.***>
Cc: Kate ***@***.***>; Author ***@***.***>
Subject: Re: [Niko1221/Strata] Add Arc native Windows support (PR #1940)
[https://avatars.githubusercontent.com/u/120337827?s=20&v=4]FeliciaFiction left a comment (Niko1221/Strata#1940)<#1940 (comment)>
Author's note:
This PR adds support for running Strata on Arc on Windows natively, tested on a Pro B70. No WSL2, no docker. This work was done over the course of a week in an offshoot project at first, but I've decided to contribute upstream based on the project activity and direction.
In short: I like what I see, so here's a contribution to help support the project.
AI disclaimer
Fable 5.1 ultracode and max used heavily throughout. I've been critical and culled as many temp files, tools and journey notes that are not relevant for this project.
Summary
The SYCL port builds and runs natively on Windows 11 with the Intel oneAPI compiler (icx), the Visual Studio Build Tools and the Intel Arc driver. Written for and measured on an Arc Pro B70 (32 GB) dedicated to the model. The Linux build is unchanged: everything lives in sycl/ under #if defined(_WIN32) or in new Windows scripts.
Would you mind sharing the compiled version?
Also, the PR got closed but my B70 is begging for this PR to be merged :D
—
Reply to this email directly, view it on GitHub<#1940?email_source=notifications&email_token=ASC7MDINNFQ5Z4EGSNJSQWT5VJJJXA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMMZUHA3DQMRVGQ2KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-6348682544>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ASC7MDK23N64EUWK34OGFI35VJJJXAVCNFSNUABGKJSXA33TNF2G64TZHMYTGOBVHE2DMMZQGE5US43TOVSTWNJXHE4TIOJSGM3TJILWAI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Author's note:
This PR adds support for running Strata on Arc on Windows natively, tested on a Pro B70. No WSL2, no docker.
This work was done over the course of a week in an offshoot project at first, but I've decided to contribute upstream based on the project activity and direction.
In short: I like what I see, so here's a contribution to help support the project.
AI disclaimer
Fable 5.1 ultracode and max used heavily throughout.
I've been critical and culled as many temp files, tools and journey notes that are not relevant for this project.
Summary
The SYCL port builds and runs natively on Windows 11 with the Intel oneAPI compiler (
icx), the Visual Studio BuildTools and the Intel Arc driver. Written for and measured on an Arc Pro B70 (32 GB) dedicated to the model. The Linux
build is unchanged: everything lives in
sycl/under#if defined(_WIN32)or in new Windows scripts.Full description, measurements and open questions:
docs/INTEL_WINDOWS.md.What it adds
sycl\tools\build_windows.batfinds Visual Studio and oneAPI, configuressycl\CMakeLists.txtwithNinja, builds the engine,
strata-deviceand the probes, and packagesengine\with the oneAPI runtime DLLs and aBUILD.json(sycl\tools\package_windows.py). CMake: MSVC-style flags foricx,/Qmkl:sequential, the dynamicCRT, the AVX flags.
sycl\setup_intel.pyandsycl\serve\server_intel.pyon Windows (cards numbered bystrata-device --list-devices, the engine's environment, Sysman telemetry throughctypesinsycl\serve\xe_telemetry.py);setup.pyhands--backend syclover on Windows. Tests without a GPU:tools\test_setup_sycl_windows.py.device.dp.cpp); a chunked VRAM arena that tries one allocationfirst (
core/device.hpp); the DXGI video-memory budget folded into the free-VRAM figure (sycl_mem.hpp); a VRAMheartbeat against WDDM eviction on a card that drives no display (
sycl_heartbeat.hpp);prepare_for_device_copyon the pinned expert arena; overlapped
ReadFilefor--stream-experts; thewindows.hmacros that collide withidentifiers in the kernels (
IN,OUT,near,far,small,hyper) dropped after the dpct headers;_putenv_sin the two parity programs that callsetenv.sycl/probe/): doorbell, allocation, bandwidth and graph probes, each ending in aVERDICTline thatnames the engine setting it decides. All under Strata's MIT license (the two that derived from XeStrata's LGPL files
were rewritten from their descriptions).
report_windows.py(a one-shot bug-report bundle) andbenchy_windows.bat/.py(the Linux port'sbenchy on Windows; not yet run).
What ran
Arc Pro B70, driver 32.0.101.8976, oneAPI 2026.0.0, AOT
bmg-g31, 2026-10-10 and 11: the build (0 errors), theprobes, and Swift 1.5 IQ3_XXS at
--max-context 262144with INT8 KV and 32,768 resident cells, used from qwen-code foran evening: prompts read at 630-890 tok/s, decode 50-76 tok/s, 97-99.3% of the KV block reads from VRAM, 2.1 GiB of
VRAM free with everything loaded. On the 0.1.38 base before this: Coder IQ1_M at 60 tok/s sampled, and Swift served
for several days.
Two things worth knowing upstream
sycl/src/kernels/cuda/qsa_decode_attn.dp.cppis the 0.1.38 migration, kept in place of the 0.1.41 one. The0.1.41 copy adds the opt-in lane-cell scoring variant (
STRATA_ATTN_LANECELL) as a second template parameter ofattn_chunk_kernel. Compiled that way by icx 2026.0.0 forbmg-g31, the INT8 instantiation's batched output isinf and NaN (
qsa_prompt_attn_parity, "vs FP64 old": 78.5 on an output scale of 3.7) while the fp16 instantiationis exact; the 0.1.38 copy, otherwise the same code, measures 2e-6 in both. Since 0.1.41 routes SYCL prompts
through this kernel, every reply on Windows was token 0 until the swap.
kv_stream_paritycannot catch thisclass of defect: it compares the kernel's streamed output with its resident output, both through the same kernel.
Whether the Linux build is affected was not measured.
STRATA_PROMPT_ATTN_XMX=1) measures 2e-3 absolute (5e-4 of scale) on thisWindows build, where
docs/INTEL.mdreports 1e-6 of scale on Linux. Off by default; not understood.Known limits
One card per model on Windows (
--gpus/--layer-splitis refused); images are not wired on Intel; only the Arc ProB70 has run this (other Battlemage cards need
STRATA_SYCL_AOT=bmg-g21or a JIT build); the greedy benchmark and theheartbeat's idle test have not been run. Details in
docs/INTEL_WINDOWS.md, "Known limits and open questions".Extra Notes
On Windows there is a RAM eviction on idle timeout that affects Intel Arc cards, which will happen if the card is not driving any displays. This can be avoided by adding a small heartbeat every 10 seconds to poke the card. Check the heartbeat files for more info.