[PR #4185] [Engine] [SYCL] opt-in mixed-IQ3 decode optimizations on Battlemage #4938

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4185
Author: @glorysdj
Created: 10/26/2026
Status: 🔄 Open

Base: main ← Head: iq3/upstream-positive-20261026


📝 Commits (3)

  • 961f629 sycl: isolate opt-in mixed-IQ3 decode optimizations
  • 0726ef5 Preserve upstream sign decoding when fast arithmetic is disabled
  • aaf18a4 docs: record rebased B70 IQ3 decode and default-off results

📊 Changes

12 files changed (+1009 additions, -101 deletions)

View changed files

📝 docs/INTEL.md (+57 -0)
📝 sycl/CMakeLists.txt (+12 -0)
➕ sycl/include/strata/kernels/iq4_lut.hpp (+28 -0)
📝 sycl/src/kernels/cuda/fused_gr.dp.cpp (+109 -11)
📝 sycl/src/kernels/cuda/iq_kernels.dp.cpp (+465 -27)
📝 sycl/src/kernels/cuda/native_mmvq.dp.cpp (+50 -2)
📝 sycl/src/kernels/cuda/qsa_decode_attn.dp.cpp (+88 -9)
📝 sycl/src/kernels/cuda/verify_kernels.dp.cpp (+55 -12)
📝 sycl/src/kernels/fused_gr_bench.cpp (+10 -2)
📝 sycl/src/kernels/gdn_parity.cpp (+39 -0)
📝 sycl/src/kernels/native_expert_bench.cpp (+46 -34)
📝 sycl/src/kernels/qsa_prompt_attn_parity.cpp (+50 -4)

📄 Description

Problem and result

  • Problem: The native mixed-IQ3 decode path on one Arc Pro B70 repeats weight-code expansion, input preparation, projection and attention-merge work. This patch retains production-covered decode optimizations, not the profiling framework or unsuccessful prefill experiments.
  • Environment: Upstream 4b9e05a2a806a3fe24f7b2560d98626c37dade35, final measured candidate 0726ef5a on branch iq3/upstream-positive-20261026. One B70 at 0000:36:00.0, oneAPI 2026.1, AOT bmg-g31, level_zero:1; cpuset 0-15, 15 workers, 128 GiB container limit. Original two-shard Qwen3.8-Flash-Next GSQ/RCO IQ3_S GGUF; mixed expert formats, mirrored streaming, INT8 KV, spec4/min-p0.5/suffix3.
  • Reproduce: Build the pinned baseline and candidate with identical compiler/AOT/dependency settings. Enable the candidate build option and fourteen runtime controls below; keep the two existing upstream controls identical in both arms. For baseline-first and candidate-first orders, give each arm one short warmup and one fresh 4096-input/64-output warmup, then three fresh 4096-input/256-output measurements. Prompt cache is disabled.
  • Expected: Reduce decode and complete-request latency while preserving generated output and speculative work. Leave precision, actual cache geometry, prefill backend and device defaults unchanged.
  • Actual: Final paired measurement: engine decode 64.2000 -> 69.7000 tok/s (+8.56698%); client rate 64.3081 -> 69.8043 tok/s (+8.54678%); TPOT 15.550152 -> 14.325761 ms (7.87382% reduction); complete request 8560.807 -> 8249.458 ms (3.63691% reduction). No prefill or TTFT improvement is claimed.
  • Evidence: Final enabled build matches the upstream output hashes in 5376 kernel cases. All 24 final measured requests, including default-off controls, have identical output hashes, token counts and speculative work. Request tables, startup geometry, source/binary hashes and the preceding default-off regression/fix are retained locally.
  • Reproduction status: Reproduced locally after an actual rebase and rebuild. Submitted head aaf18a4b adds only documentation to measured engine revision 0726ef5a. This PR is a draft, not a request to merge the aggregate before scope review. Maintainer agreement on splitting/overlapping scope and publication of the sanitized prompt/harness/evidence remain pending.

Current rebased E2E comparison

The baseline is latest upstream at the fetch used for this retest, with the
same explicitly selected existing configuration as the candidate. It is not
a comparison against every upstream runtime default. In particular, both arms
use upstream's existing STRATA_SH_STREAM=0 and STRATA_VERIFY_QDEDUP=1.
Their tuning benefit is not attributed to this patch.

Each final arm has six measured requests across two orders. Values are means;
prompt throughput is total prompt tokens divided by total engine prompt time.
Client tok/s is 1000 / mean(TPOT ms), following issue #3150, not the mean of
per-request reciprocal rates. TTFT is dispatch to first nonempty text delta;
TPOT is first-to-last nonempty text-delta interval divided by 255.

Metric Upstream baseline Candidate enabled Change
Engine decode, tok/s 64.2000 69.7000 +8.56698%
Client decode, tok/s 64.3081 69.8043 +8.54678%
Client TPOT, ms 15.550152 14.325761 -7.87382%
Complete request, ms 8560.807 8249.458 -3.63691%
Client TTFT, ms 4594.935 4595.776 +0.01832%
Engine prefill, ms 4568.850 4570.950 +0.04596%
Aggregate prefill, tok/s 896.5057 896.0938 -0.04594%

The complete-request improvement is smaller than the decode-rate improvement
because this workload includes approximately 4.57 seconds of unchanged prefill.
The tiny prefill/TTFT differences are retained, not described as improvements.

Order Baseline engine tok/s Candidate engine tok/s Engine gain Baseline TPOT ms Candidate TPOT ms TPOT reduction Complete-request reduction
Baseline first 64.2 69.7 +8.56698% 15.547234 14.326138 7.85410% 3.60774%
Candidate first 64.2 69.7 +8.56698% 15.553071 14.325384 7.89353% 3.66604%

Pooled TPOT median [range], ms: baseline 15.549016 [15.546513, 15.555340];
candidate 14.325517 [14.323918, 14.327379].
These are small-sample observations, not confidence intervals or a statistical
significance claim. Historical incremental percentages are not added together.

All 12 final enabled-comparison requests; warmups excluded
Order Arm Sample TTFT s TPOT ms Engine tok/s Complete request s
Baseline first Baseline 1 4.584357 15.547733 64.2 8.549596
Baseline first Baseline 2 4.594052 15.547455 64.2 8.559185
Baseline first Baseline 3 4.593632 15.546513 64.2 8.558745
Baseline first Candidate 1 4.593621 14.327379 69.7 8.247828
Baseline first Candidate 2 4.593064 14.326002 69.7 8.246824
Baseline first Candidate 3 4.593345 14.325033 69.7 8.246857
Candidate first Baseline 1 4.595903 15.555340 64.2 8.562922
Candidate first Baseline 2 4.600867 15.550298 64.2 8.566714
Candidate first Baseline 3 4.600797 15.553574 64.2 8.567679
Candidate first Candidate 1 4.596548 14.327319 69.7 8.250510
Candidate first Candidate 2 4.599737 14.324914 69.7 8.253213
Candidate first Candidate 3 4.598344 14.323918 69.7 8.251519

Every measured request has 4096 prompt tokens, 256 output tokens, 231 offered /
138 accepted drafts and zero prompt-cache tokens. Output SHA256:
f4d6b4434e29e291620bb04d5032ae7ab19ec832988997486d2b0425a2338e50.
Text-hash equality is not an independent token-ID-sequence check.
No pair was excluded or retried for timing or work mismatch.

Default-off regression discovered and repaired

The first rebased candidate, 961f6296, had correct output but a reproducible
default-off slowdown: 64.2 -> 63.8 tok/s (-0.62305%) in both orders.
It is not discarded as noise. The new sign helper's fallback expanded a nibble
differently from the upstream packed-mask expressions; split decoders also used
a different fallback arithmetic form.

Commit 0726ef5a restores those original expressions/operations when fast
arithmetic is disabled. Default-off correctness and both E2E orders were rerun:

Final default-off order Baseline engine tok/s Candidate engine tok/s Baseline TPOT ms Candidate TPOT ms
Baseline first 64.2 64.2 15.549723 15.557294
Candidate first 64.2 64.2 15.548611 15.558359
Pooled 64.2 64.2 15.549167 15.557827

Rounded engine throughput is unchanged; client rate is 64.3121 -> 64.2763 tok/s
(-0.05566%). This does not prove exact timing equivalence or neutrality on other
workloads. The initial -0.62% engine regression is no longer observed.
The enabled executable changed after rebuilding the repair, so its correctness
and two-order E2E were also rerun; the main table uses only that final executable.
The earlier enabled 64.1667 -> 69.7 result remains in the evidence, not pooled
into the final comparison or selected as the headline.

Related evidence/report format: https://github.com/Niko1221/Strata/issues/3150.
Related implementations: #2802, #2806, #3367, and closed #2555, #2584, #2746.
Scope agreement has not been obtained. This draft presents one measured
mixed-IQ3 decode integration for discussion, not a competing replacement for
those threads or an assertion that a large aggregate is approved.

Only SYCL kernel implementations, their shared helper, four related parity/bench
sources, CMake wiring and Intel documentation are changed.

Retained work Boundary / related upstream work
Packed Q2 expansion, IQ4 bit-select lookup, fast sign arithmetic Compile-time opt-in, default OFF; coordinate arithmetic overlap with open #2802 and closed #2746. Existing upstream decoder foundations are not new contributions.
Native IQ3_S GU / IQ4_NL down activation staging; IQ2_S, IQ3_XXS and IQ3_S row reuse; bounded E3 Preserve format/layout/dispatch guards; no packed-layout experiment or unmeasured XMX/S4 path.
Shape-selected Q4_K/Q5_K row reuse and Q6_K large GRF Bounded BMG shapes; explicit overrides take precedence. No global large-GRF default.
Compact resident plan and bounded GDN QK register broadcast Preserve routing identities, recurrence arithmetic and unsupported-path fallback.
HC cached norm / low-rank SiLU reuse and cached-lo reduce load ILP Coordinate with open #3367 rather than duplicating its ordinary-path ILP.
QSA active-width merge Integration/follow-up to open #2806; preserve reduction order. No scores/top-k, slot-batching or KV-layout experiment.

Closed #2555 / #2584 / #2746 are not treated as proof of algorithm rejection:
the maintainer described a tracker reset. Scope coordination is still needed.
This measured aggregate establishes the cleaned code's combined gain; it is not
evidence that every individual hunk independently gains on latest upstream.
Follow the repository's one-problem-per-PR guidance when agreeing the actual
upstream split; this is not a proposal to merge the full research preview.

Excluded: MTP/verify profiling fields and stamps, CPU-affinity/clock changes,
failed prefill trials, synthetic dense-IQ3/XMX/S4 experiments, machine-specific
defaults and local experiment runners. The PR makes no prefill gain claim.
Upstream's trellis KqSplitTq and formats 144/145/146 are retained after rebase.

Build and serving controls

Use the same oneAPI 2026.1 image, llama.cpp dependency 3cf03257, Release build
and AOT target for both arms:

cmake -S sycl -B build-retest \
  -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx \
  -DCMAKE_BUILD_TYPE=Release -DSTRATA_SYCL_AOT=bmg-g31 \
  -DSTRATA_SYCL_PARITY=ON -DSTRATA_GGML_DIR=/deps/llama \
  -DSTRATA_SYCL_IQ_DECODE_FAST=ON
cmake --build build-retest --target strata -j6

The new option defaults to OFF. Use OFF for candidate default-off controls;
the unmodified baseline does not consume this new option.
For the enabled candidate, set all fourteen new controls to 1:

STRATA_IQ3S_GU_SLM=1
STRATA_IQ4NL_DOWN_SLM=1
STRATA_RESIDENT_PLAN_COMPACT=1
STRATA_IQ2S_GU_ROW_REUSE=1
STRATA_IQ3XXS_GU_ROW_REUSE=1
STRATA_GR_CACHED_NORM=1
STRATA_GR_LO_REUSE=1
STRATA_MMVQ_SHAPE_RPW=1
STRATA_GDN_QK_REG=1
STRATA_EXPERT_ROW_E3=1
STRATA_Q6_SHAPE_GRF=1
STRATA_IQ3S_GU_ROW_REUSE=1
STRATA_GR_REDUCE_ILP=1
STRATA_ATTN_MERGE_ACTIVE=1

Explicitly set those fourteen to 0 for baseline and default-off controls.
On both arms set existing STRATA_SH_STREAM=0,
STRATA_VERIFY_QDEDUP=1, STRATA_VERIFY_DEVICE_PLAN=1,
STRATA_VERIFY_NO_HOST=1, STRATA_MIRROR_MIB=24576,
STRATA_STAGER_THREADS=12, STRATA_PREFILL_MMQ=0.
Other fixed settings and model/profile/pack/MTP paths are preserved in the
captured server configuration; do not silently change them.

--expert-cache 12152 --stream-experts --vram-reserve-mib 1536
--no-prefill-borrow --prefill auto --prompt-cache 0
--spec 4 --spec-min-p 0.5 --suffix-draft 3
--max-context 131584 --kv int8 --kv-resident 32768 --pcie-frac 0.30
--adapt-every 8 --adapt-decay 1

Actual startup geometry is identical across arms: 13054 expert-cache slots,
24.79 GiB cache, 1536-token prefill chunks
. The requested cache count is not
the allocated count. Expert-cache adaptation reports off in this fixed
VERIFY_NO_HOST configuration. Profiling is disabled during acceptance timing.

Validation and limits

Passed: Baseline, candidate OFF and candidate ON SYCL builds; final repaired
OFF and ON rebuilds. Initial OFF/ON candidates each match upstream in 5376 hash
cases: 384 real-layer native T1-8, 176 real-shape dense, 3072 HC across all
apply/inject controls, 1744 FP16/INT8 QSA boundary/dynamic/pipeline cases.
Final ON repeats all 5376. Final OFF repeats the affected 560 native/dense
cases, with unchanged HC/QSA covered by the initial check.
Weights are real; activations are deterministic synthetic, not a production
activation replay. QSA is weightless.

Existing native_grouped_parity, native_multi_parity, gdn_parity,
resident_plan_parity and gr_multi_parity pass for all initial builds and
both repaired builds. Candidate QSA INT8 prompt parity
(4352 8 1 --int8-only) passes OFF and ON, before and after repair.
Final E2E includes 12 enabled-comparison and 12 default-off measured requests.

Failed and repaired: Initial candidate's default-off performance gate above.
The regression evidence is retained. No final build or selected parity failure
remains.

Not run / limits: CUDA/HIP/Metal builds, other GPUs, other models or prompt
lengths, full test suite and broad Q4 prompt parity. The historical broad Q4
pool refusal is not relabeled as a pass. No hardware-counter claim, independent
token-ID check, public reproducibility or maintainer approval is implied.

Pinned executable SHA256
Upstream baseline strata-default 9f69fb18d6b3f0121cf6b201c0be526648088d360a82b9e4fd6ef073f17a7a06
Final candidate OFF strata-default-fixed 62de7a82c8746eb083e4885d32df5489c4ec38dd98c4468965588b904c856a6f
Final candidate ON strata-enabled-fixed 4bbcb2b571d3abc981a32b04f9ff49ad8863259b1bbe593ec748726991e1db94

Local artifact root: iq3-round3-artifacts/upstream-retest-20261026/.
Final measurements and parity are in default-fix/; the root retains the
first rebased measurements and regression control. final-results.json,
source snapshots and SHA256 manifests index the complete evidence.
These local paths are not public attachments. The original dirty accepted
worktree and its frozen historical evidence were not replaced.


Follow-up: compatible integration with #3153 (2026-10-29)

Separate integration experiment, not the performance of this PR's current
diff.
Combining this PR with the compatible paths from #3153 improves measured
prefill throughput by 10.02%, engine decode throughput by 21.91%, and
reduces complete-request latency by 13.22%, relative to the common baseline.
The standalone results and no-prefill-gain claim above remain unchanged.
No combined implementation is included in this PR by this description update.

Pinned revisions and controlled protocol

  • Baseline: 4b9e05a2a806a3fe24f7b2560d98626c37dade35, the same source baseline
    used above, not latest main on October 29.
  • Current PR: aaf18a4b (documentation-only follow-up to measured 0726ef5a),
    using the same final enabled executable as the standalone comparison.
  • #3153 input: cb436853ab2ee238fa579a3a4f42a0412b46c439.
    Local integration merge fcc9e347, followed by build repair 61a68d17.
    This is a local experimental integration, not an assertion that the full
    preview should be upstreamed.
  • Same single B70, mixed IQ3_S model, 4096 prompt / 256 output tokens, INT8 KV
    and speculative settings as above. FP16 expert prefill
    (STRATA_PREFILL_MMQ=0) on every arm; the combined arm additionally uses
    SYCL TLA FP32 prompt attention.
  • Forward order: baseline -> current -> combined. Reverse order:
    combined -> current -> baseline. Each block has a short warmup, a fresh
    4096/64 warmup, then three fresh 4096/256 measurements: 18 measured requests,
    six per arm
    . No work-mismatch or timing retries.
  • All three arms explicitly use --expert-cache 9700 --prefill 1536.
    The cache argument is a uniform-size byte-budget input, not the mixed-format
    allocated slot count. All six startup logs confirm 12667 actual slots,
    24.05 GiB displayed cache
    , with fixed 1536-token prefill chunks.
    Other serving arguments are unchanged.

Same-run E2E results

Aggregation and metric definitions follow the standalone table above.
All latency changes below are reductions; throughput changes are increases.

Metric Baseline Current PR #4185 Compatible #4185 + #3153 Combined vs baseline
Aggregate prefill, tok/s 903.9382 903.0480 994.5489 +10.02400%
Engine prefill, ms 4531.283 4535.750 4118.450 -9.11074%
Engine decode, tok/s 63.6000 68.9167 77.5333 +21.90776%
Client decode, tok/s 63.6999 69.0386 77.6048 +21.82882%
Client TTFT, ms 4557.325 4560.680 4142.617 -9.09980%
Client TPOT, ms 15.698623 14.484643 12.885804 -17.91762%
Complete request, ms 8561.153 8254.911 7429.221 -13.22173%

Relative to the current PR in this same run, the compatible integration
adds 10.13245% prefill throughput, 12.50302% engine decode throughput
(12.40776% client rate), and 10.00241% complete-request latency reduction.
The standalone current-PR engine gain in this run is 8.35954%.
These are direct ratios from the same controlled experiment, not sums of
historical PR percentages.

Order Baseline prefill tok/s Combined prefill tok/s Prefill gain Baseline engine decode tok/s Combined engine decode tok/s Decode gain Complete-request reduction
Baseline -> current -> combined 903.9814 994.6898 +10.03432% 63.6000 77.5000 +21.85535% 13.21653%
Combined -> current -> baseline 903.8950 994.4081 +10.01368% 63.6000 77.5667 +21.96017% 13.22693%

Compatibility, correctness and evidence boundaries

The #3153 published runtime controls were combined with this PR's enabled
controls, with STRATA_PRIVATE_B60_DECODE_LAYOUT=0 forced for this model.
Its Layouts::add_experts requires Q2_0/type-42 down weights in every layer,
whereas this mixed IQ3 model has IQ4_NL down weights in 39 layers.
Layout-dependent packed/S4/SoA paths therefore remain inactive, even where their
published switches are set. This is not the full private-layout IQ2_XS
configuration
reported in #3153.

The combined arm enables synchronous mirror adaptation and TLA prompt attention;
baseline/current report adaptive swaps off under VERIFY_NO_HOST.
Cache capacity is controlled, but residency evolution is intentionally different.
This is the end-to-end compatible combination's gain, not an attribution of
all improvements to IQ3 arithmetic, nor an isolated per-feature ablation.
TLA dependency: intel/sycl-tla at
7b56b936b87f799f80dde60c2fd8d11c1128cebb.

The combined build passes the existing related parity checks and matches
all 5376 baseline kernel hashes (real weights, deterministic synthetic
activations; not production activation replay).
All 18 measured requests have the same output text SHA256 as above,
4096 prompt tokens, 256 output tokens, 231 offered / 138 accepted drafts, and
zero prompt-cache tokens. This is not an independent token-ID-sequence check.

An earlier 18-request run with --expert-cache 12152 --prefill auto is retained,
but not pooled into this table: actual slots drifted from 12960 to 13022
for reverse-order baseline/current, while combined stayed at 12960.
The complete fixed-budget experiment above resolves that capacity confound;
it was not a timing-based sample selection. Different cache capacity also means
the new baseline rate must not be mixed with the standalone table's rates.
Initial missing-TLA and duplicate-helper/ABI build failures, followed by their
repairs, are retained in the integration logs.

Local artifact root:
iq3-round3-artifacts/combined-4185-3153-20261029/.
fixed-geometry/ retains raw configurations, startup logs, request records and
both order summaries; final-results.json indexes the final comparison,
limitations and revisions. Source/patch snapshots and independently verified
SHA256 manifests retain 40 source references and 134 evidence files.
The original standalone frozen evidence remains unchanged.
These paths are local records, not publicly downloadable attachments.

Combined executable SHA256:
26d4cb9e313ead9714e70a60dd0df28307ac7a00d6868a5f0533b01e767bf6df.
No other GPU, model, prompt length, broad Q4 prompt parity, CUDA/HIP build,
statistical significance or public reproducibility is claimed.


🔄 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/4185 **Author:** [@glorysdj](https://github.com/glorysdj) **Created:** 10/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `iq3/upstream-positive-20261026` --- ### 📝 Commits (3) - [`961f629`](https://github.com/Niko1221/Strata/commit/961f62963c22690b1dc3d096d7159d9fec8a3693) sycl: isolate opt-in mixed-IQ3 decode optimizations - [`0726ef5`](https://github.com/Niko1221/Strata/commit/0726ef5ad45e355d8a61a60aa7347450618d9b8b) Preserve upstream sign decoding when fast arithmetic is disabled - [`aaf18a4`](https://github.com/Niko1221/Strata/commit/aaf18a4b94cab51167d5c3ac6a5f07def7ae1fe5) docs: record rebased B70 IQ3 decode and default-off results ### 📊 Changes **12 files changed** (+1009 additions, -101 deletions) <details> <summary>View changed files</summary> 📝 `docs/INTEL.md` (+57 -0) 📝 `sycl/CMakeLists.txt` (+12 -0) ➕ `sycl/include/strata/kernels/iq4_lut.hpp` (+28 -0) 📝 `sycl/src/kernels/cuda/fused_gr.dp.cpp` (+109 -11) 📝 `sycl/src/kernels/cuda/iq_kernels.dp.cpp` (+465 -27) 📝 `sycl/src/kernels/cuda/native_mmvq.dp.cpp` (+50 -2) 📝 `sycl/src/kernels/cuda/qsa_decode_attn.dp.cpp` (+88 -9) 📝 `sycl/src/kernels/cuda/verify_kernels.dp.cpp` (+55 -12) 📝 `sycl/src/kernels/fused_gr_bench.cpp` (+10 -2) 📝 `sycl/src/kernels/gdn_parity.cpp` (+39 -0) 📝 `sycl/src/kernels/native_expert_bench.cpp` (+46 -34) 📝 `sycl/src/kernels/qsa_prompt_attn_parity.cpp` (+50 -4) </details> ### 📄 Description ## Problem and result - **Problem:** The native mixed-IQ3 decode path on one Arc Pro B70 repeats weight-code expansion, input preparation, projection and attention-merge work. This patch retains production-covered decode optimizations, not the profiling framework or unsuccessful prefill experiments. - **Environment:** Upstream `4b9e05a2a806a3fe24f7b2560d98626c37dade35`, final measured candidate `0726ef5a` on branch `iq3/upstream-positive-20261026`. One B70 at `0000:36:00.0`, oneAPI 2026.1, AOT `bmg-g31`, `level_zero:1`; cpuset 0-15, 15 workers, 128 GiB container limit. Original two-shard Qwen3.8-Flash-Next GSQ/RCO IQ3_S GGUF; mixed expert formats, mirrored streaming, INT8 KV, spec4/min-p0.5/suffix3. - **Reproduce:** Build the pinned baseline and candidate with identical compiler/AOT/dependency settings. Enable the candidate build option and fourteen runtime controls below; keep the two existing upstream controls identical in both arms. For baseline-first and candidate-first orders, give each arm one short warmup and one fresh 4096-input/64-output warmup, then three fresh 4096-input/256-output measurements. Prompt cache is disabled. - **Expected:** Reduce decode and complete-request latency while preserving generated output and speculative work. Leave precision, actual cache geometry, prefill backend and device defaults unchanged. - **Actual:** Final paired measurement: engine decode **64.2000 -> 69.7000 tok/s (+8.56698%)**; client rate **64.3081 -> 69.8043 tok/s (+8.54678%)**; TPOT **15.550152 -> 14.325761 ms (7.87382% reduction)**; complete request **8560.807 -> 8249.458 ms (3.63691% reduction)**. No prefill or TTFT improvement is claimed. - **Evidence:** Final enabled build matches the upstream output hashes in 5376 kernel cases. All 24 final measured requests, including default-off controls, have identical output hashes, token counts and speculative work. Request tables, startup geometry, source/binary hashes and the preceding default-off regression/fix are retained locally. - **Reproduction status:** **Reproduced locally after an actual rebase and rebuild.** Submitted head `aaf18a4b` adds only documentation to measured engine revision `0726ef5a`. This PR is a **draft**, not a request to merge the aggregate before scope review. Maintainer agreement on splitting/overlapping scope and publication of the sanitized prompt/harness/evidence remain pending. --- ## Current rebased E2E comparison The baseline is latest upstream **at the fetch used for this retest**, with the same explicitly selected existing configuration as the candidate. It is **not** a comparison against every upstream runtime default. In particular, both arms use upstream's existing `STRATA_SH_STREAM=0` and `STRATA_VERIFY_QDEDUP=1`. Their tuning benefit is not attributed to this patch. Each final arm has six measured requests across two orders. Values are means; prompt throughput is total prompt tokens divided by total engine prompt time. Client tok/s is **1000 / mean(TPOT ms)**, following issue #3150, not the mean of per-request reciprocal rates. TTFT is dispatch to first nonempty text delta; TPOT is first-to-last nonempty text-delta interval divided by 255. | Metric | Upstream baseline | Candidate enabled | Change | |---|---:|---:|---:| | Engine decode, tok/s | 64.2000 | 69.7000 | +8.56698% | | Client decode, tok/s | 64.3081 | 69.8043 | +8.54678% | | Client TPOT, ms | 15.550152 | 14.325761 | -7.87382% | | Complete request, ms | 8560.807 | 8249.458 | -3.63691% | | Client TTFT, ms | 4594.935 | 4595.776 | +0.01832% | | Engine prefill, ms | 4568.850 | 4570.950 | +0.04596% | | Aggregate prefill, tok/s | 896.5057 | 896.0938 | -0.04594% | The complete-request improvement is smaller than the decode-rate improvement because this workload includes approximately 4.57 seconds of unchanged prefill. The tiny prefill/TTFT differences are retained, not described as improvements. | Order | Baseline engine tok/s | Candidate engine tok/s | Engine gain | Baseline TPOT ms | Candidate TPOT ms | TPOT reduction | Complete-request reduction | |---|---:|---:|---:|---:|---:|---:|---:| | Baseline first | 64.2 | 69.7 | +8.56698% | 15.547234 | 14.326138 | 7.85410% | 3.60774% | | Candidate first | 64.2 | 69.7 | +8.56698% | 15.553071 | 14.325384 | 7.89353% | 3.66604% | Pooled TPOT median [range], ms: baseline **15.549016 [15.546513, 15.555340]**; candidate **14.325517 [14.323918, 14.327379]**. These are small-sample observations, not confidence intervals or a statistical significance claim. Historical incremental percentages are not added together. <details> <summary>All 12 final enabled-comparison requests; warmups excluded</summary> | Order | Arm | Sample | TTFT s | TPOT ms | Engine tok/s | Complete request s | |---|---|---:|---:|---:|---:|---:| | Baseline first | Baseline | 1 | 4.584357 | 15.547733 | 64.2 | 8.549596 | | Baseline first | Baseline | 2 | 4.594052 | 15.547455 | 64.2 | 8.559185 | | Baseline first | Baseline | 3 | 4.593632 | 15.546513 | 64.2 | 8.558745 | | Baseline first | Candidate | 1 | 4.593621 | 14.327379 | 69.7 | 8.247828 | | Baseline first | Candidate | 2 | 4.593064 | 14.326002 | 69.7 | 8.246824 | | Baseline first | Candidate | 3 | 4.593345 | 14.325033 | 69.7 | 8.246857 | | Candidate first | Baseline | 1 | 4.595903 | 15.555340 | 64.2 | 8.562922 | | Candidate first | Baseline | 2 | 4.600867 | 15.550298 | 64.2 | 8.566714 | | Candidate first | Baseline | 3 | 4.600797 | 15.553574 | 64.2 | 8.567679 | | Candidate first | Candidate | 1 | 4.596548 | 14.327319 | 69.7 | 8.250510 | | Candidate first | Candidate | 2 | 4.599737 | 14.324914 | 69.7 | 8.253213 | | Candidate first | Candidate | 3 | 4.598344 | 14.323918 | 69.7 | 8.251519 | Every measured request has 4096 prompt tokens, 256 output tokens, 231 offered / 138 accepted drafts and zero prompt-cache tokens. Output SHA256: `f4d6b4434e29e291620bb04d5032ae7ab19ec832988997486d2b0425a2338e50`. Text-hash equality is not an independent token-ID-sequence check. No pair was excluded or retried for timing or work mismatch. </details> ## Default-off regression discovered and repaired The first rebased candidate, `961f6296`, had correct output but a reproducible default-off slowdown: **64.2 -> 63.8 tok/s (-0.62305%) in both orders**. It is not discarded as noise. The new sign helper's fallback expanded a nibble differently from the upstream packed-mask expressions; split decoders also used a different fallback arithmetic form. Commit `0726ef5a` restores those original expressions/operations when fast arithmetic is disabled. Default-off correctness and both E2E orders were rerun: | Final default-off order | Baseline engine tok/s | Candidate engine tok/s | Baseline TPOT ms | Candidate TPOT ms | |---|---:|---:|---:|---:| | Baseline first | 64.2 | 64.2 | 15.549723 | 15.557294 | | Candidate first | 64.2 | 64.2 | 15.548611 | 15.558359 | | Pooled | 64.2 | 64.2 | 15.549167 | 15.557827 | Rounded engine throughput is unchanged; client rate is 64.3121 -> 64.2763 tok/s (-0.05566%). This does not prove exact timing equivalence or neutrality on other workloads. The initial -0.62% engine regression is no longer observed. The enabled executable changed after rebuilding the repair, so its correctness and two-order E2E were also rerun; the main table uses only that final executable. The earlier enabled 64.1667 -> 69.7 result remains in the evidence, not pooled into the final comparison or selected as the headline. ## Approach and related discussion Related evidence/report format: https://github.com/Niko1221/Strata/issues/3150. Related implementations: #2802, #2806, #3367, and closed #2555, #2584, #2746. **Scope agreement has not been obtained.** This draft presents one measured mixed-IQ3 decode integration for discussion, not a competing replacement for those threads or an assertion that a large aggregate is approved. Only SYCL kernel implementations, their shared helper, four related parity/bench sources, CMake wiring and Intel documentation are changed. | Retained work | Boundary / related upstream work | |---|---| | Packed Q2 expansion, IQ4 bit-select lookup, fast sign arithmetic | Compile-time opt-in, default OFF; coordinate arithmetic overlap with open #2802 and closed #2746. Existing upstream decoder foundations are not new contributions. | | Native IQ3_S GU / IQ4_NL down activation staging; IQ2_S, IQ3_XXS and IQ3_S row reuse; bounded E3 | Preserve format/layout/dispatch guards; no packed-layout experiment or unmeasured XMX/S4 path. | | Shape-selected Q4_K/Q5_K row reuse and Q6_K large GRF | Bounded BMG shapes; explicit overrides take precedence. No global large-GRF default. | | Compact resident plan and bounded GDN QK register broadcast | Preserve routing identities, recurrence arithmetic and unsupported-path fallback. | | HC cached norm / low-rank SiLU reuse and cached-lo reduce load ILP | Coordinate with open #3367 rather than duplicating its ordinary-path ILP. | | QSA active-width merge | Integration/follow-up to open #2806; preserve reduction order. No scores/top-k, slot-batching or KV-layout experiment. | Closed #2555 / #2584 / #2746 are not treated as proof of algorithm rejection: the maintainer described a tracker reset. Scope coordination is still needed. This measured aggregate establishes the cleaned code's combined gain; it is not evidence that every individual hunk independently gains on latest upstream. Follow the repository's one-problem-per-PR guidance when agreeing the actual upstream split; this is not a proposal to merge the full research preview. Excluded: MTP/verify profiling fields and stamps, CPU-affinity/clock changes, failed prefill trials, synthetic dense-IQ3/XMX/S4 experiments, machine-specific defaults and local experiment runners. The PR makes **no prefill gain claim**. Upstream's trellis `KqSplitTq` and formats 144/145/146 are retained after rebase. ## Build and serving controls Use the same oneAPI 2026.1 image, llama.cpp dependency `3cf03257`, Release build and AOT target for both arms: ```sh cmake -S sycl -B build-retest \ -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx \ -DCMAKE_BUILD_TYPE=Release -DSTRATA_SYCL_AOT=bmg-g31 \ -DSTRATA_SYCL_PARITY=ON -DSTRATA_GGML_DIR=/deps/llama \ -DSTRATA_SYCL_IQ_DECODE_FAST=ON cmake --build build-retest --target strata -j6 ``` The new option defaults to OFF. Use OFF for candidate default-off controls; the unmodified baseline does not consume this new option. For the enabled candidate, set all fourteen new controls to `1`: ```sh STRATA_IQ3S_GU_SLM=1 STRATA_IQ4NL_DOWN_SLM=1 STRATA_RESIDENT_PLAN_COMPACT=1 STRATA_IQ2S_GU_ROW_REUSE=1 STRATA_IQ3XXS_GU_ROW_REUSE=1 STRATA_GR_CACHED_NORM=1 STRATA_GR_LO_REUSE=1 STRATA_MMVQ_SHAPE_RPW=1 STRATA_GDN_QK_REG=1 STRATA_EXPERT_ROW_E3=1 STRATA_Q6_SHAPE_GRF=1 STRATA_IQ3S_GU_ROW_REUSE=1 STRATA_GR_REDUCE_ILP=1 STRATA_ATTN_MERGE_ACTIVE=1 ``` Explicitly set those fourteen to `0` for baseline and default-off controls. On **both** arms set existing `STRATA_SH_STREAM=0`, `STRATA_VERIFY_QDEDUP=1`, `STRATA_VERIFY_DEVICE_PLAN=1`, `STRATA_VERIFY_NO_HOST=1`, `STRATA_MIRROR_MIB=24576`, `STRATA_STAGER_THREADS=12`, `STRATA_PREFILL_MMQ=0`. Other fixed settings and model/profile/pack/MTP paths are preserved in the captured server configuration; do not silently change them. ```text --expert-cache 12152 --stream-experts --vram-reserve-mib 1536 --no-prefill-borrow --prefill auto --prompt-cache 0 --spec 4 --spec-min-p 0.5 --suffix-draft 3 --max-context 131584 --kv int8 --kv-resident 32768 --pcie-frac 0.30 --adapt-every 8 --adapt-decay 1 ``` Actual startup geometry is identical across arms: **13054 expert-cache slots, 24.79 GiB cache, 1536-token prefill chunks**. The requested cache count is not the allocated count. Expert-cache adaptation reports off in this fixed `VERIFY_NO_HOST` configuration. Profiling is disabled during acceptance timing. ## Validation and limits **Passed:** Baseline, candidate OFF and candidate ON SYCL builds; final repaired OFF and ON rebuilds. Initial OFF/ON candidates each match upstream in 5376 hash cases: 384 real-layer native T1-8, 176 real-shape dense, 3072 HC across all apply/inject controls, 1744 FP16/INT8 QSA boundary/dynamic/pipeline cases. Final ON repeats all 5376. Final OFF repeats the affected 560 native/dense cases, with unchanged HC/QSA covered by the initial check. Weights are real; activations are deterministic synthetic, not a production activation replay. QSA is weightless. Existing `native_grouped_parity`, `native_multi_parity`, `gdn_parity`, `resident_plan_parity` and `gr_multi_parity` pass for all initial builds and both repaired builds. Candidate QSA INT8 prompt parity (`4352 8 1 --int8-only`) passes OFF and ON, before and after repair. Final E2E includes 12 enabled-comparison and 12 default-off measured requests. **Failed and repaired:** Initial candidate's default-off performance gate above. The regression evidence is retained. No final build or selected parity failure remains. **Not run / limits:** CUDA/HIP/Metal builds, other GPUs, other models or prompt lengths, full test suite and broad Q4 prompt parity. The historical broad Q4 pool refusal is not relabeled as a pass. No hardware-counter claim, independent token-ID check, public reproducibility or maintainer approval is implied. | Pinned executable | SHA256 | |---|---| | Upstream baseline `strata-default` | `9f69fb18d6b3f0121cf6b201c0be526648088d360a82b9e4fd6ef073f17a7a06` | | Final candidate OFF `strata-default-fixed` | `62de7a82c8746eb083e4885d32df5489c4ec38dd98c4468965588b904c856a6f` | | Final candidate ON `strata-enabled-fixed` | `4bbcb2b571d3abc981a32b04f9ff49ad8863259b1bbe593ec748726991e1db94` | Local artifact root: `iq3-round3-artifacts/upstream-retest-20261026/`. Final measurements and parity are in `default-fix/`; the root retains the first rebased measurements and regression control. `final-results.json`, source snapshots and SHA256 manifests index the complete evidence. These local paths are not public attachments. The original dirty accepted worktree and its frozen historical evidence were not replaced. --- ## Follow-up: compatible integration with #3153 (2026-10-29) **Separate integration experiment, not the performance of this PR's current diff.** Combining this PR with the compatible paths from #3153 improves measured prefill throughput by **10.02%**, engine decode throughput by **21.91%**, and reduces complete-request latency by **13.22%**, relative to the common baseline. The standalone results and no-prefill-gain claim above remain unchanged. No combined implementation is included in this PR by this description update. ### Pinned revisions and controlled protocol - Baseline: `4b9e05a2a806a3fe24f7b2560d98626c37dade35`, the same source baseline used above, **not** latest main on October 29. - Current PR: `aaf18a4b` (documentation-only follow-up to measured `0726ef5a`), using the same final enabled executable as the standalone comparison. - #3153 input: `cb436853ab2ee238fa579a3a4f42a0412b46c439`. Local integration merge `fcc9e347`, followed by build repair `61a68d17`. This is a local experimental integration, not an assertion that the full preview should be upstreamed. - Same single B70, mixed IQ3_S model, 4096 prompt / 256 output tokens, INT8 KV and speculative settings as above. FP16 expert prefill (`STRATA_PREFILL_MMQ=0`) on every arm; the combined arm additionally uses SYCL TLA FP32 prompt attention. - Forward order: baseline -> current -> combined. Reverse order: combined -> current -> baseline. Each block has a short warmup, a fresh 4096/64 warmup, then three fresh 4096/256 measurements: **18 measured requests, six per arm**. No work-mismatch or timing retries. - All three arms explicitly use `--expert-cache 9700 --prefill 1536`. The cache argument is a uniform-size byte-budget input, not the mixed-format allocated slot count. All six startup logs confirm **12667 actual slots, 24.05 GiB displayed cache**, with fixed 1536-token prefill chunks. Other serving arguments are unchanged. ### Same-run E2E results Aggregation and metric definitions follow the standalone table above. All latency changes below are reductions; throughput changes are increases. | Metric | Baseline | Current PR #4185 | Compatible #4185 + #3153 | Combined vs baseline | |---|---:|---:|---:|---:| | Aggregate prefill, tok/s | 903.9382 | 903.0480 | 994.5489 | +10.02400% | | Engine prefill, ms | 4531.283 | 4535.750 | 4118.450 | -9.11074% | | Engine decode, tok/s | 63.6000 | 68.9167 | 77.5333 | +21.90776% | | Client decode, tok/s | 63.6999 | 69.0386 | 77.6048 | +21.82882% | | Client TTFT, ms | 4557.325 | 4560.680 | 4142.617 | -9.09980% | | Client TPOT, ms | 15.698623 | 14.484643 | 12.885804 | -17.91762% | | Complete request, ms | 8561.153 | 8254.911 | 7429.221 | -13.22173% | Relative to the **current PR in this same run**, the compatible integration adds **10.13245% prefill throughput**, **12.50302% engine decode throughput** (12.40776% client rate), and **10.00241% complete-request latency reduction**. The standalone current-PR engine gain in this run is 8.35954%. These are direct ratios from the same controlled experiment, not sums of historical PR percentages. | Order | Baseline prefill tok/s | Combined prefill tok/s | Prefill gain | Baseline engine decode tok/s | Combined engine decode tok/s | Decode gain | Complete-request reduction | |---|---:|---:|---:|---:|---:|---:|---:| | Baseline -> current -> combined | 903.9814 | 994.6898 | +10.03432% | 63.6000 | 77.5000 | +21.85535% | 13.21653% | | Combined -> current -> baseline | 903.8950 | 994.4081 | +10.01368% | 63.6000 | 77.5667 | +21.96017% | 13.22693% | ### Compatibility, correctness and evidence boundaries The #3153 published runtime controls were combined with this PR's enabled controls, with **`STRATA_PRIVATE_B60_DECODE_LAYOUT=0`** forced for this model. Its `Layouts::add_experts` requires Q2_0/type-42 down weights in every layer, whereas this mixed IQ3 model has IQ4_NL down weights in 39 layers. Layout-dependent packed/S4/SoA paths therefore remain inactive, even where their published switches are set. This is **not the full private-layout IQ2_XS configuration** reported in #3153. The combined arm enables synchronous mirror adaptation and TLA prompt attention; baseline/current report adaptive swaps off under `VERIFY_NO_HOST`. Cache capacity is controlled, but residency evolution is intentionally different. This is the end-to-end compatible combination's gain, **not** an attribution of all improvements to IQ3 arithmetic, nor an isolated per-feature ablation. TLA dependency: `intel/sycl-tla` at `7b56b936b87f799f80dde60c2fd8d11c1128cebb`. The combined build passes the existing related parity checks and matches **all 5376 baseline kernel hashes** (real weights, deterministic synthetic activations; not production activation replay). All 18 measured requests have the same output text SHA256 as above, 4096 prompt tokens, 256 output tokens, 231 offered / 138 accepted drafts, and zero prompt-cache tokens. This is not an independent token-ID-sequence check. An earlier 18-request run with `--expert-cache 12152 --prefill auto` is retained, but **not pooled into this table**: actual slots drifted from 12960 to 13022 for reverse-order baseline/current, while combined stayed at 12960. The complete fixed-budget experiment above resolves that capacity confound; it was not a timing-based sample selection. Different cache capacity also means the new baseline rate must not be mixed with the standalone table's rates. Initial missing-TLA and duplicate-helper/ABI build failures, followed by their repairs, are retained in the integration logs. Local artifact root: `iq3-round3-artifacts/combined-4185-3153-20261029/`. `fixed-geometry/` retains raw configurations, startup logs, request records and both order summaries; `final-results.json` indexes the final comparison, limitations and revisions. Source/patch snapshots and independently verified SHA256 manifests retain 40 source references and 134 evidence files. The original standalone frozen evidence remains unchanged. These paths are **local records, not publicly downloadable attachments**. Combined executable SHA256: `26d4cb9e313ead9714e70a60dd0df28307ac7a00d6868a5f0533b01e767bf6df`. No other GPU, model, prompt length, broad Q4 prompt parity, CUDA/HIP build, statistical significance or public reproducibility is claimed. --- <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#4938
No description provided.