Skip to content

sycl: follow #626 (ThreadAffinity) and #559 (NativeDense::load layer range) so v0.1.39 compiles - #784

Closed
sarashin65 wants to merge 1 commit into
Niko1221:mainfrom
sarashin65:sycl-build-0139
Closed

sarashin65 wants to merge 1 commit into
Niko1221:mainfrom
sarashin65:sycl-build-0139

Conversation

@sarashin65

Copy link
Copy Markdown
Contributor

What this fixes

The v0.1.39 tag does not compile on the Intel (SYCL) side. The port went in as 5047172 ("sycl: port 0.1.39"); two engine-side changes were merged into the release branch after it (cb97e6c, 1189218) and nothing in sycl/ was updated for them.

Three compile errors, 3 files, 11 insertions / 5 deletions:

Engine change What it broke in sycl/
#626 ec35cf0 - the thread affinity became a value (pin_current_thread() returns strata::kernels::cpu::ThreadAffinity, restore_thread_affinity() takes one) sycl/include/strata/core/session.hpp still stored a long long and did not include the header that names the type; sycl/src/core/session.cpp still assigned the returned struct to it and passed the long long back. session.cpp:786 / :801
#559 ba707d8 - the two layer-range arguments were added to NativeDense::load the out-of-line definition in sycl/src/core/native_dense.cpp:87 was still the 4-argument one, so it matched no declaration in include/strata/core/native_dense.hpp:24

A plain cmake --build stops at the first one:

sycl/src/core/session.cpp:786:23: error: assigning to 'long long' from incompatible type 'ThreadAffinity'
sycl/src/core/session.cpp:801:55: error: reference to type 'const ThreadAffinity' could not bind to an lvalue of type 'long long'
sycl/src/core/native_dense.cpp:87:19: error: out-of-line definition of 'load' does not match any declaration in 'strata::core::NativeDense'

The third error is independent of the first two: it appears with -- -k 0, or once the first two are fixed.

Both files are corrected by mirroring the CUDA sources: the same member type, the same outside() predicate, and the same place it is applied in the tensor loop (if (!eligible(tensor, include_ple_key) || outside(tensor.name)) continue;).

Three notes for review:

  • pinned now follows CUDA as well: it is pinned_core.valid (src/core/session.cpp:550), so a pin that failed is not "restored". Nothing changes when the pin succeeds.
  • No caller passes layer_lo/layer_hi yet (src/program/generate.cpp:2268,2596; sycl/src/program/generate.cpp:2366,2750), so outside() is never true today. This restores the build; it does not change what the engine computes.
  • docs/INTEL.md keeps the copies up to date by re-migration. This is the same change a re-migration would merge in, so a later re-migration should merge over it cleanly (no sycl/tools/fixups.py entry needed).

For anyone reading the port's own history: the "0 errors, 157 targets" in docs/INTEL_ARC.md was written on the branch before those two merges (da3e9a1), so it is not a contradiction.

How it was checked

  • Arch Linux, Intel oneAPI DPC++ 2026.0.0 + oneMKL 2026.0 (the port's docs used 2026.1.1).
  • cmake -S sycl -B build-sycl -G Ninja -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx, SPIR-V (JIT).
  • cmake --build build-sycl --target strata -- -k 0 -> 0 errors, links.

The two mismatches are a type and a declaration mismatch, so the compiler version does not matter.

Not covered

  • The other targets (kernel parity tests, benches) and the AOT path were not built; only --target strata.
  • Not run on an Arc in this PR.
  • Not part of this PR: declarations in 10 shared headers that the port does not define yet (core/layer.hpp moe_route_window, the const QsaState* draft overloads in core/conversation_snapshot.hpp, kernels/bf16_gemv.hpp, kernels/elementwise.hpp, kernels/fused_gr.hpp, kernels/iq_kernels.hpp, kernels/ple.hpp, kernels/shared_expert.hpp, prefill/kernels.hpp, prefill/prefill.hpp). Nothing in sycl/ calls them, so it links. I can list them in an issue.

…nse::load layer range) so v0.1.39 compiles

The sycl port went in as 5047172 ("sycl: port 0.1.39"). Two engine-side changes
were merged into the release branch after it (cb97e6c, 1189218) and nothing in
sycl/ was updated for them, so the v0.1.39 tag does not compile:

