[PR #1940] [CLOSED] Add Arc native Windows support #3766

Closed
opened 2026-11-07 15:30:36 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1940
Author: @K8-and-a-half-1000
Created: 10/11/2026
Status: ❌ Closed

Base: main ← Head: intel-windows


📝 Commits (1)

  • d052cf9 Add Arc Intel native Windows support

📊 Changes

41 files changed (+5952 additions, -841 deletions)

View changed files

📝 README.md (+1 -1)
📝 docs/INTEL_ARC.md (+14 -9)
➕ docs/INTEL_WINDOWS.md (+228 -0)
📝 setup.py (+8 -6)
📝 sycl/CMakeLists.txt (+149 -20)
📝 sycl/include/dpct/dpct.hpp (+16 -0)
➕ sycl/include/strata/core/device.hpp (+127 -0)
📝 sycl/include/strata/sycl_doorbell.hpp (+23 -6)
➕ sycl/include/strata/sycl_heartbeat.hpp (+31 -0)
➕ sycl/include/strata/sycl_mem.hpp (+26 -0)
📝 sycl/include/strata/sycl_queue.hpp (+4 -1)
➕ sycl/probe/CMakeLists.txt (+19 -0)
➕ sycl/probe/README.md (+97 -0)
➕ sycl/probe/alloc_probe.cpp (+175 -0)
➕ sycl/probe/bw_probe.cpp (+327 -0)
➕ sycl/probe/doorbell_probe.cpp (+246 -0)
➕ sycl/probe/graph_probe.cpp (+287 -0)
➕ sycl/probe/probe_common.hpp (+303 -0)
📝 sycl/serve/server_intel.py (+121 -14)
📝 sycl/serve/xe_telemetry.py (+296 -4)

...and 21 more files

📄 Description

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.

Full description, measurements and open questions: docs/INTEL_WINDOWS.md.

What it adds

  • Build: sycl\tools\build_windows.bat finds Visual Studio and oneAPI, configures sycl\CMakeLists.txt with
    Ninja, builds the engine, strata-device and the probes, and packages engine\ with the oneAPI runtime DLLs and a
    BUILD.json (sycl\tools\package_windows.py). CMake: MSVC-style flags for icx, /Qmkl:sequential, the dynamic
    CRT, the AVX flags.
  • Install and serve: sycl\setup_intel.py and sycl\serve\server_intel.py on Windows (cards numbered by
    strata-device --list-devices, the engine's environment, Sysman telemetry through ctypes in
    sycl\serve\xe_telemetry.py); setup.py hands --backend sycl over on Windows. Tests without a GPU:
    tools\test_setup_sycl_windows.py.
  • Engine: the card choice and capability gate (device.dp.cpp); a chunked VRAM arena that tries one allocation
    first (core/device.hpp); the DXGI video-memory budget folded into the free-VRAM figure (sycl_mem.hpp); a VRAM
    heartbeat against WDDM eviction on a card that drives no display (sycl_heartbeat.hpp); prepare_for_device_copy
    on the pinned expert arena; overlapped ReadFile for --stream-experts; the windows.h macros that collide with
    identifiers in the kernels (IN, OUT, near, far, small, hyper) dropped after the dpct headers;
    _putenv_s in the two parity programs that call setenv.
  • Probes (sycl/probe/): doorbell, allocation, bandwidth and graph probes, each ending in a VERDICT line that
    names 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).
  • Tools: report_windows.py (a one-shot bug-report bundle) and benchy_windows.bat / .py (the Linux port's
    benchy 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), the
probes, and Swift 1.5 IQ3_XXS at --max-context 262144 with INT8 KV and 32,768 resident cells, used from qwen-code for
an 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

  1. sycl/src/kernels/cuda/qsa_decode_attn.dp.cpp is the 0.1.38 migration, kept in place of the 0.1.41 one. The
    0.1.41 copy adds the opt-in lane-cell scoring variant (STRATA_ATTN_LANECELL) as a second template parameter of
    attn_chunk_kernel. Compiled that way by icx 2026.0.0 for bmg-g31, the INT8 instantiation's batched output is
    inf and NaN (qsa_prompt_attn_parity, "vs FP64 old": 78.5 on an output scale of 3.7) while the fp16 instantiation
    is 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_parity cannot catch this
    class 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.
  2. The opt-in XMX prompt attention (STRATA_PROMPT_ATTN_XMX=1) measures 2e-3 absolute (5e-4 of scale) on this
    Windows build, where docs/INTEL.md reports 1e-6 of scale on Linux. Off by default; not understood.

Known limits

One card per model on Windows (--gpus / --layer-split is refused); images are not wired on Intel; only the Arc Pro
B70 has run this (other Battlemage cards need STRATA_SYCL_AOT=bmg-g21 or a JIT build); the greedy benchmark and the
heartbeat'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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1940 **Author:** [@K8-and-a-half-1000](https://github.com/K8-and-a-half-1000) **Created:** 10/11/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `intel-windows` --- ### 📝 Commits (1) - [`d052cf9`](https://github.com/Niko1221/Strata/commit/d052cf90afa78f0228c7d5df7a93724b744fcfd1) Add Arc Intel native Windows support ### 📊 Changes **41 files changed** (+5952 additions, -841 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+1 -1) 📝 `docs/INTEL_ARC.md` (+14 -9) ➕ `docs/INTEL_WINDOWS.md` (+228 -0) 📝 `setup.py` (+8 -6) 📝 `sycl/CMakeLists.txt` (+149 -20) 📝 `sycl/include/dpct/dpct.hpp` (+16 -0) ➕ `sycl/include/strata/core/device.hpp` (+127 -0) 📝 `sycl/include/strata/sycl_doorbell.hpp` (+23 -6) ➕ `sycl/include/strata/sycl_heartbeat.hpp` (+31 -0) ➕ `sycl/include/strata/sycl_mem.hpp` (+26 -0) 📝 `sycl/include/strata/sycl_queue.hpp` (+4 -1) ➕ `sycl/probe/CMakeLists.txt` (+19 -0) ➕ `sycl/probe/README.md` (+97 -0) ➕ `sycl/probe/alloc_probe.cpp` (+175 -0) ➕ `sycl/probe/bw_probe.cpp` (+327 -0) ➕ `sycl/probe/doorbell_probe.cpp` (+246 -0) ➕ `sycl/probe/graph_probe.cpp` (+287 -0) ➕ `sycl/probe/probe_common.hpp` (+303 -0) 📝 `sycl/serve/server_intel.py` (+121 -14) 📝 `sycl/serve/xe_telemetry.py` (+296 -4) _...and 21 more files_ </details> ### 📄 Description ### 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. Full description, measurements and open questions: `docs/INTEL_WINDOWS.md`. ## What it adds - **Build**: `sycl\tools\build_windows.bat` finds Visual Studio and oneAPI, configures `sycl\CMakeLists.txt` with Ninja, builds the engine, `strata-device` and the probes, and packages `engine\` with the oneAPI runtime DLLs and a `BUILD.json` (`sycl\tools\package_windows.py`). CMake: MSVC-style flags for `icx`, `/Qmkl:sequential`, the dynamic CRT, the AVX flags. - **Install and serve**: `sycl\setup_intel.py` and `sycl\serve\server_intel.py` on Windows (cards numbered by `strata-device --list-devices`, the engine's environment, Sysman telemetry through `ctypes` in `sycl\serve\xe_telemetry.py`); `setup.py` hands `--backend sycl` over on Windows. Tests without a GPU: `tools\test_setup_sycl_windows.py`. - **Engine**: the card choice and capability gate (`device.dp.cpp`); a chunked VRAM arena that tries one allocation first (`core/device.hpp`); the DXGI video-memory budget folded into the free-VRAM figure (`sycl_mem.hpp`); a VRAM heartbeat against WDDM eviction on a card that drives no display (`sycl_heartbeat.hpp`); `prepare_for_device_copy` on the pinned expert arena; overlapped `ReadFile` for `--stream-experts`; the `windows.h` macros that collide with identifiers in the kernels (`IN`, `OUT`, `near`, `far`, `small`, `hyper`) dropped after the dpct headers; `_putenv_s` in the two parity programs that call `setenv`. - **Probes** (`sycl/probe/`): doorbell, allocation, bandwidth and graph probes, each ending in a `VERDICT` line that names 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). - **Tools**: `report_windows.py` (a one-shot bug-report bundle) and `benchy_windows.bat` / `.py` (the Linux port's benchy 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), the probes, and Swift 1.5 IQ3_XXS at `--max-context 262144` with INT8 KV and 32,768 resident cells, used from qwen-code for an 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 1. **`sycl/src/kernels/cuda/qsa_decode_attn.dp.cpp` is the 0.1.38 migration, kept in place of the 0.1.41 one.** The 0.1.41 copy adds the opt-in lane-cell scoring variant (`STRATA_ATTN_LANECELL`) as a second template parameter of `attn_chunk_kernel`. Compiled that way by icx 2026.0.0 for `bmg-g31`, the INT8 instantiation's batched output is inf and NaN (`qsa_prompt_attn_parity`, "vs FP64 old": 78.5 on an output scale of 3.7) while the fp16 instantiation is 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_parity` cannot catch this class 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. 2. **The opt-in XMX prompt attention** (`STRATA_PROMPT_ATTN_XMX=1`) measures 2e-3 absolute (5e-4 of scale) on this Windows build, where `docs/INTEL.md` reports 1e-6 of scale on Linux. Off by default; not understood. ## Known limits One card per model on Windows (`--gpus` / `--layer-split` is refused); images are not wired on Intel; only the Arc Pro B70 has run this (other Battlemage cards need `STRATA_SYCL_AOT=bmg-g21` or a JIT build); the greedy benchmark and the heartbeat'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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:30:36 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3766
No description provided.