[PR #4635] [Engine] SYCL: opt-in IQ2_XXS fused int8 prompt experts #5123

Open
opened 2026-11-07 16:32:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4635
Author: @pankleks
Created: 10/29/2026
Status: 🔄 Open

Base: main ← Head: feat/sycl-iq2xxs-int8-opt-in


📝 Commits (1)

  • 0bc4a7d [Engine] add opt-in IQ2_XXS SYCL prompt experts

📊 Changes

8 files changed (+202 additions, -14 deletions)

View changed files

📝 docs/INTEL_INT8_EXPERTS.md (+12 -0)
📝 sycl/CMakeLists.txt (+18 -0)
📝 sycl/include/strata/prefill/esimd_moe.hpp (+12 -0)
➕ sycl/src/kernels/esimd_iq2xxs_optin_test.cpp (+19 -0)
📝 sycl/src/kernels/esimd_moe_parity.cpp (+27 -3)
📝 sycl/src/prefill/esimd_moe.dp.cpp (+42 -9)
➕ sycl/src/prefill/iq2xxs_grid.inc (+69 -0)
📝 sycl/src/prefill/prefill.cpp (+3 -2)

📄 Description

Problem and result

IQ2_XXS gate/up experts cannot use the SYCL fused int8 prompt-expert path, so they materialize FP16 weights before oneMKL products. This adds default-off IQ2_XXS/type-16 coverage with STRATA_SYCL_IQ2_XXS_I8=1, keeping the existing crossover/fallback rules. IQ2_XS is not included.

Draft, not requesting merge/review readiness: maintainer scope agreement is pending in #4615. Exact-head build and kernel validation passed; submitted-head full-model validation remains outstanding. Historical measurements below must not be read as performance results for this submission revision.

  • Scope proposal and detailed prototype evidence: #4615. No maintainer approval has been given as of opening this draft.
  • #2584 concerns FP16 pairing/bounded conversion; #2802 concerns routed-expert decode. This is a different, opt-in prompt-format extension, not a replacement or resubmission of those proposals.
  • The private full-model test builds included the separate #3805 host-job guard. That guard, local telemetry/collector fixes and the copy-completion experiment are excluded from this diff.

Approach

Decode the IQ2_XXS 8-value grids, sign IDs and 32-value scales into the existing ESIMD s8 DPAS operand. This avoids the expanded FP16 weight matrices rather than caching them (9.375 MiB per expert at the tested model shape).

  • Exact opt-in value 1; unset/0/other strings keep the old format set. STRATA_PREFILL_MMQ=0 still selects FP16 everywhere.
  • Existing availability, shape and automatic per-device crossover checks remain. Existing IQ4_NL/Q2_0 down products are reused.
  • Uses the non-work-group decoder, bounds-clamped dword reads, and a 2 KiB opt-in codebook per device copied from pinned ggml.
  • Adds a scalar numerical reference, signed/zero/subnormal-scale cases, CTest registration for both down formats and host-only opt-in/refusal checks.
  • Short usage note; no debug logging, private host paths, model weights, operational patches or benchmark dumps.

Activations are quantized as in the existing int8 path. This is not a bitwise-equivalent FP16 optimization; answers can differ in wording. No executable default is changed.

Validation

Submission: 0bc4a7d13085035dc249f4d94da53a86d08894e6, based on upstream 46c152a1310f77cd2f0ce2c7cd213962df14fe83.

Passed

  • Clean patch applied to the stated base; full diff and git show --check reviewed. Only separate SYCL implementation/test/build files and its component documentation changed.
  • Clean exact-head SYCL Release/JIT build passed on Ubuntu 26.04.1 / oneAPI 2026.1, dual Arc Pro B50 machine. Built strata, esimd_moe_parity, esimd_iq2xxs_optin_test, esimd_moe_mode_test, quantize_act_parity, iq_multi_parity at the submission commit above. No local production patches were added.
  • 7/7 host CTests passed, exact submission revision: unset flag, 0, false, 01, 11, 1, and existing mode-choice test.
  • Both B50s passed exact-head hardware checks: 5/5 selected CTests per card (existing six-format esimd_moe_parity, IQ2_XXS with IQ4_NL and Q2_0 down, quantize_act_parity, iq_multi_parity), none skipped; plus 24 direct numerical cases covering both down formats, MT 2/4/8, GRF 128/256, seed 20261029. Zero failed commands. Production's deployed older release was gracefully restored and its config/unit/binary/collector/profile hashes and both enabled local flags verified; no new kernel wedge/reset or Strata segfault was observed in the boot log.

Exact-head commands executed in the oneAPI environment (source/build paths below are portable placeholders):

cmake -S "$SRC/sycl" -B "$BUILD" -G Ninja -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DSTRATA_SYCL_AOT= \
  -DSTRATA_SYCL_JIT_STATELESS=ON -DSTRATA_GGML_DIR="$GGML"
cmake --build "$BUILD" --target strata esimd_moe_parity esimd_iq2xxs_optin_test \
  esimd_moe_mode_test quantize_act_parity iq_multi_parity --parallel 4
ctest --test-dir "$BUILD" -R '^esimd_(iq2xxs_(unset|flag_.*)|moe_mode_test)$' --output-on-failure
# Repeat with GPU=0 and GPU=1:
ONEAPI_DEVICE_SELECTOR=level_zero:$GPU SYCL_CACHE_PERSISTENT=0 \
  ctest --test-dir "$BUILD" \
  -R '^(esimd_moe_parity|esimd_moe_iq2xxs_(20|42)|quantize_act_parity|iq_multi_parity)$' --output-on-failure
# For each GPU, DOWN=20/42, MT=2/4/8 and GRF=128/256:
ONEAPI_DEVICE_SELECTOR=level_zero:$GPU SYCL_CACHE_PERSISTENT=0 \
  STRATA_SYCL_IQ2_XXS_I8=1 STRATA_I8_MT=$MT STRATA_I8_GRF=$GRF \
  "$BUILD/esimd_moe_parity" 64 4 2 20261029 16 "$DOWN"

SRC was a clean checkout of the full submitted commit above. GGML was pinned dependency 3cf03257f219afbe7334045ff7c6a06ac68c627d. Hardware phase 2026-10-29 19:24:52–19:27:56 UTC, Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, Ryzen 9 5950X, two Arc Pro B50 16 GiB, xe/Level Zero driver 1.14.37020, oneAPI 2026.1. No AOT or full-model test was performed on the clean submitted head.

Historical private-prototype evidence, not validation of the submitted revision

Older tested code: fa663fabc5c2c568d6035b3ae853b38e1762865a (0.2.5 / engine 0.1.50), with unchanged host-job and telemetry fixes in both arms. The IQ2_XXS prototype-only patch SHA-256 was d8f13818de369789f2ff95c524943b780e0db3850d00df5c0024c25c81aa7696; its executable SHA-256 was 3027f82fe3b9eae696b42862962b42d9ca3407465292f7072a539ac189fc20c8. #4615 retains the first campaign's individual samples, settings and failures.

  • 56 numerical cases across both B50s, including real expert weights and MT 2/4/8, GRF 128/256; existing quantization/IQ GPU parity checks passed.
  • Later four-mode tests separated IQ2_XXS from the copy-event experiment using the same candidate binary. Three fresh-engine runs per arm/workload, alternating mode order, excluded warm-ups, temperature 0, seed 20261029, thinking off, 128 output tokens and cache_n=0. IQ2_XXS-only versus both flags off median prompt throughput:
Hardware Prose, tok/s Code, tok/s 1K, tok/s 4K, tok/s
1× Arc Pro B70 121.3 → 130.2 (+7.3%) 147.3 → 162.2 (+10.1%) 628.6 → 671.7 (+6.9%) 1244.3 → 1294.6 (+4.0%)
2× Arc Pro B50 70.9 → 74.3 (+4.8%) 77.9 → 83.5 (+7.2%) 359.2 → 380.6 (+6.0%) 498.8 → 516.2 (+3.5%)

Actual prompt lengths 96/105/1007/4074. B70: AOT bmg-g31, prefill 4096, balanced PL/EN profile, mirror 22528 MiB, NO_HOST=1, power on, 32 GiB service limit. B50 pair: JIT, split 25, prefill 1024, original SYCL profile, mirror 12288 MiB, NO_HOST=0, power auto, 40 GiB service limit. Same IQ3_XXS model and 262144 configured context, INT8 KV/resident 32768, spec 4/min-p 0.5; profile and settings unchanged within each comparison. Model source revision/full GGUF hashes were not recorded; profile hashes and detailed first-campaign settings are in #4615. The B70 and B50 numbers are not a controlled comparison between machines.

  • Decode changes were mixed; only 4/12 B70 and 2/12 B50 paired IQ2_XXS outputs matched exactly, so no same-output decode speed-up is claimed.
  • Original/private-off/private-on smoke controls each scored 19/20 on each host, with the same host-specific failure in every arm. Small teacher-forced probes were close to baseline; not general quality equivalence or full-vocabulary KL.
  • The older private build with both local patches later passed bounded production-style API/tools/CPU vision and sampler-refresh-aware unload/reload checks on both hosts and was deployed there with approval. That is not evidence of standalone clean-PR-head full-model compatibility. No long stability soak was done.

Failed / corrected in historical testing

Clean submitted-head build/kernel campaign: none observed; all selected tests passed.

The initial private compile lacked the copied codebook; corrected before GPU execution. A private smoke scorer originally decoded the terminal end token as answer text; stored token IDs were rescored using the server's stop-token rule without changing answers or expectations. Immediate post-unload telemetry assertions saw the one-second sampler's cached loaded snapshot; separate refresh-aware checks passed. These harness failures and raw results were retained; no production telemetry fix was needed.

Not run

  • Submitted-head full-model performance, comprehensive default-path byte identity, HTTP/vision integration, independent quality corpus or a long soak.
  • Requests above 4K in the bounded cross-tests; concurrency; other GPU generations/Windows.
  • CUDA/HIP/Metal builds: their source is untouched. No hardware/compatibility claim for those backends.

Limits

Please keep this draft until scope is agreed and the validation gap is acceptable. Historical gains motivate the patch; they do not establish this clean newer revision's speed or broad quality. The B50 machine has a known long-load wedge history; no new fault was seen in the short private validation, which is not proof of sustained stability.

AI-assisted implementation and test execution in OpenCode on the submitter's hardware. The clean submission intentionally excludes all unrelated production changes.


🔄 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/4635 **Author:** [@pankleks](https://github.com/pankleks) **Created:** 10/29/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/sycl-iq2xxs-int8-opt-in` --- ### 📝 Commits (1) - [`0bc4a7d`](https://github.com/Niko1221/Strata/commit/0bc4a7d13085035dc249f4d94da53a86d08894e6) [Engine] add opt-in IQ2_XXS SYCL prompt experts ### 📊 Changes **8 files changed** (+202 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `docs/INTEL_INT8_EXPERTS.md` (+12 -0) 📝 `sycl/CMakeLists.txt` (+18 -0) 📝 `sycl/include/strata/prefill/esimd_moe.hpp` (+12 -0) ➕ `sycl/src/kernels/esimd_iq2xxs_optin_test.cpp` (+19 -0) 📝 `sycl/src/kernels/esimd_moe_parity.cpp` (+27 -3) 📝 `sycl/src/prefill/esimd_moe.dp.cpp` (+42 -9) ➕ `sycl/src/prefill/iq2xxs_grid.inc` (+69 -0) 📝 `sycl/src/prefill/prefill.cpp` (+3 -2) </details> ### 📄 Description ## Problem and result IQ2_XXS gate/up experts cannot use the SYCL fused int8 prompt-expert path, so they materialize FP16 weights before oneMKL products. This adds **default-off IQ2_XXS/type-16 coverage** with `STRATA_SYCL_IQ2_XXS_I8=1`, keeping the existing crossover/fallback rules. IQ2_XS is not included. **Draft, not requesting merge/review readiness:** maintainer scope agreement is pending in #4615. Exact-head build and kernel validation passed; submitted-head full-model validation remains outstanding. Historical measurements below must not be read as performance results for this submission revision. ## Related discussion - Scope proposal and detailed prototype evidence: #4615. No maintainer approval has been given as of opening this draft. - #2584 concerns FP16 pairing/bounded conversion; #2802 concerns routed-expert decode. This is a different, opt-in prompt-format extension, not a replacement or resubmission of those proposals. - The private full-model test builds included the separate #3805 host-job guard. **That guard, local telemetry/collector fixes and the copy-completion experiment are excluded from this diff.** ## Approach Decode the IQ2_XXS 8-value grids, sign IDs and 32-value scales into the existing ESIMD s8 DPAS operand. This avoids the expanded FP16 weight matrices rather than caching them (9.375 MiB per expert at the tested model shape). - Exact opt-in value `1`; unset/0/other strings keep the old format set. `STRATA_PREFILL_MMQ=0` still selects FP16 everywhere. - Existing availability, shape and automatic per-device crossover checks remain. Existing IQ4_NL/Q2_0 down products are reused. - Uses the non-work-group decoder, bounds-clamped dword reads, and a 2 KiB opt-in codebook per device copied from pinned ggml. - Adds a scalar numerical reference, signed/zero/subnormal-scale cases, CTest registration for both down formats and host-only opt-in/refusal checks. - Short usage note; no debug logging, private host paths, model weights, operational patches or benchmark dumps. Activations are quantized as in the existing int8 path. **This is not a bitwise-equivalent FP16 optimization; answers can differ in wording.** No executable default is changed. ## Validation Submission: `0bc4a7d13085035dc249f4d94da53a86d08894e6`, based on upstream `46c152a1310f77cd2f0ce2c7cd213962df14fe83`. ### Passed - Clean patch applied to the stated base; full diff and `git show --check` reviewed. Only separate SYCL implementation/test/build files and its component documentation changed. - **Clean exact-head SYCL Release/JIT build passed** on Ubuntu 26.04.1 / oneAPI 2026.1, dual Arc Pro B50 machine. Built `strata`, `esimd_moe_parity`, `esimd_iq2xxs_optin_test`, `esimd_moe_mode_test`, `quantize_act_parity`, `iq_multi_parity` at the submission commit above. No local production patches were added. - **7/7 host CTests passed**, exact submission revision: unset flag, `0`, `false`, `01`, `11`, `1`, and existing mode-choice test. - **Both B50s passed exact-head hardware checks:** 5/5 selected CTests per card (existing six-format `esimd_moe_parity`, IQ2_XXS with IQ4_NL and Q2_0 down, `quantize_act_parity`, `iq_multi_parity`), none skipped; plus 24 direct numerical cases covering both down formats, MT 2/4/8, GRF 128/256, seed 20261029. Zero failed commands. Production's deployed older release was gracefully restored and its config/unit/binary/collector/profile hashes and both enabled local flags verified; no new kernel wedge/reset or Strata segfault was observed in the boot log. Exact-head commands executed in the oneAPI environment (source/build paths below are portable placeholders): ```sh cmake -S "$SRC/sycl" -B "$BUILD" -G Ninja -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DSTRATA_SYCL_AOT= \ -DSTRATA_SYCL_JIT_STATELESS=ON -DSTRATA_GGML_DIR="$GGML" cmake --build "$BUILD" --target strata esimd_moe_parity esimd_iq2xxs_optin_test \ esimd_moe_mode_test quantize_act_parity iq_multi_parity --parallel 4 ctest --test-dir "$BUILD" -R '^esimd_(iq2xxs_(unset|flag_.*)|moe_mode_test)$' --output-on-failure # Repeat with GPU=0 and GPU=1: ONEAPI_DEVICE_SELECTOR=level_zero:$GPU SYCL_CACHE_PERSISTENT=0 \ ctest --test-dir "$BUILD" \ -R '^(esimd_moe_parity|esimd_moe_iq2xxs_(20|42)|quantize_act_parity|iq_multi_parity)$' --output-on-failure # For each GPU, DOWN=20/42, MT=2/4/8 and GRF=128/256: ONEAPI_DEVICE_SELECTOR=level_zero:$GPU SYCL_CACHE_PERSISTENT=0 \ STRATA_SYCL_IQ2_XXS_I8=1 STRATA_I8_MT=$MT STRATA_I8_GRF=$GRF \ "$BUILD/esimd_moe_parity" 64 4 2 20261029 16 "$DOWN" ``` `SRC` was a clean checkout of the full submitted commit above. `GGML` was pinned dependency `3cf03257f219afbe7334045ff7c6a06ac68c627d`. Hardware phase 2026-10-29 19:24:52–19:27:56 UTC, Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, Ryzen 9 5950X, two Arc Pro B50 16 GiB, xe/Level Zero driver 1.14.37020, oneAPI 2026.1. No AOT or full-model test was performed on the clean submitted head. ### Historical private-prototype evidence, not validation of the submitted revision Older tested code: `fa663fabc5c2c568d6035b3ae853b38e1762865a` (0.2.5 / engine 0.1.50), with unchanged host-job and telemetry fixes in both arms. The IQ2_XXS prototype-only patch SHA-256 was `d8f13818de369789f2ff95c524943b780e0db3850d00df5c0024c25c81aa7696`; its executable SHA-256 was `3027f82fe3b9eae696b42862962b42d9ca3407465292f7072a539ac189fc20c8`. #4615 retains the first campaign's individual samples, settings and failures. - 56 numerical cases across both B50s, including real expert weights and MT 2/4/8, GRF 128/256; existing quantization/IQ GPU parity checks passed. - Later four-mode tests separated IQ2_XXS from the copy-event experiment using the same candidate binary. Three fresh-engine runs per arm/workload, alternating mode order, excluded warm-ups, temperature 0, seed 20261029, thinking off, 128 output tokens and `cache_n=0`. **IQ2_XXS-only versus both flags off** median prompt throughput: | Hardware | Prose, tok/s | Code, tok/s | 1K, tok/s | 4K, tok/s | |---|---:|---:|---:|---:| | 1× Arc Pro B70 | 121.3 → 130.2 (+7.3%) | 147.3 → 162.2 (+10.1%) | 628.6 → 671.7 (+6.9%) | 1244.3 → 1294.6 (+4.0%) | | 2× Arc Pro B50 | 70.9 → 74.3 (+4.8%) | 77.9 → 83.5 (+7.2%) | 359.2 → 380.6 (+6.0%) | 498.8 → 516.2 (+3.5%) | Actual prompt lengths 96/105/1007/4074. B70: AOT bmg-g31, prefill 4096, balanced PL/EN profile, mirror 22528 MiB, NO_HOST=1, power `on`, 32 GiB service limit. B50 pair: JIT, split 25, prefill 1024, original SYCL profile, mirror 12288 MiB, NO_HOST=0, power `auto`, 40 GiB service limit. Same IQ3_XXS model and 262144 configured context, INT8 KV/resident 32768, spec 4/min-p 0.5; profile and settings unchanged within each comparison. Model source revision/full GGUF hashes were not recorded; profile hashes and detailed first-campaign settings are in #4615. The B70 and B50 numbers are not a controlled comparison between machines. - Decode changes were mixed; only 4/12 B70 and 2/12 B50 paired IQ2_XXS outputs matched exactly, so **no same-output decode speed-up is claimed**. - Original/private-off/private-on smoke controls each scored 19/20 on each host, with the same host-specific failure in every arm. Small teacher-forced probes were close to baseline; not general quality equivalence or full-vocabulary KL. - The older private build with **both local patches** later passed bounded production-style API/tools/CPU vision and sampler-refresh-aware unload/reload checks on both hosts and was deployed there with approval. That is not evidence of standalone clean-PR-head full-model compatibility. No long stability soak was done. ### Failed / corrected in historical testing **Clean submitted-head build/kernel campaign:** none observed; all selected tests passed. The initial private compile lacked the copied codebook; corrected before GPU execution. A private smoke scorer originally decoded the terminal end token as answer text; stored token IDs were rescored using the server's stop-token rule without changing answers or expectations. Immediate post-unload telemetry assertions saw the one-second sampler's cached loaded snapshot; separate refresh-aware checks passed. These harness failures and raw results were retained; no production telemetry fix was needed. ### Not run - Submitted-head full-model performance, comprehensive default-path byte identity, HTTP/vision integration, independent quality corpus or a long soak. - Requests above 4K in the bounded cross-tests; concurrency; other GPU generations/Windows. - CUDA/HIP/Metal builds: their source is untouched. No hardware/compatibility claim for those backends. ## Limits Please keep this draft until scope is agreed and the validation gap is acceptable. Historical gains motivate the patch; they do not establish this clean newer revision's speed or broad quality. The B50 machine has a known long-load wedge history; no new fault was seen in the short private validation, which is not proof of sustained stability. AI-assisted implementation and test execution in OpenCode on the submitter's hardware. The clean submission intentionally excludes all unrelated production changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5123
No description provided.