- Niko1221#626 (ec35cf0) made the thread affinity a value: pin_current_thread()
  returns strata::kernels::cpu::ThreadAffinity and restore_thread_affinity()
  takes it. sycl/include/strata/core/session.hpp still stored a `long long`
  (no conversion exists, and it did not include the header that names the
  type); sycl/src/core/session.cpp still assigned the returned struct to it
  and passed the `long long` back.
- Niko1221#559 (ba707d8) added the two layer-range arguments to NativeDense::load.
  The sycl out-of-line definition was still the 4-argument one and no longer
  matched the declaration in include/strata/core/native_dense.hpp.

Both are fixed by mirroring the CUDA sources: the same member type, the same
`outside()` predicate, and the same place it is applied in the tensor loop.

`pinned` now follows CUDA as well: it is pinned_core.valid, so a pin that
failed is not "restored". Nothing changes when the pin succeeds.

No caller passes layer_lo/layer_hi yet, so `outside()` is never true today:
this restores the build and does not change what the engine computes.

Measured here: Arch Linux, Intel oneAPI DPC++ 2026.0.0 + oneMKL 2026.0,
SPIR-V (JIT), cmake -S sycl -B build-sycl -G Ninja -DCMAKE_C_COMPILER=icx
-DCMAKE_CXX_COMPILER=icpx, then
`cmake --build build-sycl --target strata -- -k 0` -> 0 errors, links. The two
errors are a type and a declaration mismatch, so the compiler version does not
matter.

Not built here: the other targets (kernel parity tests, benches) and the AOT
path. Not run on an Arc in this change.
@LocalXPU

LocalXPU commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Confirming this on a second card: at 6f32ec0 the three errors reproduce (session.cpp:786, session.cpp:801, native_dense.cpp:87) with oneAPI DPC++ 2026.1.1, and a three-file change like this one builds sycl/ clean with AOT bmg-g21 (all targets, 0 errors) on an Arc Pro B60. Nothing in the result changes at runtime, as the description says: with the change, the Coder IQ1_M and Flash-Next IQ2_XS run on two B60s with --layer-split. It would help if this or #809 went in, since a fresh checkout of main does not build the Intel engine.

