[PR #2746] [CLOSED] [Engine] [SYCL] use packed word expansion for Q2_0 expert down on Battlemage #4238

Closed
opened 2026-11-07 15:34:15 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2746
Author: @xiangyuT
Created: 10/16/2026
Status: ❌ Closed

Base: main ← Head: feat/sycl-q2-down-word-expand


📝 Commits (3)

  • fe47faa sycl: expand Q2_0 down weights with packed word operations
  • 44b21f6 sycl: keep Q2 decoder local to its kernel translation unit
  • e801853 sycl: select Q2 word decoding without synthetic format IDs

📊 Changes

1 file changed (+95 additions, -11 deletions)

View changed files

📝 sycl/src/kernels/cuda/iq_kernels.dp.cpp (+95 -11)

📄 Description

Problem and result

Eligible Q2_0 expert-down kernels expand packed codes with byte/codebook operations. This patch uses exact packed-word shifts, masks and arithmetic while preserving INT8 DP4A operations, scales, FP32 accumulation and reduction order.

2026-10-20 retest on a single Arc Pro B70, 32 GiB container RAM limit, upstream 0.2.0-beta:
upstream/common frontend e88ee39d1d6be6e3364183af3b39b62a7ed6f211; independent candidate 97dd6dd8a10290165849d6764576ebb85f2c5032.
All three lengths are complete.
These are standalone-PR results; no other preview optimizations are enabled.

Input / output TTFT upstream → enabled (s) Improvement TPOT upstream → enabled (ms/token) Improvement
4096 / 128 3.150948 → 3.150516 +0.014% 14.732468 → 14.023078 +4.816%
8192 / 256 6.378591 → 6.372681 +0.093% 13.860895 → 13.258234 +4.351%
32768 / 256 27.293204 → 27.289707 +0.013% 14.390090 → 13.761256 +4.368%

Positive improvement means lower latency: mean of three request-wise 100 × (1 − candidate / mean(upstream-before, upstream-after)) values.
The displayed upstream time averages both bracketing blocks. TTFT is request-to-first nonempty SSE text;
TPOT is first-to-last nonempty SSE text arrival divided by engine-generated tokens minus one.
Tiny changes near baseline variation do not establish a meaningful improvement.

Source status (2026-10-20): source branch feat/sycl-q2-down-word-expand now points to the tested candidate 97dd6dd8a10290165849d6764576ebb85f2c5032. This PR remains closed; GitHub still reports PR head e8018531183b8213ab4726f57656003a08452c20. All new measurements and validation in this description apply to the tested candidate. Reopening remains for maintainer review.

This updates the existing PR after the 0.2.0-beta reset and current contribution requirements; it is not a competing submission.
Scope and reopening remain for maintainer review in this thread. Historical pre-beta evidence is folded below.

Related IQ decode implementation: #2802 / #2801 directly overlap in Q2 shift/mask expansion arithmetic, with additional formats and lane variants. Coordinate the common subset in these existing PRs to avoid duplicate implementations.

Approach

Battlemage, existing 8-lane/non-legacy/non-split Q2_0 down dispatch. No model-specific shape whitelist. Other formats and gate/up retain their algorithms. Non-Battlemage devices keep the original decoder; eligible Q2 calls still incur the added cached host device check.

New paths are now opt-in. Every control below is disabled when unset or 0.
Set controls before starting the engine and restart after changes because values are cached/read during initialization.
Only the controls for this PR are set to 1 in the measured candidate; pure upstream and the candidate-default check leave them unset.

Control With 1
STRATA_SYCL_Q2_WORD_EXPAND Entire packed-word Q2_0 down optimization; no child switches.

Leave Q2_WORD_EXPAND unset or set it to 0 to use the original decoder.

Validation

Passed

  • Exact-source SYCL Release/AOT bmg-g31 engine build. No non-SYCL backend files are changed.
  • Default-off/enabled native_grouped_parity and the exhaustive packed-word plus real-weight down/full-output diagnostic pass.
  • Fresh-process serving: all seven corresponding requests (one short warmup, three full-input warmups, three measured requests) have identical engine token IDs and text across upstream-before / enabled candidate / upstream-after at every length. The extra 4K candidate-default block also matches all seven requests.
  • Timing blocks restart after an excluded INT8 calibration process, read the same persisted crossover file, and verify its hash is unchanged. Warmup/calibrating/default-functional blocks are excluded from performance.

Sanitized operator output:

native-grouped-default.log: native_grouped_parity: 0 failures
native-grouped-enabled.log: native_grouped_parity: 0 failures
q2-exhaustive-and-real-weights.log: {"kind":"decode_correctness","words":65536,"bytes_per_word":8,"upper_bits_ignored":true,"byte_exact":true}
q2-exhaustive-and-real-weights.log: {"kind":"generic_down_boundary_correctness","cases":384,"K":[64,128,256,512,640,768,1024,2048],"N":[1,31,32,33,63,64,65,127,128,129,256,2560],"T":[1,2,4,8],"byte_exact":true,"graph_replay":true,"mixed_host_USM_and_device_weights":true,"destination_permutation":true,"output_guards":true,"weights_unchanged":true,"scope":"isolated down kernel boundary shapes, not full model geometry"}
q2-exhaustive-and-real-weights.log: {"kind":"correctness","fixtures":64,"patterns":5,"GU16":true,"GU22":true,"down_and_full_output":"byte-exact","candidate_graph_replay":true,"empty_groups_no_write":true,"guards":true,"finite":true}

Failed

None observed in the completed checks listed above.

Not run

Runtime scope for this retest is the single B70/Linux/AOT setup below. Other GPUs, Windows, multi-GPU serving, JIT and whole-engine native recording were not revalidated.
Old cross-target compilation, broad prompt/logit corpora and historical microbenchmarks are not new-head evidence.
CUDA/HIP/Metal were not built: this patch touches only the separate SYCL implementation.

Environment, exact build settings and complete launch example
  • Ubuntu 24.04, Linux 6.17.0-1007-intel, Intel xe; Xeon w5-3435X, host MemTotal 503.36 GiB.
  • One Arc Pro B70, 32 GB VRAM, PCI 0000:cc:00.0; only that card is visible to the test container (logical GPU 0).
  • Image intel/omix:0.4.0-devel-ubuntu24.04, image ID sha256:53f0003fa66044935d69065836ba8ac40fab289b94655667fdeac0bdfa7e75c6.
  • oneAPI DPC++ 2026.1.1; compute runtime 26.31.39395.13, device driver 1.17.39395+13.
  • Container: --memory 34359738368 --memory-swap -1 --cpus 16 --shm-size 1g; one client, no batching. This is a cgroup limit on a larger host, not validation of a physically 32 GiB machine.
  • llama.cpp dependency 3cf03257f219afbe7334045ff7c6a06ac68c627d; TLA disabled.
  • Qwen3.8-Flash-Next-GSQ-RCO-GGUF, original IQ2_XS, both numbered shards. Model revision ed59f92082b1e93c0e96d60a8b11aab089b52f09.
  • MTP from Qwen/Qwen3.8-Flash-Next, revision de4b8e4d43b917e7706784d8bb445c9af86a3540; observed draft vocabulary 106299 (137.9 MiB head).

Build the candidate with the following commands in the oneAPI environment. Build the upstream comparator identically,
substituting /sources/baseline and /task/build-baseline. Sources are pinned to the full commits above.

source /opt/intel/oneapi/setvars.sh
cmake -S /sources/pr2746/sycl -B /task/build-pr2746 -G 'Unix Makefiles' \
  -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx \
  -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
  -DSTRATA_SYCL_AOT=bmg-g31 -DSTRATA_SYCL_PARITY=ON \
  -DSTRATA_GGML_DIR=/deps/llama.cpp
cmake --build /task/build-pr2746 --target strata -j 6

The following is a complete candidate configuration sample, not an unexplained environment-variable name.
Save it as /task/pr2746-candidate.json. /sources/baseline is the pinned upstream checkout used for the common Python frontend;
/sources/pr2746 is the candidate checkout; /task is the writable test directory. /opt/strata-venv is the serving Python environment mounted into the container. The /models/Strata/... paths are mounts
for the already-prepared pack/tokenizer, the two original GGUF shards and MTP runtime. Adjust those paths to the local files.

{
  "backend": "sycl",
  "exe": "/task/build-pr2746/strata",
  "cwd": "/sources/baseline",
  "args": [
    "--pack",
    "/models/Strata/ed59f92082b1e93c0e96d60a8b11aab089b52f09/pack",
    "--native",
    "/models/Strata/ed59f92082b1e93c0e96d60a8b11aab089b52f09/IQ2_XS/Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00001-of-00002.gguf",
    "--ple-gguf",
    "/models/Strata/ed59f92082b1e93c0e96d60a8b11aab089b52f09/IQ2_XS/Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00002-of-00002.gguf",
    "--expert-profile",
    "/sources/baseline/data/expert-profile.bin",
    "--expert-cache",
    "auto",
    "--stream-experts",
    "--vram-reserve-mib",
    "1536",
    "--no-prefill-borrow",
    "--prefill",
    "auto",
    "--spec",
    "4",
    "--spec-min-p",
    "0.5",
    "--mtp",
    "/models/Strata/mtp-Qwen3.8-Flash-Next-de4b8e4d43b917e7706784d8bb445c9af86a3540/rt",
    "--max-context",
    "131072",
    "--kv",
    "int8",
    "--adapt-every",
    "8",
    "--prompt-cache",
    "0",
    "--kv-resident",
    "32768",
    "--pcie-frac",
    "0.30",
    "--adapt-decay",
    "1",
    "--suffix-draft",
    "3",
    "--host-core",
    "last"
  ],
  "env": {
    "ONEAPI_DEVICE_SELECTOR": "level_zero:gpu",
    "SYCL_CACHE_PERSISTENT": "0",
    "ZES_ENABLE_SYSMAN": "1",
    "STRATA_VERIFY_DEVICE_PLAN": "1",
    "STRATA_VERIFY_NO_HOST": "1",
    "STRATA_STAGER_THREADS": "12",
    "STRATA_MIRROR_MIB": "16384",
    "STRATA_DECODE_TIMING": "1",
    "ZE_AFFINITY_MASK": "0",
    "STRATA_CACHE_DIR": "/task/shared-calibration",
    "STRATA_SYCL_Q2_WORD_EXPAND": "1"
  },
  "tokenizer": "/models/Strata/ed59f92082b1e93c0e96d60a8b11aab089b52f09/pack/tokenizer",
  "model_name": "qwen3.8-flash-next-iq2_xs",
  "log": "/task/pr2746-candidate.log",
  "host": "127.0.0.1",
  "port": 8080,
  "gpu": 0,
  "open_browser": false,
  "parallel": 1,
  "sampling": {
    "temperature": 0.0,
    "seed": 42,
    "top_p": 1.0,
    "top_k": 64,
    "min_p": 0.0,
    "repetition_penalty": 1.0,
    "presence_penalty": 0.0,
    "frequency_penalty": 0.0,
    "penalty_last_n": 64
  }
}

Direct launch with the same frontend/configuration (the collection harness additionally records engine IPC/output identity):

source /opt/intel/oneapi/setvars.sh
cd /sources/baseline
/opt/strata-venv/bin/python -m serve.server --engine strata --config /task/pr2746-candidate.json --port 8080

For the upstream arm, use /task/build-baseline/strata, another log file, and remove only this PR's STRATA_SYCL_* entries.
For the candidate-default correctness arm, keep the candidate executable and remove those same entries.
Leave every common setting, frontend and model unchanged. Clear inherited STRATA_SYCL_*/STRATA_PRIVATE_* variables before launch.
Initialize /task/shared-calibration in an excluded upstream process, issue a full-length warmup, stop it and restart for timing;
all timed processes must read the same unchanged cache rather than calibrating during timing.

Startup checks for the retained run: context 131072, KV int8, resident KV 32768, MTP maximum 4, suffix lookup 3,
spec_min_p=0.50, pool_workers=15, pcie_frac=0.30. INFO spec=6 is the verifier window with MTP maximum 4 and suffix drafting enabled.
Observed initial resident / mirrored expert counts and mirror GiB: [(17756, 6820, 9.17)]. The 16384 MiB setting is the mirror budget, not allocation.

Sampled cgroup memory.current maximum across arms: 1.478–1.492 GiB; sampled swap maximum: 0 bytes. OOM / OOM-kill event deltas: [(0, 0)]. Driver allocations and shared host page cache are not established by these cgroup readings.

Request contents and standalone SSE reproduction example

The small Python example below reconstructs the same request objects used by the retained campaign (21 objects checked against
the three seven-request sequences), and sends one block to the already-running server. Save it as /task/reproduce_requests.py.
It is a portable reproduction client, not the IPC/cgroup collection harness used to produce the table.
The synthetic module may end in a truncated function; that is part of the fixed prompt.

"""Portable request/SSE example; the retained measurement harness is separate."""
import argparse
import hashlib
import json
from pathlib import Path
import time
import urllib.request


def requests(length):
    cap = 128 if length == 4096 else 256
    base = dict(model="strata", temperature=0, reasoning_effort="none",
                max_tokens=cap, stream=True, stream_options=dict(include_usage=True))
    short = dict(base, max_tokens=16, messages=[dict(
        role="user", content="Reply with exactly the word READY.")])
    yield "short-warmup", False, short
    module = "".join(f"def task_{j:05d}(value: int) -> int: return (value * {j % 97 + 1} + {j}) % 100003\n"
                     for j in range(16000))
    suffix = ("\n\nWrite a detailed explanation of the code above. Discuss deterministic integer "
              "transforms, modulo arithmetic, testing, naming, complexity, and maintainability. "
              "Write at least 600 words.")
    sizes = {4096: (7733, 7727), 8192: (15487, 15486), 32768: (62039, 62039)}
    for label, measured, trial in [(f"prompt-warmup-{i}", False, 0) for i in range(1, 4)] + [
            (f"sample-{i}", True, i) for i in range(1, 4)]:
        nonce = (f"trial-{trial}" if trial or length == 32768 else "warmup")
        header = f"Benchmark nonce: series-{length}-{nonce}.\nReview this synthetic Python module:\n"
        content = header + module[:sizes[length][int(bool(trial))]] + suffix
        yield label, measured, dict(base, messages=[dict(role="user", content=content)])


def send(url, body):
    request = urllib.request.Request(url, data=json.dumps(body).encode(),
                                     headers={"Content-Type": "application/json"})
    start = time.perf_counter_ns()
    first = last = None
    usage = None
    text = []
    with urllib.request.urlopen(request, timeout=1200) as response:
        for line in response:
            if not line.startswith(b"data: ") or line.strip() == b"data: [DONE]":
                continue
            chunk = json.loads(line[6:])
            now = time.perf_counter_ns()
            if chunk.get("error"):
                raise RuntimeError(chunk["error"])
            for choice in chunk.get("choices", []):
                content = choice.get("delta", {}).get("content")
                if content:
                    first = now if first is None else first
                    last = now
                    text.append(content)
            if chunk.get("usage"):
                usage = chunk["usage"]
    assert first is not None and usage is not None
    generated = usage["completion_tokens"]
    assert generated > 1
    return dict(TTFT_s=(first-start)/1e9, TPOT_ms=(last-first)/1e6/(generated-1),
                usage=usage, text="".join(text),
                text_sha256=hashlib.sha256("".join(text).encode()).hexdigest())


if __name__ == "__main__":
    p = argparse.ArgumentParser(description=__doc__)
    p.add_argument("--length", type=int, choices=[4096, 8192, 32768], required=True)
    p.add_argument("--url", default="http://127.0.0.1:8080/v1/chat/completions")
    p.add_argument("--output", type=Path, required=True)
    a = p.parse_args()
    with a.output.open("x") as output:
        for label, measured, body in requests(a.length):
            row = dict(label=label, measured=measured, **send(a.url, body))
            output.write(json.dumps(row)+"\n")
            output.flush()
            print(label, row["TTFT_s"], row["TPOT_ms"], row["usage"], flush=True)

For each of 4096, 8192, 32768, restart the engine for upstream-before, candidate and upstream-after,
and run this client once per arm with a distinct output filename, for example:

/opt/strata-venv/bin/python /task/reproduce_requests.py --length 4096 --output /task/pr2746-4096-before.jsonl

For the 4K default-path check, restart the candidate with all new controls unset and use another output filename; exclude it from timing comparisons.
Exclude the first four requests; compare the final three. For full-length requests, check usage input counts 4096 / 8192 / 32768, actual output counts 128 / 256 / 256,
zero reused prompt tokens and matching output text. The retained campaign additionally checks engine token IDs.
Greedy sampling, seed 42, thinking off, sampler defaults and runtime settings are explicit in the configuration above.
Host page cache is not flushed; no disk-cold TTFT is claimed. Suffix drafting is time-adaptive, so actual work counts are retained below.

Individual measured samples, baseline variation and actual draft work

Every block is one fresh engine, one excluded short warmup plus three excluded full-length warmups, then three measured requests.
Order is upstream-before / enabled candidate / upstream-after. There are six upstream and three candidate samples per length.

Input Arm TTFT three samples (s) TPOT three samples (ms/token)
4096 before 3.149371, 3.150595, 3.152376 14.479949, 14.637040, 15.063109
4096 candidate 3.151801, 3.150015, 3.149731 13.798814, 13.914105, 14.356313
4096 after 3.151080, 3.150541, 3.151727 14.491818, 14.644174, 15.078715
8192 before 6.375337, 6.376295, 6.378762 13.147972, 14.486779, 13.948485
8192 candidate 6.372050, 6.374625, 6.371369 12.564659, 13.870295, 13.339747
8192 after 6.382847, 6.382417, 6.375892 13.148602, 14.488043, 13.945491
32768 before 27.298536, 27.286395, 27.289388 14.932906, 14.614676, 13.623534
32768 candidate 27.295543, 27.281601, 27.291975 14.275522, 13.973792, 13.034455
32768 after 27.307277, 27.284974, 27.292654 14.937263, 14.613043, 13.619117
Input Before→after upstream drift TTFT / TPOT Three paired improvements TTFT / TPOT
4096 +0.011% / +0.078% -0.050%, +0.018%, +0.074% / +4.743%, +4.962%, +4.742%
8192 +0.056% / -0.003% +0.110%, +0.074%, +0.093% / +4.439%, +4.260%, +4.354%
32768 +0.013% / -0.004% +0.027%, +0.015%, -0.003% / +4.416%, +4.380%, +4.308%
Input Arm Drafts offered / accepted per measured request
4096 before 112 / 73, 117 / 73, 111 / 68
4096 candidate 112 / 73, 117 / 73, 111 / 68
4096 after 112 / 73, 117 / 73, 111 / 68
8192 before 208 / 162, 219 / 148, 206 / 151
8192 candidate 208 / 162, 220 / 148, 206 / 151
8192 after 208 / 162, 219 / 148, 206 / 151
32768 before 218 / 148, 210 / 148, 199 / 156
32768 candidate 218 / 148, 210 / 148, 199 / 156
32768 after 218 / 148, 210 / 148, 199 / 156

Limits

Development comparison on this single B70/model/configuration. Performance is not established for other hardware, workloads or contexts.
Default behavior is preserved by opt-in dispatch; no default change or formal benchmark approval is claimed.
The older measurements below use different source/defaults and RAM limits and are not the current comparison.

Historical pre-beta description and measurements — superseded by the 2026-10-20 retest above

The following original text is retained as historical evidence. In particular its default-on control descriptions and old tables
do not describe the rebased opt-in source or current 32 GiB measurements.

Summary

Replace the byte-permute/codebook expansion in Q2_0 expert down with exact packed-word shifts, masks and arithmetic. The decoder stays in the existing Q2_0 format specialization and is selected at compile time for the eligible down path. The existing INT8 DP4A operations, scales, FP32 accumulation and reduction order are preserved. On B70, warmed client TPOT improves by 4.18–4.48%; TTFT has no clear improvement.

The change is confined to sycl/src/kernels/cuda/iq_kernels.dp.cpp; decoder helpers remain private to that translation unit. It follows upstream intel_gpu_gen / IntelGpuGen::Battlemage classification and the existing 8-lane, non-legacy, non-split dispatch conditions. There is no model-specific shape whitelist. Other formats and GU keep their existing algorithms and dispatch. Non-Battlemage devices retain the original decoder dispatch; eligible Q2 calls still incur the added cached host device check.

Dispatch control

STRATA_SYCL_Q2_WORD_EXPAND controls the entire optimization:

  • Unset (default) or 1: use word expansion when the existing dispatch and Battlemage guards allow it.
  • 0: use the original Q2_0 down path. There are no child switches.

Set it before starting the engine and restart after changing it; the value is cached on first use. Normal operation needs no environment-variable setting.

B70 validation

Intel Arc Pro B70 32 GB, Linux/xe; intel/omix:0.4.0-devel-ubuntu24.04, oneAPI DPC++ 2026.1.1, compute runtime 26.31.39395.13, Level Zero loader 1.32.0. Container limits: 128 GiB RAM and 16 CPU quota. Builds and GPU tests ran inside the container, with AOT bmg-g31.

  • Release engine build and native_grouped_parity pass with default and fallback dispatch.
  • All 65,536 packed 16-bit words decode byte-identically to the original GPU implementation and CPU codebook; upper-bit handling is also checked.
  • Real-GGUF expert tests pass byte-exact down and full-output comparisons with five activation patterns, T=1–8, GU16/GU22, graph replay, mixed host/device weights, empty groups and output guards.
  • In the endpoint measurements below, corresponding output token IDs match across all arms, including warmups. Actual speculative work and cache capacity match between arms.

Timings and endpoint identity checks below were collected at fe47faa548ea6aba50101987bc255b5ed8eccd03, before the source cleanup. The current revision rebuilds the engine and parity targets and repeats decoder/down correctness validation. For these B70 AOT builds, executed kernel instructions and resource settings match the measured version; differences are limited to naming and non-executed markers after the final EOT. No new latency run is claimed.

End-to-end performance

Baseline and frontend: upstream 296b59d2f73c8f04a805df29c2fa97655adace78. The candidate adds only this Q2 down change and uses its default production dispatch.

Each input length uses baseline / candidate / baseline, restarting the engine for each arm. Exclude one short request and three full-input warmups, then measure three requests per arm. Changes average the three request-wise percentage changes relative to the mean of the matching before/after baseline samples; negative means faster. All three TPOT pairs improve at every input length.

TTFT is request send to the first nonempty SSE text arrival. TPOT is the first-to-last nonempty SSE arrival interval divided by generated tokens minus one. These are warmed, post-readiness measurements; the host page cache was not flushed.

Input / output tokens TTFT baseline → default (s) Change TPOT baseline → default (ms/token) Change
4096 / 128 3.500022 → 3.495323 -0.134% 14.552169 → 13.920341 -4.345%
8192 / 256 7.094365 → 7.104670 +0.145% 13.751785 → 13.134993 -4.477%
32768 / 256 30.016363 → 30.018130 +0.006% 14.223863 → 13.630544 -4.183%

Baseline before/after TPOT drift: +0.034%, +0.043%, -0.003%; TTFT drift: -0.177%, +0.362%, +0.017%, respectively.

Model and fixed configuration
  • Qwen3.8-Flash-Next-GSQ-RCO IQ2_XS, model revision ed59f92082b1e93c0e96d60a8b11aab089b52f09. Its routed expert down matrices use Q2_0.
  • Greedy seed 42, thinking off; INT8 KV, max context 131072, resident KV 32768; prompt cache off.
  • --expert-cache auto, reserve 1536 MiB, mirror budget 32768 MiB; auto prefill, no prefill borrowing.
  • spec4 / min-p0.5 / suffix3; adapt-every8 / decay1. Actual windows/offered/accepted match for corresponding measured requests.
  • Actual capacity in every arm: 17758 resident expert slots and 6818 mirrored experts, approximately 9.17 GiB. The 32768 MiB mirror setting is a budget.
  • Common environment: STRATA_VERIFY_DEVICE_PLAN=1, STRATA_VERIFY_NO_HOST=1, STRATA_STAGER_THREADS=12, STRATA_MIRROR_MIB=32768, STRATA_DECODE_TIMING=1, ONEAPI_DEVICE_SELECTOR=level_zero:gpu, SYCL_CACHE_PERSISTENT=0. Normal timing runs have no profiler.

Down microbenchmark

Real GGUF weights at the model's down dimensions, K=640 and N=2560, with deterministic synthetic activations and fixed expert-group replay inputs. T is the token-window size. The probe directly selects the original or word-expansion down implementation in the same binary; end-to-end results above use production dispatch.

Three measured samples per baseline / candidate / baseline arm; each sample excludes at least 2 seconds/1000 calls of warmup and measures at least 3 seconds/2000 calls. These are steady graph-replay batched wall times including host submission and the final queue wait. They are not isolated GPU instruction latency, and their percentages are not added to endpoint gains.

K / N / T Original (µs) Word expansion (µs) Change Baseline drift
640 / 2560 / 1 40.445 22.696 -43.883% -0.180%
640 / 2560 / 2 55.619 32.673 -41.255% +0.024%
640 / 2560 / 3 78.320 45.022 -42.515% +0.011%
640 / 2560 / 4 81.888 44.822 -45.264% -0.016%

All three corresponding samples improve for each listed row. These measurements and current validation cover single-card B70 AOT; Windows, multi-GPU operation and JIT paths on other devices were not tested.


🔄 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/2746 **Author:** [@xiangyuT](https://github.com/xiangyuT) **Created:** 10/16/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/sycl-q2-down-word-expand` --- ### 📝 Commits (3) - [`fe47faa`](https://github.com/Niko1221/Strata/commit/fe47faa548ea6aba50101987bc255b5ed8eccd03) sycl: expand Q2_0 down weights with packed word operations - [`44b21f6`](https://github.com/Niko1221/Strata/commit/44b21f6302dcdd95c775cdf2273bf1861b2595e0) sycl: keep Q2 decoder local to its kernel translation unit - [`e801853`](https://github.com/Niko1221/Strata/commit/e8018531183b8213ab4726f57656003a08452c20) sycl: select Q2 word decoding without synthetic format IDs ### 📊 Changes **1 file changed** (+95 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `sycl/src/kernels/cuda/iq_kernels.dp.cpp` (+95 -11) </details> ### 📄 Description ## Problem and result Eligible Q2_0 expert-down kernels expand packed codes with byte/codebook operations. This patch uses exact packed-word shifts, masks and arithmetic while preserving INT8 DP4A operations, scales, FP32 accumulation and reduction order. 2026-10-20 retest on a single Arc Pro B70, **32 GiB container RAM limit**, upstream **0.2.0-beta**: upstream/common frontend `e88ee39d1d6be6e3364183af3b39b62a7ed6f211`; independent candidate `97dd6dd8a10290165849d6764576ebb85f2c5032`. All three lengths are complete. These are standalone-PR results; no other preview optimizations are enabled. | Input / output | TTFT upstream → enabled (s) | Improvement | TPOT upstream → enabled (ms/token) | Improvement | | --- | ---: | ---: | ---: | ---: | | 4096 / 128 | 3.150948 → 3.150516 | +0.014% | 14.732468 → 14.023078 | +4.816% | | 8192 / 256 | 6.378591 → 6.372681 | +0.093% | 13.860895 → 13.258234 | +4.351% | | 32768 / 256 | 27.293204 → 27.289707 | +0.013% | 14.390090 → 13.761256 | +4.368% | Positive improvement means lower latency: mean of three request-wise `100 × (1 − candidate / mean(upstream-before, upstream-after))` values. The displayed upstream time averages both bracketing blocks. TTFT is request-to-first nonempty SSE text; TPOT is first-to-last nonempty SSE text arrival divided by engine-generated tokens minus one. Tiny changes near baseline variation do not establish a meaningful improvement. ## Related discussion **Source status (2026-10-20):** source branch `feat/sycl-q2-down-word-expand` now points to the tested candidate `97dd6dd8a10290165849d6764576ebb85f2c5032`. This PR remains closed; GitHub still reports PR head `e8018531183b8213ab4726f57656003a08452c20`. All new measurements and validation in this description apply to the tested candidate. Reopening remains for maintainer review. This updates the existing PR after the 0.2.0-beta reset and current contribution requirements; it is not a competing submission. Scope and reopening remain for maintainer review in this thread. Historical pre-beta evidence is folded below. Related IQ decode implementation: [#2802](https://github.com/Niko1221/Strata/pull/2802) / [#2801](https://github.com/Niko1221/Strata/issues/2801) directly overlap in Q2 shift/mask expansion arithmetic, with additional formats and lane variants. Coordinate the common subset in these existing PRs to avoid duplicate implementations. ## Approach Battlemage, existing 8-lane/non-legacy/non-split Q2_0 down dispatch. No model-specific shape whitelist. Other formats and gate/up retain their algorithms. Non-Battlemage devices keep the original decoder; eligible Q2 calls still incur the added cached host device check. **New paths are now opt-in.** Every control below is disabled when unset or `0`. Set controls before starting the engine and restart after changes because values are cached/read during initialization. Only the controls for this PR are set to `1` in the measured candidate; pure upstream and the candidate-default check leave them unset. | Control | With `1` | | --- | --- | | `STRATA_SYCL_Q2_WORD_EXPAND` | Entire packed-word Q2_0 down optimization; no child switches. | Leave Q2_WORD_EXPAND unset or set it to 0 to use the original decoder. ## Validation ### Passed - Exact-source SYCL Release/AOT `bmg-g31` engine build. No non-SYCL backend files are changed. - Default-off/enabled native_grouped_parity and the exhaustive packed-word plus real-weight down/full-output diagnostic pass. - Fresh-process serving: all seven corresponding requests (one short warmup, three full-input warmups, three measured requests) have identical engine token IDs and text across upstream-before / enabled candidate / upstream-after at every length. The extra 4K candidate-default block also matches all seven requests. - Timing blocks restart after an excluded INT8 calibration process, read the same persisted crossover file, and verify its hash is unchanged. Warmup/calibrating/default-functional blocks are excluded from performance. Sanitized operator output: ```text native-grouped-default.log: native_grouped_parity: 0 failures native-grouped-enabled.log: native_grouped_parity: 0 failures q2-exhaustive-and-real-weights.log: {"kind":"decode_correctness","words":65536,"bytes_per_word":8,"upper_bits_ignored":true,"byte_exact":true} q2-exhaustive-and-real-weights.log: {"kind":"generic_down_boundary_correctness","cases":384,"K":[64,128,256,512,640,768,1024,2048],"N":[1,31,32,33,63,64,65,127,128,129,256,2560],"T":[1,2,4,8],"byte_exact":true,"graph_replay":true,"mixed_host_USM_and_device_weights":true,"destination_permutation":true,"output_guards":true,"weights_unchanged":true,"scope":"isolated down kernel boundary shapes, not full model geometry"} q2-exhaustive-and-real-weights.log: {"kind":"correctness","fixtures":64,"patterns":5,"GU16":true,"GU22":true,"down_and_full_output":"byte-exact","candidate_graph_replay":true,"empty_groups_no_write":true,"guards":true,"finite":true} ``` ### Failed None observed in the completed checks listed above. ### Not run Runtime scope for this retest is the single B70/Linux/AOT setup below. Other GPUs, Windows, multi-GPU serving, JIT and whole-engine native recording were not revalidated. Old cross-target compilation, broad prompt/logit corpora and historical microbenchmarks are not new-head evidence. CUDA/HIP/Metal were not built: this patch touches only the separate SYCL implementation. <details> <summary>Environment, exact build settings and complete launch example</summary> - Ubuntu 24.04, Linux `6.17.0-1007-intel`, Intel xe; Xeon w5-3435X, host MemTotal 503.36 GiB. - One Arc Pro B70, 32 GB VRAM, PCI `0000:cc:00.0`; only that card is visible to the test container (logical GPU `0`). - Image `intel/omix:0.4.0-devel-ubuntu24.04`, image ID `sha256:53f0003fa66044935d69065836ba8ac40fab289b94655667fdeac0bdfa7e75c6`. - oneAPI DPC++ `2026.1.1`; compute runtime `26.31.39395.13`, device driver `1.17.39395+13`. - Container: `--memory 34359738368 --memory-swap -1 --cpus 16 --shm-size 1g`; one client, no batching. This is a cgroup limit on a larger host, not validation of a physically 32 GiB machine. - `llama.cpp` dependency `3cf03257f219afbe7334045ff7c6a06ac68c627d`; TLA disabled. - [Qwen3.8-Flash-Next-GSQ-RCO-GGUF](https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF/tree/ed59f92082b1e93c0e96d60a8b11aab089b52f09/IQ2_XS), original IQ2_XS, both numbered shards. Model revision `ed59f92082b1e93c0e96d60a8b11aab089b52f09`. - MTP from [Qwen/Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next/tree/de4b8e4d43b917e7706784d8bb445c9af86a3540), revision `de4b8e4d43b917e7706784d8bb445c9af86a3540`; observed draft vocabulary `106299` (137.9 MiB head). Build the candidate with the following commands in the oneAPI environment. Build the upstream comparator identically, substituting `/sources/baseline` and `/task/build-baseline`. Sources are pinned to the full commits above. ```sh source /opt/intel/oneapi/setvars.sh cmake -S /sources/pr2746/sycl -B /task/build-pr2746 -G 'Unix Makefiles' \ -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx \ -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DSTRATA_SYCL_AOT=bmg-g31 -DSTRATA_SYCL_PARITY=ON \ -DSTRATA_GGML_DIR=/deps/llama.cpp cmake --build /task/build-pr2746 --target strata -j 6 ``` The following is a complete candidate configuration sample, not an unexplained environment-variable name. Save it as `/task/pr2746-candidate.json`. `/sources/baseline` is the pinned upstream checkout used for the common Python frontend; `/sources/pr2746` is the candidate checkout; `/task` is the writable test directory. `/opt/strata-venv` is the serving Python environment mounted into the container. The `/models/Strata/...` paths are mounts for the already-prepared pack/tokenizer, the two original GGUF shards and MTP runtime. Adjust those paths to the local files. ```json { "backend": "sycl", "exe": "/task/build-pr2746/strata", "cwd": "/sources/baseline", "args": [ "--pack", "/models/Strata/ed59f92082b1e93c0e96d60a8b11aab089b52f09/pack", "--native", "/models/Strata/ed59f92082b1e93c0e96d60a8b11aab089b52f09/IQ2_XS/Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00001-of-00002.gguf", "--ple-gguf", "/models/Strata/ed59f92082b1e93c0e96d60a8b11aab089b52f09/IQ2_XS/Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00002-of-00002.gguf", "--expert-profile", "/sources/baseline/data/expert-profile.bin", "--expert-cache", "auto", "--stream-experts", "--vram-reserve-mib", "1536", "--no-prefill-borrow", "--prefill", "auto", "--spec", "4", "--spec-min-p", "0.5", "--mtp", "/models/Strata/mtp-Qwen3.8-Flash-Next-de4b8e4d43b917e7706784d8bb445c9af86a3540/rt", "--max-context", "131072", "--kv", "int8", "--adapt-every", "8", "--prompt-cache", "0", "--kv-resident", "32768", "--pcie-frac", "0.30", "--adapt-decay", "1", "--suffix-draft", "3", "--host-core", "last" ], "env": { "ONEAPI_DEVICE_SELECTOR": "level_zero:gpu", "SYCL_CACHE_PERSISTENT": "0", "ZES_ENABLE_SYSMAN": "1", "STRATA_VERIFY_DEVICE_PLAN": "1", "STRATA_VERIFY_NO_HOST": "1", "STRATA_STAGER_THREADS": "12", "STRATA_MIRROR_MIB": "16384", "STRATA_DECODE_TIMING": "1", "ZE_AFFINITY_MASK": "0", "STRATA_CACHE_DIR": "/task/shared-calibration", "STRATA_SYCL_Q2_WORD_EXPAND": "1" }, "tokenizer": "/models/Strata/ed59f92082b1e93c0e96d60a8b11aab089b52f09/pack/tokenizer", "model_name": "qwen3.8-flash-next-iq2_xs", "log": "/task/pr2746-candidate.log", "host": "127.0.0.1", "port": 8080, "gpu": 0, "open_browser": false, "parallel": 1, "sampling": { "temperature": 0.0, "seed": 42, "top_p": 1.0, "top_k": 64, "min_p": 0.0, "repetition_penalty": 1.0, "presence_penalty": 0.0, "frequency_penalty": 0.0, "penalty_last_n": 64 } } ``` Direct launch with the same frontend/configuration (the collection harness additionally records engine IPC/output identity): ```sh source /opt/intel/oneapi/setvars.sh cd /sources/baseline /opt/strata-venv/bin/python -m serve.server --engine strata --config /task/pr2746-candidate.json --port 8080 ``` For the upstream arm, use `/task/build-baseline/strata`, another log file, and remove only this PR's `STRATA_SYCL_*` entries. For the candidate-default correctness arm, keep the candidate executable and remove those same entries. Leave every common setting, frontend and model unchanged. Clear inherited `STRATA_SYCL_*`/`STRATA_PRIVATE_*` variables before launch. Initialize `/task/shared-calibration` in an excluded upstream process, issue a full-length warmup, stop it and restart for timing; all timed processes must read the same unchanged cache rather than calibrating during timing. Startup checks for the retained run: context `131072`, KV `int8`, resident KV `32768`, MTP maximum `4`, suffix lookup `3`, `spec_min_p=0.50`, `pool_workers=15`, `pcie_frac=0.30`. INFO `spec=6` is the verifier window with MTP maximum `4` and suffix drafting enabled. Observed initial resident / mirrored expert counts and mirror GiB: [(17756, 6820, 9.17)]. The `16384` MiB setting is the mirror budget, not allocation. Sampled cgroup memory.current maximum across arms: 1.478–1.492 GiB; sampled swap maximum: 0 bytes. OOM / OOM-kill event deltas: [(0, 0)]. Driver allocations and shared host page cache are not established by these cgroup readings. </details> <details> <summary>Request contents and standalone SSE reproduction example</summary> The small Python example below reconstructs the same request objects used by the retained campaign (21 objects checked against the three seven-request sequences), and sends one block to the already-running server. Save it as `/task/reproduce_requests.py`. It is a portable reproduction client, not the IPC/cgroup collection harness used to produce the table. The synthetic module may end in a truncated function; that is part of the fixed prompt. ```python """Portable request/SSE example; the retained measurement harness is separate.""" import argparse import hashlib import json from pathlib import Path import time import urllib.request def requests(length): cap = 128 if length == 4096 else 256 base = dict(model="strata", temperature=0, reasoning_effort="none", max_tokens=cap, stream=True, stream_options=dict(include_usage=True)) short = dict(base, max_tokens=16, messages=[dict( role="user", content="Reply with exactly the word READY.")]) yield "short-warmup", False, short module = "".join(f"def task_{j:05d}(value: int) -> int: return (value * {j % 97 + 1} + {j}) % 100003\n" for j in range(16000)) suffix = ("\n\nWrite a detailed explanation of the code above. Discuss deterministic integer " "transforms, modulo arithmetic, testing, naming, complexity, and maintainability. " "Write at least 600 words.") sizes = {4096: (7733, 7727), 8192: (15487, 15486), 32768: (62039, 62039)} for label, measured, trial in [(f"prompt-warmup-{i}", False, 0) for i in range(1, 4)] + [ (f"sample-{i}", True, i) for i in range(1, 4)]: nonce = (f"trial-{trial}" if trial or length == 32768 else "warmup") header = f"Benchmark nonce: series-{length}-{nonce}.\nReview this synthetic Python module:\n" content = header + module[:sizes[length][int(bool(trial))]] + suffix yield label, measured, dict(base, messages=[dict(role="user", content=content)]) def send(url, body): request = urllib.request.Request(url, data=json.dumps(body).encode(), headers={"Content-Type": "application/json"}) start = time.perf_counter_ns() first = last = None usage = None text = [] with urllib.request.urlopen(request, timeout=1200) as response: for line in response: if not line.startswith(b"data: ") or line.strip() == b"data: [DONE]": continue chunk = json.loads(line[6:]) now = time.perf_counter_ns() if chunk.get("error"): raise RuntimeError(chunk["error"]) for choice in chunk.get("choices", []): content = choice.get("delta", {}).get("content") if content: first = now if first is None else first last = now text.append(content) if chunk.get("usage"): usage = chunk["usage"] assert first is not None and usage is not None generated = usage["completion_tokens"] assert generated > 1 return dict(TTFT_s=(first-start)/1e9, TPOT_ms=(last-first)/1e6/(generated-1), usage=usage, text="".join(text), text_sha256=hashlib.sha256("".join(text).encode()).hexdigest()) if __name__ == "__main__": p = argparse.ArgumentParser(description=__doc__) p.add_argument("--length", type=int, choices=[4096, 8192, 32768], required=True) p.add_argument("--url", default="http://127.0.0.1:8080/v1/chat/completions") p.add_argument("--output", type=Path, required=True) a = p.parse_args() with a.output.open("x") as output: for label, measured, body in requests(a.length): row = dict(label=label, measured=measured, **send(a.url, body)) output.write(json.dumps(row)+"\n") output.flush() print(label, row["TTFT_s"], row["TPOT_ms"], row["usage"], flush=True) ``` For each of `4096`, `8192`, `32768`, restart the engine for upstream-before, candidate and upstream-after, and run this client once per arm with a distinct output filename, for example: ```sh /opt/strata-venv/bin/python /task/reproduce_requests.py --length 4096 --output /task/pr2746-4096-before.jsonl ``` For the 4K default-path check, restart the candidate with all new controls unset and use another output filename; exclude it from timing comparisons. Exclude the first four requests; compare the final three. For full-length requests, check usage input counts `4096` / `8192` / `32768`, actual output counts `128` / `256` / `256`, zero reused prompt tokens and matching output text. The retained campaign additionally checks engine token IDs. Greedy sampling, seed `42`, thinking off, sampler defaults and runtime settings are explicit in the configuration above. Host page cache is not flushed; no disk-cold TTFT is claimed. Suffix drafting is time-adaptive, so actual work counts are retained below. </details> <details> <summary>Individual measured samples, baseline variation and actual draft work</summary> Every block is one fresh engine, one excluded short warmup plus three excluded full-length warmups, then three measured requests. Order is upstream-before / enabled candidate / upstream-after. There are six upstream and three candidate samples per length. | Input | Arm | TTFT three samples (s) | TPOT three samples (ms/token) | | --- | --- | --- | --- | | 4096 | before | 3.149371, 3.150595, 3.152376 | 14.479949, 14.637040, 15.063109 | | 4096 | candidate | 3.151801, 3.150015, 3.149731 | 13.798814, 13.914105, 14.356313 | | 4096 | after | 3.151080, 3.150541, 3.151727 | 14.491818, 14.644174, 15.078715 | | 8192 | before | 6.375337, 6.376295, 6.378762 | 13.147972, 14.486779, 13.948485 | | 8192 | candidate | 6.372050, 6.374625, 6.371369 | 12.564659, 13.870295, 13.339747 | | 8192 | after | 6.382847, 6.382417, 6.375892 | 13.148602, 14.488043, 13.945491 | | 32768 | before | 27.298536, 27.286395, 27.289388 | 14.932906, 14.614676, 13.623534 | | 32768 | candidate | 27.295543, 27.281601, 27.291975 | 14.275522, 13.973792, 13.034455 | | 32768 | after | 27.307277, 27.284974, 27.292654 | 14.937263, 14.613043, 13.619117 | | Input | Before→after upstream drift TTFT / TPOT | Three paired improvements TTFT / TPOT | | --- | --- | --- | | 4096 | +0.011% / +0.078% | -0.050%, +0.018%, +0.074% / +4.743%, +4.962%, +4.742% | | 8192 | +0.056% / -0.003% | +0.110%, +0.074%, +0.093% / +4.439%, +4.260%, +4.354% | | 32768 | +0.013% / -0.004% | +0.027%, +0.015%, -0.003% / +4.416%, +4.380%, +4.308% | | Input | Arm | Drafts offered / accepted per measured request | | --- | --- | --- | | 4096 | before | 112 / 73, 117 / 73, 111 / 68 | | 4096 | candidate | 112 / 73, 117 / 73, 111 / 68 | | 4096 | after | 112 / 73, 117 / 73, 111 / 68 | | 8192 | before | 208 / 162, 219 / 148, 206 / 151 | | 8192 | candidate | 208 / 162, 220 / 148, 206 / 151 | | 8192 | after | 208 / 162, 219 / 148, 206 / 151 | | 32768 | before | 218 / 148, 210 / 148, 199 / 156 | | 32768 | candidate | 218 / 148, 210 / 148, 199 / 156 | | 32768 | after | 218 / 148, 210 / 148, 199 / 156 | </details> ## Limits Development comparison on this single B70/model/configuration. Performance is not established for other hardware, workloads or contexts. Default behavior is preserved by opt-in dispatch; no default change or formal benchmark approval is claimed. The older measurements below use different source/defaults and RAM limits and are not the current comparison. <details> <summary>Historical pre-beta description and measurements — superseded by the 2026-10-20 retest above</summary> The following original text is retained as historical evidence. In particular its default-on control descriptions and old tables do not describe the rebased opt-in source or current 32 GiB measurements. ## Summary Replace the byte-permute/codebook expansion in Q2_0 expert down with exact packed-word shifts, masks and arithmetic. The decoder stays in the existing Q2_0 format specialization and is selected at compile time for the eligible down path. The existing INT8 DP4A operations, scales, FP32 accumulation and reduction order are preserved. On B70, warmed client TPOT improves by 4.18–4.48%; TTFT has no clear improvement. The change is confined to `sycl/src/kernels/cuda/iq_kernels.dp.cpp`; decoder helpers remain private to that translation unit. It follows upstream `intel_gpu_gen` / `IntelGpuGen::Battlemage` classification and the existing 8-lane, non-legacy, non-split dispatch conditions. There is no model-specific shape whitelist. Other formats and GU keep their existing algorithms and dispatch. Non-Battlemage devices retain the original decoder dispatch; eligible Q2 calls still incur the added cached host device check. ## Dispatch control `STRATA_SYCL_Q2_WORD_EXPAND` controls the entire optimization: - Unset (default) or `1`: use word expansion when the existing dispatch and Battlemage guards allow it. - `0`: use the original Q2_0 down path. There are no child switches. Set it before starting the engine and restart after changing it; the value is cached on first use. Normal operation needs no environment-variable setting. ## B70 validation Intel Arc Pro B70 32 GB, Linux/xe; `intel/omix:0.4.0-devel-ubuntu24.04`, oneAPI DPC++ 2026.1.1, compute runtime 26.31.39395.13, Level Zero loader 1.32.0. Container limits: 128 GiB RAM and 16 CPU quota. Builds and GPU tests ran inside the container, with AOT `bmg-g31`. - Release engine build and `native_grouped_parity` pass with default and fallback dispatch. - All 65,536 packed 16-bit words decode byte-identically to the original GPU implementation and CPU codebook; upper-bit handling is also checked. - Real-GGUF expert tests pass byte-exact down and full-output comparisons with five activation patterns, T=1–8, GU16/GU22, graph replay, mixed host/device weights, empty groups and output guards. - In the endpoint measurements below, corresponding output token IDs match across all arms, including warmups. Actual speculative work and cache capacity match between arms. Timings and endpoint identity checks below were collected at `fe47faa548ea6aba50101987bc255b5ed8eccd03`, before the source cleanup. The current revision rebuilds the engine and parity targets and repeats decoder/down correctness validation. For these B70 AOT builds, executed kernel instructions and resource settings match the measured version; differences are limited to naming and non-executed markers after the final EOT. No new latency run is claimed. ## End-to-end performance Baseline and frontend: upstream `296b59d2f73c8f04a805df29c2fa97655adace78`. The candidate adds only this Q2 down change and uses its default production dispatch. Each input length uses baseline / candidate / baseline, restarting the engine for each arm. Exclude one short request and three full-input warmups, then measure three requests per arm. Changes average the three request-wise percentage changes relative to the mean of the matching before/after baseline samples; negative means faster. All three TPOT pairs improve at every input length. TTFT is request send to the first nonempty SSE text arrival. TPOT is the first-to-last nonempty SSE arrival interval divided by generated tokens minus one. These are warmed, post-readiness measurements; the host page cache was not flushed. | Input / output tokens | TTFT baseline → default (s) | Change | TPOT baseline → default (ms/token) | Change | |---|---:|---:|---:|---:| | 4096 / 128 | 3.500022 → 3.495323 | -0.134% | 14.552169 → 13.920341 | -4.345% | | 8192 / 256 | 7.094365 → 7.104670 | +0.145% | 13.751785 → 13.134993 | -4.477% | | 32768 / 256 | 30.016363 → 30.018130 | +0.006% | 14.223863 → 13.630544 | -4.183% | Baseline before/after TPOT drift: +0.034%, +0.043%, -0.003%; TTFT drift: -0.177%, +0.362%, +0.017%, respectively. <details> <summary>Model and fixed configuration</summary> - Qwen3.8-Flash-Next-GSQ-RCO IQ2_XS, model revision `ed59f92082b1e93c0e96d60a8b11aab089b52f09`. Its routed expert down matrices use Q2_0. - Greedy seed 42, thinking off; INT8 KV, max context 131072, resident KV 32768; prompt cache off. - `--expert-cache auto`, reserve 1536 MiB, mirror budget 32768 MiB; auto prefill, no prefill borrowing. - spec4 / min-p0.5 / suffix3; adapt-every8 / decay1. Actual windows/offered/accepted match for corresponding measured requests. - Actual capacity in every arm: 17758 resident expert slots and 6818 mirrored experts, approximately 9.17 GiB. The 32768 MiB mirror setting is a budget. - Common environment: `STRATA_VERIFY_DEVICE_PLAN=1`, `STRATA_VERIFY_NO_HOST=1`, `STRATA_STAGER_THREADS=12`, `STRATA_MIRROR_MIB=32768`, `STRATA_DECODE_TIMING=1`, `ONEAPI_DEVICE_SELECTOR=level_zero:gpu`, `SYCL_CACHE_PERSISTENT=0`. Normal timing runs have no profiler. </details> ## Down microbenchmark Real GGUF weights at the model's down dimensions, K=640 and N=2560, with deterministic synthetic activations and fixed expert-group replay inputs. T is the token-window size. The probe directly selects the original or word-expansion down implementation in the same binary; end-to-end results above use production dispatch. Three measured samples per baseline / candidate / baseline arm; each sample excludes at least 2 seconds/1000 calls of warmup and measures at least 3 seconds/2000 calls. These are steady graph-replay batched wall times including host submission and the final queue wait. They are not isolated GPU instruction latency, and their percentages are not added to endpoint gains. | K / N / T | Original (µs) | Word expansion (µs) | Change | Baseline drift | |---|---:|---:|---:|---:| | 640 / 2560 / 1 | 40.445 | 22.696 | -43.883% | -0.180% | | 640 / 2560 / 2 | 55.619 | 32.673 | -41.255% | +0.024% | | 640 / 2560 / 3 | 78.320 | 45.022 | -42.515% | +0.011% | | 640 / 2560 / 4 | 81.888 | 44.822 | -45.264% | -0.016% | All three corresponding samples improve for each listed row. These measurements and current validation cover single-card B70 AOT; Windows, multi-GPU operation and JIT paths on other devices were not tested. </details> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:34:15 +07:00
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#4238
No description provided.