[GH-ISSUE #5236] [Engine] Windows Intel Arc: merge a community port, publish it as a preview component, or defer? #3113

Open
opened 2026-11-07 14:38:11 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @demetree on GitHub (Nov 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5236

What this is. A scope decision, which CONTRIBUTING asks for before a large feature. At least five native Windows Intel Arc ports exist and none is merged. This is to pick a direction, not to push one.

The candidates

  • #3607 (demetree): Windows SYCL port, engine 0.1.56 on 0.2.10, Arc Pro B70.
  • #2079 (lm902): native Windows SYCL support, updated to 0.2.0-beta, IQ3_S tested on a B70.
  • #4712 (yangweijie): Intel Arc on Windows, plus an integrated Arc B390.
  • xlwang1188's B580 port (#1552), Sciencetastic's 2x B60 branch and NeneNyann's fork, all reported in issues.

The user problem. On Windows with an Arc card, setup --backend sycl stops by design (docs/INTEL_ARC.md), and the CUDA, HIP and CPU engines cannot use the card. Today the only route is a fork.

The constraint I know of. "Platform support that we cannot test without a Windows Arc machine" (#2079). Windows HIP exists because you have that hardware; Windows Intel has no owner, and no CI job builds the SYCL engine at all, Linux included.

Options
(a) Merge one port. Review time once, then the Windows engine is part of releases. Needs an owner for Windows/Arc testing; I can be that owner from this machine.
(b) Publish a preview engine component, windows-x86_64-sycl, built from a branch I keep level with main, marked preview in the feed and the docs, with its known issues listed. It needs one BACKEND_MATRIX line and no source-level commitment from you.
(c) Defer. docs/INTEL_ARC.md already says Windows has no path; say that it stays that way.

Evidence, measured here (Arc Pro B70 32 GB, 256K, Coder IQ1_M, all 12,288 experts resident). Prompt 1,249 and 1,444 tok/s at 4K and 16K, decode 81.6 / 72.9 / 74.2, first token 0.61 / 3.33 / 11.39 s, sanity checks 12/12. ctest 55 of 57 (the Q2_0 fixture, and qsa_prompt_attn_parity on the new ESIMD int8 path), test_setup_sycl 52/52, terminal suite 2453 passed with 13 failures that fail identically on clean v0.2.10.

Limits, plainly. #4698 (the host arena with STRATA_VERIFY_NO_HOST=1 returns !x256); --stream-experts pins 46.8 GiB and dies with DEVICE_LOST on a 64 GB machine; everything above is one machine - no A-series card, no second Windows PC, no laptop, no iGPU run.

Ask. One line: (a), (b) or (c). For (a), the shape - one pull request or split into build, serve, docs. For (b), I will build the asset and the manifest entry for the next release.

Originally created by @demetree on GitHub (Nov 4, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5236 **What this is.** A scope decision, which CONTRIBUTING asks for before a large feature. At least five native Windows Intel Arc ports exist and none is merged. This is to pick a direction, not to push one. **The candidates** - #3607 (demetree): Windows SYCL port, engine 0.1.56 on 0.2.10, Arc Pro B70. - #2079 (lm902): native Windows SYCL support, updated to 0.2.0-beta, IQ3_S tested on a B70. - #4712 (yangweijie): Intel Arc on Windows, plus an integrated Arc B390. - xlwang1188's B580 port (#1552), Sciencetastic's 2x B60 branch and NeneNyann's fork, all reported in issues. **The user problem.** On Windows with an Arc card, `setup --backend sycl` stops by design (docs/INTEL_ARC.md), and the CUDA, HIP and CPU engines cannot use the card. Today the only route is a fork. **The constraint I know of.** "Platform support that we cannot test without a Windows Arc machine" (#2079). Windows HIP exists because you have that hardware; Windows Intel has no owner, and no CI job builds the SYCL engine at all, Linux included. **Options** (a) Merge one port. Review time once, then the Windows engine is part of releases. Needs an owner for Windows/Arc testing; I can be that owner from this machine. (b) Publish a preview engine component, `windows-x86_64-sycl`, built from a branch I keep level with main, marked preview in the feed and the docs, with its known issues listed. It needs one BACKEND_MATRIX line and no source-level commitment from you. (c) Defer. docs/INTEL_ARC.md already says Windows has no path; say that it stays that way. **Evidence, measured here (Arc Pro B70 32 GB, 256K, Coder IQ1_M, all 12,288 experts resident).** Prompt 1,249 and 1,444 tok/s at 4K and 16K, decode 81.6 / 72.9 / 74.2, first token 0.61 / 3.33 / 11.39 s, sanity checks 12/12. ctest 55 of 57 (the Q2_0 fixture, and `qsa_prompt_attn_parity` on the new ESIMD int8 path), `test_setup_sycl` 52/52, terminal suite 2453 passed with 13 failures that fail identically on clean v0.2.10. **Limits, plainly.** #4698 (the host arena with `STRATA_VERIFY_NO_HOST=1` returns `!`x256); `--stream-experts` pins 46.8 GiB and dies with `DEVICE_LOST` on a 64 GB machine; everything above is one machine - no A-series card, no second Windows PC, no laptop, no iGPU run. **Ask.** One line: (a), (b) or (c). For (a), the shape - one pull request or split into build, serve, docs. For (b), I will build the asset and the manifest entry for the next release.
Author
Owner

@agnaylor commented on GitHub (Nov 6, 2026):

One more data point for this decision: native Windows against WSL on the same Arc Pro B70, with the same model and prompts, run on consecutive days.

Setup: Arc Pro B70 32 GB, Windows, Intel driver 32.0.101.8976. Engine at 06698c6746 (0.1.56). Qwen3.8-Flash-Next IQ3_S. 3 synthetic prompts, no thinking, same seeds. WSL build: icpx 2026.1.1. Native build: icx 2026.0 and Level Zero win-sdk 1.32.0, plus a small patch (below, 96 added lines: pread to ReadFile, the leftover CUDA LUID code in pinned.dp.cpp, windows.h macro clashes, memmem, and MSVC-style compiler flags in sycl/CMakeLists.txt).

WSL Native Windows
PCIe host to device 12.8 GB/s 17.9 GB/s
Largest pinned host alloc 1 GiB (2 GiB refused) 2 GiB OK
Row 1 / 2 / 3 decode (tok/s) 10.9 / 11.1 / 12.9 11.3 / 21.6 / 21.9
Mean of rows 11.6 18.3
Output tokens per row 751 / 464 / 132 751 / 464 / 132 (identical)
WHEA / TDR / DEVICE_LOST none none

Passed: native build (icx 2026.0, no oneAPI 2026.1 needed); load; all 13,455 experts mirrored (25.73 GiB pinned); 3 of 3 rows finished with stop.

Failed: the first native attempt, with reserve 3072 MiB and STRATA_MIRROR_MIB=26000, was refused by the engine's own check: 178 experts were neither in VRAM nor mirrored under STRATA_VERIFY_NO_HOST=1. That refusal was correct, not a crash. Raising the mirror to 27000 fixed it.

Not run: ctest; the terminal test suite; any other card or machine; a rebase onto 0.1.57; CUDA and HIP builds of the patch (the CMake change is inside the SYCL tree only).

Limits:

  • Not like-for-like on memory settings. The native run used reserve 3072 / mirror 27000, WSL 2560 / 26000, so native had less VRAM cache.
  • Row 1 is flat on both paths, a cold-start cost I did not split out.
  • One machine only.

My reading is that most of the gain is the copy path (WSL's /dev/dxg), not the engine. So whichever port you choose, a native Windows path looks worth having for B70 owners. I'm not proposing another PR. The patch is below in case it helps whoever does (a) or (b).

strata-win.patch (against 06698c6746)
diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt
index dcd47c4..21725c2 100644
--- sycl/CMakeLists.txt
+++ sycl/CMakeLists.txt
@@ -108,7 +108,18 @@ list(APPEND _sycl_flags -fsycl-default-sub-group-size=32)
 # split the first launch in the prompt path (the embedding gather) paid 245 ms for the image it shared (2026-09-30).
 list(APPEND _sycl_link -fsycl-device-code-split=per_kernel)
 list(APPEND _sycl_flags -fsycl-device-code-split=per_kernel)
-add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:${_sycl_flags}>" -fp-model=precise -Wno-unused-parameter
+# strata-win: icx on Windows is the MSVC-style driver: /fp:precise, /Qmkl, and -Wall there means -Weverything
+if(WIN32)
+  set(_strata_fp /fp:precise)
+  set(_strata_mkl /Qmkl:sequential)
+  set(_strata_warn "")
+  add_compile_definitions(_CRT_SECURE_NO_WARNINGS NOMINMAX)
+else()
+  set(_strata_fp -fp-model=precise)
+  set(_strata_mkl -qmkl=sequential)
+  set(_strata_warn -Wall -Wextra)
+endif()
+add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:${_sycl_flags}>" ${_strata_fp} -Wno-unused-parameter
                     -Wno-unused-variable -Wno-deprecated-declarations)
 add_link_options(${_sycl_link})
 
@@ -138,7 +149,7 @@ add_library(strata_includes INTERFACE)
 target_include_directories(strata_includes INTERFACE
   ${CMAKE_CURRENT_SOURCE_DIR}/include      # migrated headers + dpct/ helpers, first
   ${STRATA_ROOT}/include)
-target_compile_options(strata_includes INTERFACE -Wall -Wextra)
+target_compile_options(strata_includes INTERFACE ${_strata_warn})
 
 # --- CPU-side pieces, identical to the top-level build ------------------------------------------------------------
 strata_resolve(_spec src/spec/suffix_drafter.cpp src/spec/controller.cpp src/spec/draft_policy.cpp
@@ -237,10 +248,15 @@ strata_resolve(_core src/core/device.cu src/core/pinned.cu src/platform/memory.c
 add_library(strata_core STATIC ${_core})
 target_link_libraries(strata_core PUBLIC strata_includes)
 # zeMemAllocHost for the host memory a kernel polls (include/strata/sycl_queue.hpp, host_malloc_polled): only when libze-dev's header is there
-find_library(STRATA_ZE_LOADER ze_loader)
+# strata-win: STRATA_ZE_ROOT points at the level-zero win-sdk (include/, lib/ze_loader.lib); Windows has no libze-dev
+set(STRATA_ZE_ROOT "" CACHE PATH "level-zero SDK root (Windows: the unpacked level-zero-win-sdk zip)")
+find_library(STRATA_ZE_LOADER ze_loader HINTS ${STRATA_ZE_ROOT}/lib)
 if(STRATA_ZE_LOADER)
   target_link_libraries(strata_core PUBLIC ${STRATA_ZE_LOADER})
 endif()
+if(STRATA_ZE_ROOT)
+  target_include_directories(strata_includes INTERFACE ${STRATA_ZE_ROOT}/include)
+endif()
 
 set(_kernel_cu dequant_s2 s2_gemv s_gemv s2_gemv_quads s2_gemv_fast router_top10 quantize_act rope sampler s2_gemv_q8
     s2_expert_grouped shared_expert gr gdn qsa elementwise bf16_gemv native_mmvq native_bf16 native_gr_norm native_moe
@@ -277,8 +293,8 @@ add_library(strata_prefill STATIC ${_prefill}
             ${CMAKE_CURRENT_SOURCE_DIR}/src/prefill/moe_fused_stub.cpp   # upstream's fused int8 kernels: not built here
             ${CMAKE_CURRENT_SOURCE_DIR}/src/prefill/xmx_moe.dp.cpp         # A770 port: grouped XMX expert GEMM
             ${CMAKE_CURRENT_SOURCE_DIR}/src/prefill/esimd_moe.dp.cpp)       # 151-b70: fused int8 DPAS expert products (ESIMD, Battlemage)
-target_compile_options(strata_prefill PUBLIC -qmkl=sequential)
-target_link_options(strata_prefill PUBLIC -qmkl=sequential)
+target_compile_options(strata_prefill PUBLIC ${_strata_mkl})
+target_link_options(strata_prefill PUBLIC ${_strata_mkl})
 target_link_libraries(strata_prefill PUBLIC strata_engine)
 
 strata_resolve(_main src/program/generate.cpp)
diff --git a/sycl/src/core/gguf_expert_source.cpp b/sycl/src/core/gguf_expert_source.cpp
index af1bda1..2dfa488 100644
--- sycl/src/core/gguf_expert_source.cpp
+++ sycl/src/core/gguf_expert_source.cpp
@@ -7,7 +7,14 @@
 #include <cstring>
 #include <utility>
 #include <fcntl.h>
+#if defined(_WIN32)
+#define WIN32_LEAN_AND_MEAN
+#define NOMINMAX
+#include <io.h>
+#include <windows.h>
+#else
 #include <unistd.h>
+#endif
 #include <dpct/dpct.hpp>
 #include <sycl/sycl.hpp>
 #include <thread>
@@ -16,6 +23,38 @@ namespace strata::core {
 
 namespace {
 constexpr size_t kRing = 512;   // blobs alive at once: the prompt path holds a layer's worth of streamed experts
+
+// strata-win: the GGUF reads, POSIX on Linux and positional ReadFile on Windows (the SYCL port had no Windows path here).
+int open_ro(const char* path) {
+#if defined(_WIN32)
+    return ::_open(path, _O_RDONLY | _O_BINARY | _O_NOINHERIT);
+#else
+    return ::open(path, O_RDONLY | O_CLOEXEC);
+#endif
+}
+void close_fd(int fd) {
+#if defined(_WIN32)
+    ::_close(fd);
+#else
+    ::close(fd);
+#endif
+}
+// bytes read (> 0), 0 at end of file, -1 on error
+int64_t pread_at(int fd, void* dst, size_t n, uint64_t off) {
+#if defined(_WIN32)
+    const HANDLE h = (HANDLE) ::_get_osfhandle(fd);
+    if (h == INVALID_HANDLE_VALUE) return -1;
+    OVERLAPPED ov{};
+    ov.Offset = (DWORD) (off & 0xffffffffull);
+    ov.OffsetHigh = (DWORD) (off >> 32);
+    const DWORD want = (DWORD) std::min<size_t>(n, (size_t) 1 << 30);
+    DWORD got = 0;
+    if (!::ReadFile(h, dst, want, &got, &ov)) return ::GetLastError() == ERROR_HANDLE_EOF ? 0 : -1;
+    return (int64_t) got;
+#else
+    return (int64_t) ::pread(fd, dst, n, (off_t) off);
+#endif
+}
 }
 
 GgufExpertSource::~GgufExpertSource() { close(); }
@@ -24,7 +63,7 @@ void GgufExpertSource::close() {
     for (uint8_t* c : mirror_chunks_) if (c) sycl::free(c, dpct::get_in_order_queue());
     mirror_chunks_.clear();
     mirror_bytes_ = 0; mirror_ptr_.clear(); layer_first_.clear();
-    for (int fd : fds_) if (fd >= 0) ::close(fd);
+    for (int fd : fds_) if (fd >= 0) close_fd(fd);
     fds_.clear(); names_.clear(); layer_fd_.clear(); ring_.clear(); ring_key_.clear(); where_.clear();
     ring_next_ = 0;
 }
@@ -68,7 +107,7 @@ int GgufExpertSource::fd_of(int64_t layer, int role, std::string& err) {
     if (lay.gguf_file.size() > i && !lay.gguf_file[i].empty()) name = dir_ + lay.gguf_file[i];
     for (size_t k = 0; k < names_.size(); ++k)
         if (names_[k] == name) { layer_fd_[i] = (int) k; return fds_[k]; }
-    const int fd = ::open(name.c_str(), O_RDONLY | O_CLOEXEC);
+    const int fd = open_ro(name.c_str());
     if (fd < 0) { err = "--stream-experts: cannot open " + name; return -1; }
     names_.push_back(name);
     fds_.push_back(fd);
@@ -106,7 +145,7 @@ const uint8_t* GgufExpertSource::blob(int64_t layer, int64_t expert) {
         const uint64_t src = lay.gguf_off[(size_t) (3 * layer + r)] + per[r] * (uint64_t) expert;
         uint64_t done = 0;
         while (done < per[r]) {
-            const ssize_t n = ::pread(fd, buf.data() + at[r] + done, (size_t) (per[r] - done), (off_t) (src + done));
+            const int64_t n = pread_at(fd, buf.data() + at[r] + done, (size_t) (per[r] - done), src + done);
             if (n <= 0) { std::lock_guard<std::mutex> lk(mu_); where_.erase(key); ring_key_[slot] = -1; return nullptr; }
             done += (uint64_t) n;
         }
@@ -131,7 +170,7 @@ int64_t GgufExpertSource::mirror(const std::vector<std::pair<int64_t, int64_t>>&
     // Alchemist (Arc A-series) refuses a single USM host allocation past ~3 GiB (docs/INTEL.md, A750), so the mirror
     // is built from chunks under that. Battlemage and the CUDA/HIP builds never hit the limit, but chunking is neutral
     // for them. One chunk per (up to) 2 GiB of experts.
-    constexpr uint64_t kChunk = 2ull << 30;
+    constexpr uint64_t kChunk = 1ull << 30;   // strata-win / chunk1g: WSL caps one zeMemAllocHost at 1 GiB
     std::vector<uint8_t*> chunks;
     // Free every chunk unless the mirror is handed over to the object: covers an allocation failure, a failed read and
     // any exception (a container allocation, a std::thread that cannot be created) on the way out.
@@ -228,7 +267,7 @@ bool GgufExpertSource::read_into(int64_t layer, int64_t expert, uint8_t* dst, si
         const uint64_t src = lay.gguf_off[(size_t) (3 * layer + r)] + per[r] * (uint64_t) expert;
         uint64_t done = 0;
         while (done < per[r]) {
-            const ssize_t n = ::pread(fd, dst + at[r] + done, (size_t) (per[r] - done), (off_t) (src + done));
+            const int64_t n = pread_at(fd, dst + at[r] + done, (size_t) (per[r] - done), src + done);
             if (n <= 0) return false;
             done += (uint64_t) n;
         }
diff --git a/sycl/src/core/pinned.dp.cpp b/sycl/src/core/pinned.dp.cpp
index 57fc68e..315583b 100644
--- sycl/src/core/pinned.dp.cpp
+++ sycl/src/core/pinned.dp.cpp
@@ -320,19 +320,9 @@ namespace {
 bool sliced_pin_limit(uint64_t& limit, std::string& why) {
     constexpr uint64_t GiB = 1ull << 30;
     char buf[256];
-    int dev = 0;
-    cudaDeviceProp p{};
-    uint64_t budget = 0, usage = 0;
-    std::string err = "no CUDA device properties";
-    if (cudaGetDevice(&dev) == cudaSuccess && cudaGetDeviceProperties(&p, dev) == cudaSuccess &&
-        strata::platform::gpu_shared_memory_budget(p.luid, budget, usage, err)) {
-        limit = budget > usage + 4 * GiB ? budget - usage - 4 * GiB : 0;
-        std::snprintf(buf, sizeof buf, "the GPU's shared-memory budget %.1f GiB - %.1f GiB in use - 4 GiB",
-                      (double) budget / GiB, (double) usage / GiB);
-        why = buf;
-        return true;
-    }
-    (void) cudaGetLastError();
+    // strata-win: the CUDA LUID lookup (cudaGetDeviceProperties().luid) was never migrated; the SYCL port takes the
+    // documented fallback below.  Reached only with STRATA_ARENA_PIN_GIB=auto.
+    const std::string err = "no device LUID in the SYCL port";
     const uint64_t ram = strata::platform::total_physical_memory();
     if (ram == 0) return false;
     limit = ram / 2 > 8 * GiB ? ram / 2 - 8 * GiB : 0;
--- sycl/src/kernels/cuda/verify_kernels.dp.cpp
+++ sycl/src/kernels/cuda/verify_kernels.dp.cpp
@@ -25,6 +25,9 @@
 #include <stdexcept>
 #include <thread>
 #include <vector>
+#if defined(_WIN32)
+#undef OUT   // strata-win: minwindef.h defines OUT empty; the kernels name a template parameter OUT
+#endif
 
 #ifndef STRATA_PLAN_LOCAL
 #define STRATA_PLAN_LOCAL 1   // 0: the original one-thread plan kernel (A/B)
--- sycl/src/program/generate.cpp
+++ sycl/src/program/generate.cpp
@@ -98,6 +98,7 @@
 #include <windows.h>
 #include <psapi.h>
 #include <io.h>
+#undef small   // strata-win: rpcndr.h defines small as char; the chunk rules name a local small
 #else
 #include <unistd.h>
 #include <cerrno>
@@ -132,6 +133,17 @@
 #include <string>
 #include <set>
 #include <vector>
+#if defined(_WIN32)
+// strata-win: memmem is a GNU extension; the one caller is a load-failure diagnostic
+static const void* memmem(const void* h, size_t hn, const void* n, size_t nn) {
+    if (nn == 0) return h;
+    if (hn < nn) return nullptr;
+    const unsigned char* p = (const unsigned char*) h;
+    for (size_t i = 0; i + nn <= hn; ++i)
+        if (std::memcmp(p + i, n, nn) == 0) return p + i;
+    return nullptr;
+}
+#endif
 
 namespace {
 // Windows' WDDM driver model: native Windows, or WSL2 (its GPU goes through /dev/dxg to the Windows driver).  There,
--- sycl/src/prefill/prefill.cpp
+++ sycl/src/prefill/prefill.cpp
@@ -58,6 +58,9 @@
 #include <chrono>
 #include <stdexcept>
 #include <sys/stat.h>
+#if defined(_WIN32)
+#include <direct.h>   // strata-win: _mkdir
+#endif
 #include <tuple>
 #include <chrono>
 #include <cmath>
@@ -918,7 +921,11 @@
     }
     std::FILE* f = std::fopen(path.c_str(), "w");
     if (!f) {
+#if defined(_WIN32)
+        ::_mkdir(dir.c_str());   // strata-win: no mode argument on Windows
+#else
         ::mkdir(dir.c_str(), 0755);
+#endif
         f = std::fopen(path.c_str(), "w");
         if (!f) return;
     }

An AI helped write the comment. They were measured B70 cards.

<!-- gh-comment-id:6698032811 --> @agnaylor commented on GitHub (Nov 6, 2026): One more data point for this decision: native Windows against WSL on the **same** Arc Pro B70, with the same model and prompts, run on consecutive days. **Setup:** Arc Pro B70 32 GB, Windows, Intel driver 32.0.101.8976. Engine at 06698c674673 (0.1.56). Qwen3.8-Flash-Next IQ3_S. 3 synthetic prompts, no thinking, same seeds. WSL build: icpx 2026.1.1. Native build: icx 2026.0 and Level Zero win-sdk 1.32.0, plus a small patch (below, 96 added lines: `pread` to `ReadFile`, the leftover CUDA LUID code in `pinned.dp.cpp`, windows.h macro clashes, `memmem`, and MSVC-style compiler flags in `sycl/CMakeLists.txt`). | | WSL | Native Windows | |---|---|---| | PCIe host to device | 12.8 GB/s | 17.9 GB/s | | Largest pinned host alloc | 1 GiB (2 GiB refused) | 2 GiB OK | | Row 1 / 2 / 3 decode (tok/s) | 10.9 / 11.1 / 12.9 | 11.3 / 21.6 / 21.9 | | Mean of rows | 11.6 | 18.3 | | Output tokens per row | 751 / 464 / 132 | 751 / 464 / 132 (identical) | | WHEA / TDR / DEVICE_LOST | none | none | **Passed:** native build (icx 2026.0, no oneAPI 2026.1 needed); load; all 13,455 experts mirrored (25.73 GiB pinned); 3 of 3 rows finished with `stop`. **Failed:** the first native attempt, with reserve 3072 MiB and `STRATA_MIRROR_MIB=26000`, was refused by the engine's own check: 178 experts were neither in VRAM nor mirrored under `STRATA_VERIFY_NO_HOST=1`. That refusal was correct, not a crash. Raising the mirror to 27000 fixed it. **Not run:** ctest; the terminal test suite; any other card or machine; a rebase onto 0.1.57; CUDA and HIP builds of the patch (the CMake change is inside the SYCL tree only). **Limits:** - Not like-for-like on memory settings. The native run used reserve 3072 / mirror 27000, WSL 2560 / 26000, so native had *less* VRAM cache. - Row 1 is flat on both paths, a cold-start cost I did not split out. - One machine only. My reading is that most of the gain is the copy path (WSL's `/dev/dxg`), not the engine. So whichever port you choose, a native Windows path looks worth having for B70 owners. I'm not proposing another PR. The patch is below in case it helps whoever does (a) or (b). <details><summary>strata-win.patch (against 06698c674673)</summary> ```diff diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index dcd47c4..21725c2 100644 --- sycl/CMakeLists.txt +++ sycl/CMakeLists.txt @@ -108,7 +108,18 @@ list(APPEND _sycl_flags -fsycl-default-sub-group-size=32) # split the first launch in the prompt path (the embedding gather) paid 245 ms for the image it shared (2026-09-30). list(APPEND _sycl_link -fsycl-device-code-split=per_kernel) list(APPEND _sycl_flags -fsycl-device-code-split=per_kernel) -add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:${_sycl_flags}>" -fp-model=precise -Wno-unused-parameter +# strata-win: icx on Windows is the MSVC-style driver: /fp:precise, /Qmkl, and -Wall there means -Weverything +if(WIN32) + set(_strata_fp /fp:precise) + set(_strata_mkl /Qmkl:sequential) + set(_strata_warn "") + add_compile_definitions(_CRT_SECURE_NO_WARNINGS NOMINMAX) +else() + set(_strata_fp -fp-model=precise) + set(_strata_mkl -qmkl=sequential) + set(_strata_warn -Wall -Wextra) +endif() +add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:${_sycl_flags}>" ${_strata_fp} -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated-declarations) add_link_options(${_sycl_link}) @@ -138,7 +149,7 @@ add_library(strata_includes INTERFACE) target_include_directories(strata_includes INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include # migrated headers + dpct/ helpers, first ${STRATA_ROOT}/include) -target_compile_options(strata_includes INTERFACE -Wall -Wextra) +target_compile_options(strata_includes INTERFACE ${_strata_warn}) # --- CPU-side pieces, identical to the top-level build ------------------------------------------------------------ strata_resolve(_spec src/spec/suffix_drafter.cpp src/spec/controller.cpp src/spec/draft_policy.cpp @@ -237,10 +248,15 @@ strata_resolve(_core src/core/device.cu src/core/pinned.cu src/platform/memory.c add_library(strata_core STATIC ${_core}) target_link_libraries(strata_core PUBLIC strata_includes) # zeMemAllocHost for the host memory a kernel polls (include/strata/sycl_queue.hpp, host_malloc_polled): only when libze-dev's header is there -find_library(STRATA_ZE_LOADER ze_loader) +# strata-win: STRATA_ZE_ROOT points at the level-zero win-sdk (include/, lib/ze_loader.lib); Windows has no libze-dev +set(STRATA_ZE_ROOT "" CACHE PATH "level-zero SDK root (Windows: the unpacked level-zero-win-sdk zip)") +find_library(STRATA_ZE_LOADER ze_loader HINTS ${STRATA_ZE_ROOT}/lib) if(STRATA_ZE_LOADER) target_link_libraries(strata_core PUBLIC ${STRATA_ZE_LOADER}) endif() +if(STRATA_ZE_ROOT) + target_include_directories(strata_includes INTERFACE ${STRATA_ZE_ROOT}/include) +endif() set(_kernel_cu dequant_s2 s2_gemv s_gemv s2_gemv_quads s2_gemv_fast router_top10 quantize_act rope sampler s2_gemv_q8 s2_expert_grouped shared_expert gr gdn qsa elementwise bf16_gemv native_mmvq native_bf16 native_gr_norm native_moe @@ -277,8 +293,8 @@ add_library(strata_prefill STATIC ${_prefill} ${CMAKE_CURRENT_SOURCE_DIR}/src/prefill/moe_fused_stub.cpp # upstream's fused int8 kernels: not built here ${CMAKE_CURRENT_SOURCE_DIR}/src/prefill/xmx_moe.dp.cpp # A770 port: grouped XMX expert GEMM ${CMAKE_CURRENT_SOURCE_DIR}/src/prefill/esimd_moe.dp.cpp) # 151-b70: fused int8 DPAS expert products (ESIMD, Battlemage) -target_compile_options(strata_prefill PUBLIC -qmkl=sequential) -target_link_options(strata_prefill PUBLIC -qmkl=sequential) +target_compile_options(strata_prefill PUBLIC ${_strata_mkl}) +target_link_options(strata_prefill PUBLIC ${_strata_mkl}) target_link_libraries(strata_prefill PUBLIC strata_engine) strata_resolve(_main src/program/generate.cpp) diff --git a/sycl/src/core/gguf_expert_source.cpp b/sycl/src/core/gguf_expert_source.cpp index af1bda1..2dfa488 100644 --- sycl/src/core/gguf_expert_source.cpp +++ sycl/src/core/gguf_expert_source.cpp @@ -7,7 +7,14 @@ #include <cstring> #include <utility> #include <fcntl.h> +#if defined(_WIN32) +#define WIN32_LEAN_AND_MEAN +#define NOMINMAX +#include <io.h> +#include <windows.h> +#else #include <unistd.h> +#endif #include <dpct/dpct.hpp> #include <sycl/sycl.hpp> #include <thread> @@ -16,6 +23,38 @@ namespace strata::core { namespace { constexpr size_t kRing = 512; // blobs alive at once: the prompt path holds a layer's worth of streamed experts + +// strata-win: the GGUF reads, POSIX on Linux and positional ReadFile on Windows (the SYCL port had no Windows path here). +int open_ro(const char* path) { +#if defined(_WIN32) + return ::_open(path, _O_RDONLY | _O_BINARY | _O_NOINHERIT); +#else + return ::open(path, O_RDONLY | O_CLOEXEC); +#endif +} +void close_fd(int fd) { +#if defined(_WIN32) + ::_close(fd); +#else + ::close(fd); +#endif +} +// bytes read (> 0), 0 at end of file, -1 on error +int64_t pread_at(int fd, void* dst, size_t n, uint64_t off) { +#if defined(_WIN32) + const HANDLE h = (HANDLE) ::_get_osfhandle(fd); + if (h == INVALID_HANDLE_VALUE) return -1; + OVERLAPPED ov{}; + ov.Offset = (DWORD) (off & 0xffffffffull); + ov.OffsetHigh = (DWORD) (off >> 32); + const DWORD want = (DWORD) std::min<size_t>(n, (size_t) 1 << 30); + DWORD got = 0; + if (!::ReadFile(h, dst, want, &got, &ov)) return ::GetLastError() == ERROR_HANDLE_EOF ? 0 : -1; + return (int64_t) got; +#else + return (int64_t) ::pread(fd, dst, n, (off_t) off); +#endif +} } GgufExpertSource::~GgufExpertSource() { close(); } @@ -24,7 +63,7 @@ void GgufExpertSource::close() { for (uint8_t* c : mirror_chunks_) if (c) sycl::free(c, dpct::get_in_order_queue()); mirror_chunks_.clear(); mirror_bytes_ = 0; mirror_ptr_.clear(); layer_first_.clear(); - for (int fd : fds_) if (fd >= 0) ::close(fd); + for (int fd : fds_) if (fd >= 0) close_fd(fd); fds_.clear(); names_.clear(); layer_fd_.clear(); ring_.clear(); ring_key_.clear(); where_.clear(); ring_next_ = 0; } @@ -68,7 +107,7 @@ int GgufExpertSource::fd_of(int64_t layer, int role, std::string& err) { if (lay.gguf_file.size() > i && !lay.gguf_file[i].empty()) name = dir_ + lay.gguf_file[i]; for (size_t k = 0; k < names_.size(); ++k) if (names_[k] == name) { layer_fd_[i] = (int) k; return fds_[k]; } - const int fd = ::open(name.c_str(), O_RDONLY | O_CLOEXEC); + const int fd = open_ro(name.c_str()); if (fd < 0) { err = "--stream-experts: cannot open " + name; return -1; } names_.push_back(name); fds_.push_back(fd); @@ -106,7 +145,7 @@ const uint8_t* GgufExpertSource::blob(int64_t layer, int64_t expert) { const uint64_t src = lay.gguf_off[(size_t) (3 * layer + r)] + per[r] * (uint64_t) expert; uint64_t done = 0; while (done < per[r]) { - const ssize_t n = ::pread(fd, buf.data() + at[r] + done, (size_t) (per[r] - done), (off_t) (src + done)); + const int64_t n = pread_at(fd, buf.data() + at[r] + done, (size_t) (per[r] - done), src + done); if (n <= 0) { std::lock_guard<std::mutex> lk(mu_); where_.erase(key); ring_key_[slot] = -1; return nullptr; } done += (uint64_t) n; } @@ -131,7 +170,7 @@ int64_t GgufExpertSource::mirror(const std::vector<std::pair<int64_t, int64_t>>& // Alchemist (Arc A-series) refuses a single USM host allocation past ~3 GiB (docs/INTEL.md, A750), so the mirror // is built from chunks under that. Battlemage and the CUDA/HIP builds never hit the limit, but chunking is neutral // for them. One chunk per (up to) 2 GiB of experts. - constexpr uint64_t kChunk = 2ull << 30; + constexpr uint64_t kChunk = 1ull << 30; // strata-win / chunk1g: WSL caps one zeMemAllocHost at 1 GiB std::vector<uint8_t*> chunks; // Free every chunk unless the mirror is handed over to the object: covers an allocation failure, a failed read and // any exception (a container allocation, a std::thread that cannot be created) on the way out. @@ -228,7 +267,7 @@ bool GgufExpertSource::read_into(int64_t layer, int64_t expert, uint8_t* dst, si const uint64_t src = lay.gguf_off[(size_t) (3 * layer + r)] + per[r] * (uint64_t) expert; uint64_t done = 0; while (done < per[r]) { - const ssize_t n = ::pread(fd, dst + at[r] + done, (size_t) (per[r] - done), (off_t) (src + done)); + const int64_t n = pread_at(fd, dst + at[r] + done, (size_t) (per[r] - done), src + done); if (n <= 0) return false; done += (uint64_t) n; } diff --git a/sycl/src/core/pinned.dp.cpp b/sycl/src/core/pinned.dp.cpp index 57fc68e..315583b 100644 --- sycl/src/core/pinned.dp.cpp +++ sycl/src/core/pinned.dp.cpp @@ -320,19 +320,9 @@ namespace { bool sliced_pin_limit(uint64_t& limit, std::string& why) { constexpr uint64_t GiB = 1ull << 30; char buf[256]; - int dev = 0; - cudaDeviceProp p{}; - uint64_t budget = 0, usage = 0; - std::string err = "no CUDA device properties"; - if (cudaGetDevice(&dev) == cudaSuccess && cudaGetDeviceProperties(&p, dev) == cudaSuccess && - strata::platform::gpu_shared_memory_budget(p.luid, budget, usage, err)) { - limit = budget > usage + 4 * GiB ? budget - usage - 4 * GiB : 0; - std::snprintf(buf, sizeof buf, "the GPU's shared-memory budget %.1f GiB - %.1f GiB in use - 4 GiB", - (double) budget / GiB, (double) usage / GiB); - why = buf; - return true; - } - (void) cudaGetLastError(); + // strata-win: the CUDA LUID lookup (cudaGetDeviceProperties().luid) was never migrated; the SYCL port takes the + // documented fallback below. Reached only with STRATA_ARENA_PIN_GIB=auto. + const std::string err = "no device LUID in the SYCL port"; const uint64_t ram = strata::platform::total_physical_memory(); if (ram == 0) return false; limit = ram / 2 > 8 * GiB ? ram / 2 - 8 * GiB : 0; --- sycl/src/kernels/cuda/verify_kernels.dp.cpp +++ sycl/src/kernels/cuda/verify_kernels.dp.cpp @@ -25,6 +25,9 @@ #include <stdexcept> #include <thread> #include <vector> +#if defined(_WIN32) +#undef OUT // strata-win: minwindef.h defines OUT empty; the kernels name a template parameter OUT +#endif #ifndef STRATA_PLAN_LOCAL #define STRATA_PLAN_LOCAL 1 // 0: the original one-thread plan kernel (A/B) --- sycl/src/program/generate.cpp +++ sycl/src/program/generate.cpp @@ -98,6 +98,7 @@ #include <windows.h> #include <psapi.h> #include <io.h> +#undef small // strata-win: rpcndr.h defines small as char; the chunk rules name a local small #else #include <unistd.h> #include <cerrno> @@ -132,6 +133,17 @@ #include <string> #include <set> #include <vector> +#if defined(_WIN32) +// strata-win: memmem is a GNU extension; the one caller is a load-failure diagnostic +static const void* memmem(const void* h, size_t hn, const void* n, size_t nn) { + if (nn == 0) return h; + if (hn < nn) return nullptr; + const unsigned char* p = (const unsigned char*) h; + for (size_t i = 0; i + nn <= hn; ++i) + if (std::memcmp(p + i, n, nn) == 0) return p + i; + return nullptr; +} +#endif namespace { // Windows' WDDM driver model: native Windows, or WSL2 (its GPU goes through /dev/dxg to the Windows driver). There, --- sycl/src/prefill/prefill.cpp +++ sycl/src/prefill/prefill.cpp @@ -58,6 +58,9 @@ #include <chrono> #include <stdexcept> #include <sys/stat.h> +#if defined(_WIN32) +#include <direct.h> // strata-win: _mkdir +#endif #include <tuple> #include <chrono> #include <cmath> @@ -918,7 +921,11 @@ } std::FILE* f = std::fopen(path.c_str(), "w"); if (!f) { +#if defined(_WIN32) + ::_mkdir(dir.c_str()); // strata-win: no mode argument on Windows +#else ::mkdir(dir.c_str(), 0755); +#endif f = std::fopen(path.c_str(), "w"); if (!f) return; } ``` </details> An AI helped write the comment. They were measured B70 cards.
Author
Owner

@demetree commented on GitHub (Nov 7, 2026):

Thanks @agnaylor — that is the comparison this question needed, and the copy-path explanation (WSL's /dev/dxg) matches what this branch sees: it never goes through /dev/dxg, and its numbers land far above the WSL column.

For calibration, same card (Arc Pro B70 32 GB, driver 32.0.101.8976, Windows 11 25H2), native Windows, from the windows-sycl branch in #3607 (measured on engine 0.1.56; rebuilt today at 0.1.58):

Coder IQ1_M, 256K context, all 12,288 experts resident (int8 KV with 32K resident, prefill 2048, spec 4 + MTP, STRATA_ATTN_BATCH=128):

  • decode 81.6 / 72.9 / 74.2 tok/s on the short / 4K / 16K prompts
  • prompt 1,249 / 1,444 tok/s at 4K / 16K; first token 0.61 / 3.33 / 11.39 s
  • sanity checks 12/12

IQ3_S, 32K context (the set in your comparison): 63–65 tok/s decode, 626–780 tok/s prompt at 5K–27K tokens, 68–77% expert-cache hit — with the arena path, experts in ordinary RAM and the CPU computing the cache misses. Not like-for-like with your run: you used a pinned 25.73 GiB mirror, so every miss crosses PCIe. On this card the mirror measured 40.3 tok/s on IQ3_XXS against 64.6 for the arena, and recent 0.2.x prefers the arena when the experts do not fit. I think that is most of the gap between 18.3 and 63, not a different engine. Your 1 GiB zeMemAllocHost finding is worth keeping too: it is a WSL limit, and it is why the mirror chunks at 1 GiB there.

What is not settled on Windows, so the numbers above should not be read as a finished product:

  • STRATA_VERIFY_NO_HOST=1 with the arena returns !×256 from the first token (#4698); 0 answers correctly.
  • The mirror needs 46.8 GiB pinned for IQ3_S and dies with DEVICE_LOST on this 64 GB machine.
  • The ESIMD int8 prompt attention (0.2.10+) misses qsa_prompt_attn_parity by 1.6e-4 of scale against a 1e-4 bar; FAILURES: 0 with STRATA_PROMPT_ATTN_ESIMD=0. Suspected cause is this build ignoring -ffp-contract=off under clang-cl — unconfirmed.
  • The installed app (0.2.10/0.2.11, this branch's engine bundled) hung this PC's desktop twice at hardware detection, before any engine or model started, with no driver event logged. The engine half did work: the bundle installed and Control listed it. So I can say the engine is usable from the Terminal on Windows; I would not claim the app path is ready.

The full record, and the runs behind each number: docs/INTEL_ARC.md on the branch, reports under bench/results/2026-10-30-dev-256k-standard-v1*. ctest 83 of 85 (the Q2_0 fixture and the ESIMD case), test_setup_sycl 52/52.

The decision is still #5236: merge a port, publish a preview component, or defer until Windows hardware is on the maintainer's bench. Your data point argues for the second, and the patch you attached is the cheapest form of it.

<!-- gh-comment-id:6710825566 --> @demetree commented on GitHub (Nov 7, 2026): Thanks @agnaylor — that is the comparison this question needed, and the copy-path explanation (WSL's `/dev/dxg`) matches what this branch sees: it never goes through `/dev/dxg`, and its numbers land far above the WSL column. For calibration, same card (Arc Pro B70 32 GB, driver 32.0.101.8976, Windows 11 25H2), native Windows, from the `windows-sycl` branch in #3607 (measured on engine 0.1.56; rebuilt today at 0.1.58): **Coder IQ1_M, 256K context, all 12,288 experts resident** (int8 KV with 32K resident, prefill 2048, spec 4 + MTP, `STRATA_ATTN_BATCH=128`): - decode **81.6 / 72.9 / 74.2 tok/s** on the short / 4K / 16K prompts - prompt **1,249 / 1,444 tok/s** at 4K / 16K; first token 0.61 / 3.33 / 11.39 s - sanity checks 12/12 **IQ3_S, 32K context** (the set in your comparison): **63–65 tok/s decode**, 626–780 tok/s prompt at 5K–27K tokens, 68–77% expert-cache hit — with the **arena** path, experts in ordinary RAM and the CPU computing the cache misses. Not like-for-like with your run: you used a pinned 25.73 GiB mirror, so every miss crosses PCIe. On this card the mirror measured **40.3 tok/s** on IQ3_XXS against **64.6** for the arena, and recent 0.2.x prefers the arena when the experts do not fit. I think that is most of the gap between 18.3 and 63, not a different engine. Your 1 GiB `zeMemAllocHost` finding is worth keeping too: it is a WSL limit, and it is why the mirror chunks at 1 GiB there. What is *not* settled on Windows, so the numbers above should not be read as a finished product: - `STRATA_VERIFY_NO_HOST=1` with the arena returns `!`×256 from the first token (#4698); `0` answers correctly. - The mirror needs 46.8 GiB pinned for IQ3_S and dies with `DEVICE_LOST` on this 64 GB machine. - The ESIMD int8 prompt attention (0.2.10+) misses `qsa_prompt_attn_parity` by 1.6e-4 of scale against a 1e-4 bar; `FAILURES: 0` with `STRATA_PROMPT_ATTN_ESIMD=0`. Suspected cause is this build ignoring `-ffp-contract=off` under clang-cl — unconfirmed. - The installed app (0.2.10/0.2.11, this branch's engine bundled) hung this PC's desktop twice at hardware detection, before any engine or model started, with no driver event logged. The engine half did work: the bundle installed and Control listed it. So I can say the engine is usable from the Terminal on Windows; I would not claim the app path is ready. The full record, and the runs behind each number: `docs/INTEL_ARC.md` on the branch, reports under `bench/results/2026-10-30-dev-256k-standard-v1*`. ctest 83 of 85 (the Q2_0 fixture and the ESIMD case), `test_setup_sycl` 52/52. The decision is still #5236: merge a port, publish a preview component, or defer until Windows hardware is on the maintainer's bench. Your data point argues for the second, and the patch you attached is the cheapest form of it.
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#3113
No description provided.