Niko1221 added a commit that referenced this pull request Oct 6, 2026
The 0.1.39 paragraph said nobody had run the 0.1.39 port on an Arc. Two Arc Pro B60 reports (#867, #870) did, with
the two sycl/ fixes now in 0.1.40 (#784 the compile fix, #866 the ring wait). Say that, and that an unpatched 0.1.39
port did not compile against its own engine sources.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Niko1221 added a commit that referenced this pull request Oct 6, 2026
…Arc Pro B60 also as PCI id e211 (#870)

Fixes 1 and 4 of #870, plus a test that every function setup_intel.py swaps into setup.py accepts all of the original's parameters. Fixes 2 and 3 are PR #784's session/native_dense ports.

Co-authored-by: Magh97 <Magh97@users.noreply.github.com>

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Niko1221

Niko1221 commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Fixed in 0.1.40: merged, so sycl/ compiles against the 0.1.39 engine sources again (ThreadAffinity, the NativeDense::load layer range). Compile-checked with oneAPI 2026.1 in WSL; not run on an Arc by us.

@Niko1221 Niko1221 closed this Oct 6, 2026
Niko1221 added a commit that referenced this pull request Oct 6, 2026
The 0.1.39 paragraph said nobody had run the 0.1.39 port on an Arc. Two Arc Pro B60 reports (#867, #870) did, with
the two sycl/ fixes now in 0.1.40 (#784 the compile fix, #866 the ring wait). Say that, and that an unpatched 0.1.39
port did not compile against its own engine sources.
Niko1221 added a commit that referenced this pull request Oct 6, 2026
…Arc Pro B60 also as PCI id e211 (#870)

Fixes 1 and 4 of #870, plus a test that every function setup_intel.py swaps into setup.py accepts all of the original's parameters. Fixes 2 and 3 are PR #784's session/native_dense ports.

Co-authored-by: Magh97 <Magh97@users.noreply.github.com>
anon761 pushed a commit to anon761/Strata-upstream that referenced this pull request Oct 6, 2026
The 0.1.39 paragraph said nobody had run the 0.1.39 port on an Arc. Two Arc Pro B60 reports (Niko1221#867, Niko1221#870) did, with
the two sycl/ fixes now in 0.1.40 (Niko1221#784 the compile fix, Niko1221#866 the ring wait). Say that, and that an unpatched 0.1.39
port did not compile against its own engine sources.
anon761 pushed a commit to anon761/Strata-upstream that referenced this pull request Oct 6, 2026
…Arc Pro B60 also as PCI id e211 (Niko1221#870)

Fixes 1 and 4 of Niko1221#870, plus a test that every function setup_intel.py swaps into setup.py accepts all of the original's parameters. Fixes 2 and 3 are PR Niko1221#784's session/native_dense ports.

Co-authored-by: Magh97 <Magh97@users.noreply.github.com>
Syakyr added a commit to Syakyr/Strata that referenced this pull request Oct 7, 2026
…rc-docker

The SYCL port at 0.1.40 does not build as shipped. This is reported upstream:

  Niko1221#1113  sycl: the v0.1.40.1 port does not build as shipped
         (3 compile errors, 12 undefined symbols)
  Niko1221#1248  SYCL build fails on Intel Arc A770 - same two errors, same commit

Upstream main has no CI at all (no .github/workflows directory), so the port is
never built before release and has drifted from the shared headers every version -
Niko1221#784 did the same job for 0.1.39, Niko1221#1111 does it for 0.1.40.

We are building on maxfridbe's work rather than hand-patching. PR Niko1221#1111 re-migrates
the port with dpct and 3-way merges it against 5047172, the commit it was migrated
from: 175 conflicts resolved, three files hand-ported (verify.cpp, mtp.cpp,
native_expert_parity.cpp), dpct's mistranslations listed in docs/INTEL.md.

Conflict resolution: the only two conflicts were sycl/src/core/expert_source.cpp
and sycl/src/kernels/cuda/fused_gr.dp.cpp - the two files this branch had
hand-patched to get past the first errors. We took THEIRS in both. Their
re-migration is the real fix; our hand-edits were stopgaps at individual
signatures and are superseded. Verified after the merge:

  fused_gr_read_multi    -> bool   (matches include/strata/kernels/fused_gr.hpp:59)
  load_experts_gguf      -> 6 params with const std::atomic<int>* ready
                            (matches include/strata/core/expert_source.hpp:767)

sycl/setup_intel.py auto-merged cleanly: this branch's STRATA_SYCL_NATIVE /
STRATA_INTEL_GPUS native run mode is intact alongside their changes.

Credit: the port refresh is maxfridbe's, not ours. See
Niko1221#1111
sskver pushed a commit to sskver/Strata that referenced this pull request Oct 7, 2026
The 0.1.39 paragraph said nobody had run the 0.1.39 port on an Arc. Two Arc Pro B60 reports (Niko1221#867, Niko1221#870) did, with
the two sycl/ fixes now in 0.1.40 (Niko1221#784 the compile fix, Niko1221#866 the ring wait). Say that, and that an unpatched 0.1.39
port did not compile against its own engine sources.
sskver pushed a commit to sskver/Strata that referenced this pull request Oct 7, 2026
…Arc Pro B60 also as PCI id e211 (Niko1221#870)

Fixes 1 and 4 of Niko1221#870, plus a test that every function setup_intel.py swaps into setup.py accepts all of the original's parameters. Fixes 2 and 3 are PR Niko1221#784's session/native_dense ports.

Co-authored-by: Magh97 <Magh97@users.noreply.github.com>
Jumbomuffin777 pushed a commit to Jumbomuffin777/Strata-Void that referenced this pull request Oct 8, 2026
…Arc Pro B60 also as PCI id e211 (Niko1221#870)

Fixes 1 and 4 of Niko1221#870, plus a test that every function setup_intel.py swaps into setup.py accepts all of the original's parameters. Fixes 2 and 3 are PR Niko1221#784's session/native_dense ports.

Co-authored-by: Magh97 <Magh97@users.noreply.github.com>
(cherry picked from commit b72ea67)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants