mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4185] [Engine] [SYCL] opt-in mixed-IQ3 decode optimizations on Battlemage #4938
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4938
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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)
961f629sycl: isolate opt-in mixed-IQ3 decode optimizations0726ef5Preserve upstream sign decoding when fast arithmetic is disabledaaf18a4docs: 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
4b9e05a2a806a3fe24f7b2560d98626c37dade35, final measured candidate0726ef5aon branchiq3/upstream-positive-20261026. One B70 at0000:36:00.0, oneAPI 2026.1, AOTbmg-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.aaf18a4badds only documentation to measured engine revision0726ef5a. 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=0andSTRATA_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.
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.
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
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 reproducibledefault-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
0726ef5arestores those original expressions/operations when fastarithmetic is disabled. Default-off correctness and both E2E orders were rerun:
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.
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
KqSplitTqand formats 144/145/146 are retained after rebase.Build and serving controls
Use the same oneAPI 2026.1 image, llama.cpp dependency
3cf03257, Release buildand AOT target for both arms:
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:Explicitly set those fourteen to
0for 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.
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_HOSTconfiguration. 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_parityandgr_multi_paritypass for all initial builds andboth 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.
strata-default9f69fb18d6b3f0121cf6b201c0be526648088d360a82b9e4fd6ef073f17a7a06strata-default-fixed62de7a82c8746eb083e4885d32df5489c4ec38dd98c4468965588b904c856a6fstrata-enabled-fixed4bbcb2b571d3abc981a32b04f9ff49ad8863259b1bbe593ec748726991e1db94Local artifact root:
iq3-round3-artifacts/upstream-retest-20261026/.Final measurements and parity are in
default-fix/; the root retains thefirst 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
4b9e05a2a806a3fe24f7b2560d98626c37dade35, the same source baselineused above, not latest main on October 29.
aaf18a4b(documentation-only follow-up to measured0726ef5a),using the same final enabled executable as the standalone comparison.
cb436853ab2ee238fa579a3a4f42a0412b46c439.Local integration merge
fcc9e347, followed by build repair61a68d17.This is a local experimental integration, not an assertion that the full
preview should be upstreamed.
and speculative settings as above. FP16 expert prefill
(
STRATA_PREFILL_MMQ=0) on every arm; the combined arm additionally usesSYCL TLA FP32 prompt attention.
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.
--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.
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.
Compatibility, correctness and evidence boundaries
The #3153 published runtime controls were combined with this PR's enabled
controls, with
STRATA_PRIVATE_B60_DECODE_LAYOUT=0forced for this model.Its
Layouts::add_expertsrequires 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-tlaat7b56b936b87f799f80dde60c2fd8d11c1128cebb.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 autois 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 andboth order summaries;
final-results.jsonindexes 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.