ci(intel-runner): Inkling 2 Mini gates on the Arc Pro B70 (UD-Q4_K_XL and SQ-20)

A second job in intel-runner.yml, started with `gh workflow run intel-runner.yml --ref ci/intel-runner -f job=inkling`
(a push to ci/intel-runner still runs only the existing Hy4 job). It builds strata-inkling for SYCL (bmg_g31 + spir64),
makes a Python venv from terminal/requirements.txt, then for each model downloads the file from Hugging Face, runs
.github/ci/inkling/b70_gate.sh and deletes the file:

  - selfcheck (a .strata), --bench at --parallel 1 and 32 (prefill and decode tok/s),
  - five greedy `--draft off` 64-token runs: the logits hash must be the same in all five,
  - the server: first chat with the answer text checked, needle prompts of about 4K and 32K tokens,
  - the server with --parallel 32 and 32 concurrent clients (all answers checked).

Models: Inkling-2-Mini-UD-Q4_K_XL.gguf with dspark-Inkling-2-Mini-Q8_0.gguf (unsloth), then Inkling-2-Mini-SQ-20.strata
(sha256 checked). The logs are uploaded as the artifact b70-inkling-logs; each step prints its summary lines.
This commit is contained in:
Niko1221 committed 2026-11-23 14:45:36 +01:00
1 parent de1768f2b1
commit 96113f298e
6 files changed
+685

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
#!/bin/bash
# Inkling 2 Mini correctness + C1 / C32 gate for one model on the Arc Pro B70 runner (SYCL).
# b70_gate.sh <label> <model> <exe> <tokdir> <py> <repo-root> <out-dir> [dspark-gguf]
# 1 selfcheck (a .strata only); 2 bench at --parallel 1 and 32 (prefill / decode tok/s); 3 five greedy `--draft off` 64-token runs (logits sha, the number of
# distinct hashes must be 1); 4 server: first chat (answer text checked), needle prompts at about 4K and 32K tokens; 5 server with --parallel 32 and 32 clients.
# Prints one summary line per step; exit status 1 when a check failed (the later steps still run).
set -u
L=$1; MODEL=$2; EXE=$3; TOK=$4; PY=$5; ROOT=$6; O=$7; DSP=${8:-}
HERE=$(cd "$(dirname "$0")" && pwd)
mkdir -p "$O"
DS=(); [ -n "$DSP" ] && DS=(--dspark "$DSP")
export UR_LOADER_USE_LEVEL_ZERO_V2=0 ONEAPI_DEVICE_SELECTOR=level_zero:gpu
bad=0
echo "== $(date +%T) gate $L: $MODEL"
echo "free RAM $(awk '/MemAvailable/ {print int($2/1048576)}' /proc/meminfo) GiB"
if [ "${MODEL##*.}" = "strata" ]; then
timeout 900 "$EXE" --selfcheck --native "$MODEL" --gpus 1 --max-context 4096 > "$O/selfcheck.log" 2>&1
rc=$?; echo "selfcheck rc=$rc $(grep -E 'selfcheck|SELFCHECK|PASS|FAIL' "$O/selfcheck.log" | head -2 | cut -c1-200)"; [ $rc -eq 0 ] || bad=1
fi
for par in 1 32; do
timeout 3000 "$EXE" --bench --native "$MODEL" ${DS[@]+"${DS[@]}"} --gpus 1 --parallel $par --max-context 4096 --prompt-len 512 --gen 64 > "$O/bench-c$par.log" 2>&1
rc=$?
echo "bench C$par rc=$rc $(grep -E '^\[bench\]' "$O/bench-c$par.log" | cut -c1-240)"
if [ $rc -ne 0 ]; then bad=1; grep -E "init:|sycl:|dalloc|out of device" "$O/bench-c$par.log" | head -3 | cut -c1-400; fi
done
grep -E "loaded|runner ready|VRAM experts" "$O/bench-c1.log" | head -3 | cut -c1-300
I64=$(seq -s, 101 164); shas=""
for n in 1 2 3 4 5; do
timeout 1800 "$EXE" --native "$MODEL" ${DS[@]+"${DS[@]}"} --gpus 1 --max-context 4096 --draft off --prompt-ids "$I64" --gen 16 --dump-ref "$O/l64-$n.bin" > "$O/p64-$n.log" 2>&1
s=$(sha256sum "$O/l64-$n.bin" 2>/dev/null | cut -c1-16); shas="$shas $s"
echo "p64 run $n rc=$? ids=$(tail -n 1 "$O/p64-$n.log" | cut -c1-70) sha=$s"
rm -f "$O/l64-$n.bin"
done
nd=$(echo $shas | tr ' ' '\n' | sort -u | wc -l)
echo "p64 distinct logits hashes in 5 runs: $nd"; [ "$nd" = "1" ] || bad=1
"$PY" "$HERE/serve_chat.py" --out "$O/chat" --src "$ROOT" --exe "$EXE" --tok "$TOK" --port 18781 --model-name "$L" --wait 1800 \
--post "$HERE/longctx_chat.py {port} 4096" --post "$HERE/longctx_chat.py {port} 32000" -- --native "$MODEL" ${DS[@]+"${DS[@]}"} --max-context 40960 --draft dspark
rc=$?; echo "chat+needles rc=$rc"; [ $rc -eq 0 ] || bad=1
"$PY" "$HERE/serve_chat.py" --out "$O/c32" --src "$ROOT" --exe "$EXE" --tok "$TOK" --port 18782 --model-name "$L" --wait 1800 --no-chat \
--post "$HERE/c32_chat.py {port} 32 24" -- --native "$MODEL" ${DS[@]+"${DS[@]}"} --max-context 4096 --parallel 32 --draft dspark
rc=$?; echo "c32 server rc=$rc"; [ $rc -eq 0 ] || bad=1
echo "== $(date +%T) gate $L done, failures: $bad"
exit $bad
+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env python3
"""c32c_chat.py PORT [CLIENTS=32] [MAXTOK=24] [OFFSET=0] : like c32_chat.py, but client i asks about index i+OFFSET, so one client of a failed 32-client run
can be repeated alone ("What is A plus B?", A = 10 + k, B = 3 + k%7 (easy sums: the three-digit ones gave one deterministic model slip, 198+354 -> 542, also alone), k = i + OFFSET). Prints each wrong client, wall time, tokens per second.
Exit 0 only when every client answered right. Loopback only. Stdlib only."""
import json
import sys
import threading
import time
import urllib.request
port = int(sys.argv[1])
n = int(sys.argv[2]) if len(sys.argv) > 2 else 32
maxtok = int(sys.argv[3]) if len(sys.argv) > 3 else 24
off = int(sys.argv[4]) if len(sys.argv) > 4 else 0
base = f"http://127.0.0.1:{port}"
with urllib.request.urlopen(base + "/v1/models", timeout=60) as r:
model = json.load(r)["data"][0]["id"]
res = [None] * n
def one(i):
k = i + off
a, b = 10 + k, 3 + (k % 7)
body = {"model": model, "messages": [{"role": "user", "content": f"What is {a} plus {b}? Answer with just the number."}], "stream": False,
"temperature": 0, "max_tokens": maxtok, "reasoning_effort": "none"}
req = urllib.request.Request(base + "/v1/chat/completions", data=json.dumps(body).encode(), headers={"Content-Type": "application/json"})
t = time.time()
try:
with urllib.request.urlopen(req, timeout=1800) as r:
d = json.load(r)
text = d["choices"][0]["message"].get("content") or ""
res[i] = (str(a + b) in text, time.time() - t, d.get("usage", {}).get("completion_tokens", 0), text.strip()[:40], a + b)
except Exception as e:
res[i] = (False, time.time() - t, 0, repr(e)[:80], a + b)
t0 = time.time()
ts = [threading.Thread(target=one, args=(i,)) for i in range(n)]
[t.start() for t in ts]
[t.join() for t in ts]
wall = time.time() - t0
good = sum(1 for r in res if r and r[0])
toks = sum(r[2] for r in res if r)
for i, r in enumerate(res):
if not r[0]:
print(f"client {i + off} WRONG/FAILED after {r[1]:.1f}s: got {r[3]!r}, expected {r[4]}")
lat = sorted(r[1] for r in res)
print(f"c{n}@{off}: {good}/{n} right, wall {wall:.1f}s, {toks} completion tokens = {toks / wall:.1f} tok/s together, latency median {lat[len(lat) // 2]:.1f}s max {lat[-1]:.1f}s")
sys.exit(0 if good == n else 1)
+43
View File
@@ -0,0 +1,43 @@
#!/usr/bin/env python3
"""chat0221.py PORT : three non-streaming chats on a local Strata server, the ANSWER TEXT is checked (not only the status code).
1. greedy (temperature 0): the capital of Australia must contain "Canberra";
2. sampled (temperature 0.8, top_p 0.95): 17 * 23 must contain "391" (the sampler path is the one that uses double precision on the
Alchemist cards: an engine without the FP64 emulation environment dies on the first request that samples);
3. a longer sampled reply (about 150 words) that must be non-empty and stop on its own or at the limit.
Prints the replies; exit 0 only when 1 and 2 hold. Loopback only; no key is read or printed."""
import json
import sys
import time
import urllib.request
port = int(sys.argv[1])
base = f"http://127.0.0.1:{port}"
with urllib.request.urlopen(base + "/v1/models", timeout=60) as r:
model = json.load(r)["data"][0]["id"]
def chat(prompt, **extra):
body = {"model": model, "messages": [{"role": "user", "content": prompt}], "stream": False, **extra}
req = urllib.request.Request(base + "/v1/chat/completions", data=json.dumps(body).encode(), headers={"Content-Type": "application/json"})
t = time.time()
with urllib.request.urlopen(req, timeout=900) as r:
data = json.load(r)
ch = data["choices"][0]
return (ch["message"].get("content") or ""), ch.get("finish_reason"), time.time() - t, data.get("usage", {})
ok = True
text, fin, dt, use = chat("What is the capital of Australia? Answer in one short sentence.", temperature=0, max_tokens=300, reasoning_effort="none")
good = "canberra" in text.lower()
print(f"greedy {dt:5.1f}s finish={fin} usage={use} reply={text!r} {'OK' if good else 'WRONG'}")
ok &= good
text, fin, dt, use = chat("What is 17 times 23? Answer with just the number.", temperature=0.8, top_p=0.95, max_tokens=300, reasoning_effort="none")
good = "391" in text
print(f"sampled {dt:5.1f}s finish={fin} usage={use} reply={text!r} {'OK' if good else 'WRONG'}")
ok &= good
text, fin, dt, use = chat("Write about 150 words on why the sea is salty.", temperature=0.8, top_p=0.95, max_tokens=400, reasoning_effort="none")
good = len(text.split()) > 40
print(f"long {dt:5.1f}s finish={fin} usage={use} words={len(text.split())} head={text[:100]!r} {'OK' if good else 'SHORT'}")
print("ANSWER-TEXT-OK" if ok else "ANSWER-TEXT-WRONG")
sys.exit(0 if ok else 1)
+42
View File
@@ -0,0 +1,42 @@
#!/usr/bin/env python3
"""longctx_chat.py PORT TOKENS [NEEDLES] : a needle in a long prompt. About TOKENS tokens of numbered filler lines with NEEDLES (default 3) secret codes
hidden at 25% / 50% / 75% depth; asks for them back (greedy, no reasoning). Exit 0 only when every code is in the answer. Prints usage, time and the reply.
Loopback only. Stdlib only."""
import json
import sys
import time
import urllib.request
port = int(sys.argv[1])
tokens = int(sys.argv[2])
needles = int(sys.argv[3]) if len(sys.argv) > 3 else 3
base = f"http://127.0.0.1:{port}"
with urllib.request.urlopen(base + "/v1/models", timeout=60) as r:
model = json.load(r)["data"][0]["id"]
per_line = 18 # about 18 tokens (measured: 4096 asked = 5312 real at 14) for one "Log entry ..." line
n_lines = max(10, tokens // per_line)
codes = [f"{(7919 * (i + 3)) % 9000 + 1000}-{(104729 * (i + 5)) % 9000 + 1000}" for i in range(needles)]
at = {int(n_lines * (i + 1) / (needles + 1)): codes[i] for i in range(needles)}
lines = []
for i in range(n_lines):
if i in at:
lines.append(f"Log entry {i}: the vault access code number {list(at).index(i) + 1} is {at[i]}.")
else:
lines.append(f"Log entry {i}: the river level was normal and the weather stayed calm today.")
q = " ".join(f"{k + 1}" for k in range(needles))
prompt = "\n".join(lines) + f"\n\nQuestion: list the vault access codes number {q} from the log, in order, one per line, nothing else."
body = {"model": model, "messages": [{"role": "user", "content": prompt}], "stream": False, "temperature": 0, "max_tokens": 120, "reasoning_effort": "none"}
req = urllib.request.Request(base + "/v1/chat/completions", data=json.dumps(body).encode(), headers={"Content-Type": "application/json"})
t = time.time()
try:
with urllib.request.urlopen(req, timeout=7000) as r:
data = json.load(r)
except Exception as e:
print(f"needle{tokens}: REQUEST FAILED {e!r} after {time.time() - t:.0f}s")
sys.exit(2)
ch = data["choices"][0]
text = ch["message"].get("content") or ""
ok = all(c in text for c in codes)
print(f"needle{tokens} {time.time() - t:.0f}s usage={data.get('usage')} finish={ch.get('finish_reason')} codes={codes} reply={text[:160]!r} {'OK' if ok else 'WRONG'}")
sys.exit(0 if ok else 1)
+111
View File
@@ -0,0 +1,111 @@
#!/usr/bin/env python3
"""serve_chat.py : start serve/server.py on a strata-inkling engine, run the three answer-text chats (chat_check.py), stop both. Own PIDs only.
python3 serve_chat.py --out DIR --src TREE --exe ENGINE --tok TOKDIR --port N --model-name NAME [--env K=V ...] [--no-chat] -- <engine args...>
TREE is a checkout with terminal/serve/server.py. TOKDIR holds tokenizer.json (+ config / chat_template). The engine args are the strata-inkling
arguments (--native ..., --max-context ..., --draft ...). Prints the chat lines; exit 0 only when the answers are right.
Loopback only. Stops the server (SIGINT, then SIGTERM, then SIGKILL after waits) and any engine child that is still ours."""
import argparse
import json
import os
import signal
import subprocess
import sys
import time
import urllib.request
ap = argparse.ArgumentParser()
ap.add_argument("--out", required=True)
ap.add_argument("--src", required=True)
ap.add_argument("--exe", required=True)
ap.add_argument("--tok", required=True)
ap.add_argument("--port", type=int, required=True)
ap.add_argument("--model-name", default="inkling-test")
ap.add_argument("--env", action="append", default=[])
ap.add_argument("--chat", default=os.path.join(os.path.dirname(os.path.abspath(__file__)), "chat_check.py"))
ap.add_argument("--wait", type=int, default=900, help="seconds to wait for the model to be ready")
ap.add_argument("--no-chat", action="store_true")
ap.add_argument("--post", action="append", default=[], help="extra command (run with the same python as chat), {port} is replaced; exit code must be 0")
ap.add_argument("--py-server", default=sys.executable, help="python for server.py")
ap.add_argument("engine_args", nargs=argparse.REMAINDER)
a = ap.parse_args()
eargs = [x for x in a.engine_args if x != "--"]
os.makedirs(a.out, exist_ok=True)
cfg = {"arch": "inkling2_loop", "exe": a.exe, "args": eargs, "cwd": a.src, "tokenizer": a.tok, "model_name": a.model_name,
"log": os.path.join(a.out, "srv.log"), "host": "127.0.0.1", "port": a.port}
cfgp = os.path.join(a.out, "cfg.json")
json.dump(cfg, open(cfgp, "w"), indent=1)
env = dict(os.environ)
for kv in a.env:
k, _, v = kv.partition("=")
env[k] = v
env["PYTHONUNBUFFERED"] = "1"
sp = subprocess.Popen([a.py_server, os.path.join(a.src, "terminal", "serve", "server.py"), "--engine", "strata", "--config", cfgp, "--port", str(a.port),
"--no-api-key"], cwd=os.path.join(a.src, "terminal"), env=env,
stdout=open(os.path.join(a.out, "server.out"), "w"), stderr=subprocess.STDOUT)
print("server pid", sp.pid, flush=True)
rc = 1
t0 = time.time()
ready = False
try:
while time.time() - t0 < a.wait:
if sp.poll() is not None:
print("server exited early rc", sp.returncode, flush=True)
break
try:
with urllib.request.urlopen("http://127.0.0.1:%d/v1/models" % a.port, timeout=3) as r:
if r.status == 200:
ready = True
break
except Exception:
pass
time.sleep(3)
print("ready=%s after %.0fs" % (ready, time.time() - t0), flush=True)
if ready:
rc = 0
if not a.no_chat:
r = subprocess.run([sys.executable, a.chat, str(a.port)], capture_output=True, text=True, timeout=3600)
print(r.stdout, r.stderr[-500:], flush=True)
rc = r.returncode
for cmd in a.post:
parts = [sys.executable] + [x.replace("{port}", str(a.port)) for x in cmd.split()]
r2 = subprocess.run(parts, capture_output=True, text=True, timeout=7200)
print("POST", cmd, "rc", r2.returncode, flush=True)
print(r2.stdout, r2.stderr[-500:], flush=True)
rc = rc or r2.returncode
finally:
if sp.poll() is None:
try:
sp.send_signal(signal.SIGINT)
except Exception:
sp.terminate()
for _ in range(40):
if sp.poll() is not None:
break
time.sleep(1)
if sp.poll() is None:
sp.terminate()
for _ in range(20):
if sp.poll() is not None:
break
time.sleep(1)
if sp.poll() is None:
sp.kill()
print("server stopped rc", sp.returncode, flush=True)
# an engine child that outlived the server: only processes started from our own exe path
time.sleep(2)
for d in (os.listdir("/proc") if os.path.isdir("/proc") else []):
if d.isdigit() and int(d) != os.getpid():
try:
cl = open("/proc/%s/cmdline" % d, "rb").read().split(bytes([0]))
except OSError:
continue
if cl and cl[0] == a.exe.encode() and a.exe.encode() in cl[0]:
print("engine child left, pid", d, "-> SIGTERM", flush=True)
try:
os.kill(int(d), signal.SIGTERM)
except OSError:
pass
sys.exit(rc)
+393
View File
@@ -0,0 +1,393 @@
name: Intel runner
on:
workflow_dispatch:
inputs:
job:
description: "which job: hy4 (the Hy4-Flash checks) or inkling (Inkling 2 Mini gates: UD-Q4_K_XL and SQ-20)"
required: false
default: "hy4"
type: choice
options: [hy4, inkling]
push:
branches: [ci/intel-runner]
permissions:
contents: read
concurrency:
group: intel-runner-${{ github.ref }}
cancel-in-progress: false
jobs:
b70-hy4-sycl-verify:
name: Arc Pro B70 HY-4 Flash SYCL (#6572 Greedy + Unit + AB/BA)
if: ${{ github.event_name == 'push' || inputs.job != 'inkling' }}
runs-on: [self-hosted, Linux, X64, Intel]
timeout-minutes: 45
env:
NODE_OPTIONS: --use-system-ca
SSL_CERT_FILE: /etc/ssl/certs/ca-certificates.crt
REQUESTS_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 10
- name: 1. Build strata-hy4-opt (bmg_g31), sy_opt_test (bmg_g31), and strata-hy4-base (v0.2.19 c6f6427d9)
run: |
set -euo pipefail
set +u
source /opt/intel/oneapi/setvars.sh --force >/dev/null 2>&1 || true
unset OMP_PLACES OMP_PROC_BIND GOMP_CPU_AFFINITY KMP_AFFINITY
set -u
BUILD="$RUNNER_TEMP/b70-hy4-0220"
mkdir -p "$BUILD/opt" "$BUILD/base" "$BUILD/base-src" "$BUILD/zstd"
echo "icpx=$(icpx --version | head -1)"
echo "MKLROOT=${MKLROOT:-unset}"
df -h "$RUNNER_TEMP"
free -h
sycl-ls || true
# Build bundled zstd-dec static lib so link works regardless of system libzstd-dev
ZDEC="engine/third_party/zstd-dec"
ZOBJS=""
for c in common/debug.c common/entropy_common.c common/error_private.c common/fse_decompress.c common/xxhash.c common/zstd_common.c decompress/huf_decompress.c decompress/zstd_ddict.c decompress/zstd_decompress.c decompress/zstd_decompress_block.c; do
o="$BUILD/zstd/$(basename "$c" .c).o"
gcc -O3 -fPIC -DZSTD_DISABLE_ASM=1 -DXXH_NAMESPACE=ZSTD_ -I"$ZDEC" -I"$ZDEC/common" -c "$ZDEC/$c" -o "$o" &
ZOBJS="$ZOBJS $o"
done
wait
ar rcs "$BUILD/libzstd_dec.a" $ZOBJS
MKL_FLAGS=""
MKL_LIBS=""
if [ -n "${MKLROOT:-}" ] && [ -f "$MKLROOT/include/oneapi/mkl/blas.hpp" ]; then
MKL_FLAGS="-DHY4S_USE_ONEMKL -I$MKLROOT/include"
MKL_LIBS="-L$MKLROOT/lib -Wl,-rpath,$MKLROOT/lib -lmkl_sycl_blas -lmkl_intel_lp64 -lmkl_sequential -lmkl_core"
fi
SYCL_FLAGS="-fsycl -fsycl-targets=intel_gpu_bmg_g31,spir64 -DHY4S_DISABLE_SG8 -DHY4S_ENABLE_SG16_XMX"
build_tree() {
local SRC="$1"
local OUT="$2"
local INC="-I$SRC/engine/include -I$SRC/engine/src/hy4flash/sycl -I$SRC/engine/src/hy4flash/run -I$SRC/engine/third_party/stb -I$SRC/engine/third_party/zstd-dec"
mkdir -p "$OUT/obj"
g++ -O3 -std=c++17 -fPIC $INC -c "$SRC/engine/src/artifact/strata_reader.cpp" -o "$OUT/obj/strata_reader.o" &
g++ -O3 -march=native -std=c++17 -fPIC $INC -c "$SRC/engine/src/quant/sk_codecs.cpp" -o "$OUT/obj/sk_codecs.o" &
g++ -O3 -std=c++17 -fPIC $INC -c "$SRC/engine/src/ngram/hy4_engram_reader.cpp" -o "$OUT/obj/hy4_engram_reader.o" &
g++ -O3 -std=c++17 -fPIC $INC -c "$SRC/engine/src/hy4flash/run/hy4_engram.cpp" -o "$OUT/obj/hy4_engram.o" &
g++ -O3 -std=c++17 -fPIC -pthread $INC -c "$SRC/engine/src/hy4flash/run/hy4_cpu_experts.cpp" -o "$OUT/obj/hy4_cpu_experts.o" &
wait
local HOBJS="$OUT/obj/strata_reader.o $OUT/obj/sk_codecs.o $OUT/obj/hy4_engram_reader.o $OUT/obj/hy4_engram.o $OUT/obj/hy4_cpu_experts.o"
icpx -O3 -std=c++17 -fiopenmp $SYCL_FLAGS $MKL_FLAGS $INC \
"$SRC/engine/src/hy4flash/sycl/sy_main.cpp" \
"$SRC/engine/src/hy4flash/sycl/sy_mla.cpp" \
"$SRC/engine/src/hy4flash/sycl/sy_gpuexp.cpp" \
$HOBJS $MKL_LIBS "$BUILD/libzstd_dec.a" -lpthread -lm -o "$OUT/strata-hy4-sycl"
}
echo "== Build opt (HEAD) =="
build_tree "$PWD" "$BUILD/opt"
echo "== Build sy_opt_test (bmg_g31 GPU) =="
INC_OPT="-I$PWD/engine/include -I$PWD/engine/src/hy4flash/sycl -I$PWD/engine/src/hy4flash/run -I$PWD/engine/third_party/stb -I$PWD/engine/third_party/zstd-dec"
HOBJS_OPT="$BUILD/opt/obj/strata_reader.o $BUILD/opt/obj/sk_codecs.o $BUILD/opt/obj/hy4_engram_reader.o $BUILD/opt/obj/hy4_engram.o $BUILD/opt/obj/hy4_cpu_experts.o"
icpx -O3 -std=c++17 -fiopenmp $SYCL_FLAGS $MKL_FLAGS $INC_OPT \
"$PWD/engine/src/hy4flash/sycl/sy_opt_test.cpp" \
"$PWD/engine/src/hy4flash/sycl/sy_mla.cpp" \
"$PWD/engine/src/hy4flash/sycl/sy_gpuexp.cpp" \
$HOBJS_OPT $MKL_LIBS "$BUILD/libzstd_dec.a" -lpthread -lm -o "$BUILD/opt/sy_opt_test"
echo "== Build base (v0.2.19 c6f6427d9) =="
git archive c6f6427d9 | tar -x -C "$BUILD/base-src"
build_tree "$BUILD/base-src" "$BUILD/base"
ls -lh "$BUILD/opt/strata-hy4-sycl" "$BUILD/opt/sy_opt_test" "$BUILD/base/strata-hy4-sycl"
"$BUILD/opt/strata-hy4-sycl" --version
"$BUILD/opt/strata-hy4-sycl" --info
- name: 2. Run sy_opt_test LIVE on Intel Arc Pro B70 32 GB GPU
run: |
set -euo pipefail
set +u
source /opt/intel/oneapi/setvars.sh --force >/dev/null 2>&1 || true
set -u
BUILD="$RUNNER_TEMP/b70-hy4-0220"
echo "== Live Arc Pro B70 GPU sy_opt_test =="
UR_LOADER_USE_LEVEL_ZERO_V2=0 ONEAPI_DEVICE_SELECTOR=level_zero:gpu \
stdbuf -oL -eL "$BUILD/opt/sy_opt_test"
- name: 3. Live Arc Pro B70 Hy4-Flash-SQ-64 #6572 Greedy Coherence, --spec-check, LCP Serve, and AB/BA
run: |
set -euo pipefail
set +u
source /opt/intel/oneapi/setvars.sh --force >/dev/null 2>&1 || true
set -u
BUILD="$RUNNER_TEMP/b70-hy4-0220"
MODEL="$BUILD/Hy4-Flash-SQ-64.strata"
TOKDIR="$BUILD/tok"
mkdir -p "$TOKDIR" "$BUILD/out-opt" "$BUILD/out-base"
AVAIL_GB=$(df -BG --output=avail "$RUNNER_TEMP" | tail -n1 | tr -dc '0-9')
echo "Available disk on RUNNER_TEMP: ${AVAIL_GB} GB"
if [ "$AVAIL_GB" -lt 68 ]; then
echo "Not enough disk for 62 GB Hy4-Flash-SQ-64.strata (${AVAIL_GB} GB avail)"
exit 1
fi
echo "== Downloading Hy4-Flash-SQ-64.strata =="
t0=$(date +%s)
curl -fsSL --connect-timeout 30 --speed-limit 1000 --speed-time 60 --retry 2 \
"https://huggingface.co/strata-engine/Hy4-Flash-Strata/resolve/main/Hy4-Flash-SQ-64.strata" \
-o "$MODEL"
t1=$(date +%s)
echo "Downloaded $(ls -lh "$MODEL") in $((t1 - t0)) s"
"$BUILD/opt/strata-hy4-sycl" --info "$MODEL"
"$BUILD/opt/strata-hy4-sycl" --export-tokenizer "$MODEL" "$TOKDIR"
ls -lh "$TOKDIR"
python3 - "$MODEL" "$TOKDIR" "$BUILD/opt/strata-hy4-sycl" "$BUILD/base/strata-hy4-sycl" "$BUILD" << 'PY'
import json, os, subprocess, sys, time
model, tokdir, opt_bin, base_bin, build_dir = sys.argv[1:6]
tj = json.load(open(os.path.join(tokdir, "tokenizer.hf.json"), encoding="utf-8"))
vocab = dict(tj["model"]["vocab"])
for at in tj.get("added_tokens", []):
vocab[at["content"]] = at["id"]
id2tok = {v: k for k, v in vocab.items()}
# Simple byte-level BPE decoder for readable verification
def bytes_to_unicode():
bs = list(range(ord("!"), ord("~") + 1)) + list(range(ord("¡"), ord("¬") + 1)) + list(range(ord("®"), ord("ÿ") + 1))
cs = bs[:]
n = 0
for b in range(256):
if b not in bs:
bs.append(b)
cs.append(256 + n)
n += 1
return dict(zip(bs, [chr(c) for c in cs]))
u2b = {v: k for k, v in bytes_to_unicode().items()}
def decode_ids(ids):
raw = bytearray()
for tid in ids:
s = id2tok.get(int(tid), f"<{tid}>")
if s.startswith("<") and s.endswith(">"):
raw.extend(s.encode("utf-8"))
else:
for ch in s:
if ch in u2b:
raw.append(u2b[ch])
else:
raw.extend(ch.encode("utf-8"))
return raw.decode("utf-8", errors="replace")
# Build clean greedy prompt token IDs directly from vocab ("The capital of France is")
# Use exact byte-level pieces from vocab
def find_tok(s):
if s in vocab:
return vocab[s]
raise KeyError(s)
# Try exact tokens for "The capital of France is"
prompt_words = ["The", "Ġcapital", "Ġof", "ĠFrance", "Ġis"]
prompt_ids = [find_tok(w) for w in prompt_words]
print("Greedy prompt IDs:", prompt_ids, "decoded:", repr(decode_ids(prompt_ids)), flush=True)
# Build a 512-token and 2048-token code-like prompt from valid vocab tokens
code_seed = [vocab[w] for w in ["def", "Ġcompute", "(", "x", ",", "Ġy", "):", "Ċ", "ĠĠĠĠ", "return", "Ġx", "Ġ+", "Ġy", "Ċ"] if w in vocab]
toks_512 = (code_seed * (512 // len(code_seed) + 1))[:512]
toks_2048 = (code_seed * (2048 // len(code_seed) + 1))[:2048]
open(os.path.join(build_dir, "p512.ids"), "w").write(" ".join(map(str, toks_512)) + "\n")
open(os.path.join(build_dir, "p2048.ids"), "w").write(" ".join(map(str, toks_2048)) + "\n")
def run_serve_check(binp, label, draft_mode, unset_l0=False):
env = os.environ.copy()
env["ONEAPI_DEVICE_SELECTOR"] = "level_zero:gpu"
if unset_l0:
env.pop("UR_LOADER_USE_LEVEL_ZERO_V2", None)
else:
env["UR_LOADER_USE_LEVEL_ZERO_V2"] = "0"
cmd = [binp, "--serve", "--native", model, "--no-engram", "--max-context", "4096",
"--vram-experts-gb", "18", "--ram-experts-gb", "14", "--draft", draft_mode]
proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, bufsize=1, env=env)
got_ready = False
for line in proc.stdout:
line = line.rstrip("\n")
if line.startswith(("INFO ", "READY ", "ERR ")):
print(f"[{label}] {line}", flush=True)
if line.startswith("READY "):
got_ready = True
break
if not got_ready:
err = proc.stderr.read()
rc = proc.wait(timeout=30)
print(f"[{label}] EXITED BEFORE READY rc={rc}\n{err}", flush=True)
raise RuntimeError(f"{label} exited before READY (rc={rc})")
def gen(ids, max_new=32):
t0 = time.time()
proc.stdin.write(f"GEN {max_new} temperature=0.0 {','.join(map(str, ids))}\n")
proc.stdin.flush()
out, done, res = [], "", ""
for ln in proc.stdout:
ln = ln.rstrip("\n")
if ln.startswith("T "): out.append(int(ln.split()[1]))
elif ln.startswith("RESUME "): res = ln
elif ln.startswith("DONE "): done = ln; break
elif ln.startswith("ERR "): raise RuntimeError(ln)
return out, done, res, time.time() - t0
out1, d1, r1, dt1 = gen(prompt_ids, 32)
txt1 = decode_ids(out1)
print(f"[{label}] #6572 greedy ({draft_mode}): {d1} | text={txt1!r}", flush=True)
# Also test LCP resume on opt
if label == "opt-dfly2":
out_a, da, ra, dta = gen(toks_512, 16)
out_b, db, rb, dtb = gen(toks_512[:400] + prompt_ids, 16)
print(f"[{label}] LCP resume test: cold512=({da}) -> lcp400=({rb} {db})", flush=True)
proc.stdin.write("QUIT\n")
proc.stdin.flush()
proc.stdin.close()
err = proc.stderr.read()
proc.wait(timeout=60)
for ln in err.splitlines():
if any(k in ln for k in ("[gpu]", "[vram-cache]", "[load]", "[runner]", "[spec]", "ERR", "error")):
print(f"[{label} stderr] {ln}", flush=True)
assert "Paris" in txt1, f"[{label}] #6572 FAILED: 'Paris' not in {txt1!r}!"
return out1, txt1
base_plain, _ = run_serve_check(base_bin, "base-plain", "off", unset_l0=False)
opt_plain, _ = run_serve_check(opt_bin, "opt-plain", "off", unset_l0=True)
opt_dfly2, _ = run_serve_check(opt_bin, "opt-dfly2", "dfly2", unset_l0=True)
print("Greedy parity opt_plain vs opt_dfly2:", opt_plain == opt_dfly2, flush=True)
print("Greedy parity base_plain vs opt_plain:", base_plain == opt_plain, flush=True)
assert opt_plain == opt_dfly2, f"plain vs dfly2 mismatch! {opt_plain} != {opt_dfly2}"
print("#6572 GREEDY COHERENCE & PARITY PASS!", flush=True)
PY
echo "== [1] opt --spec-check (bmg_g31 GPU, UR_LOADER_USE_LEVEL_ZERO_V2 UNSET) =="
env -u UR_LOADER_USE_LEVEL_ZERO_V2 ONEAPI_DEVICE_SELECTOR=level_zero:gpu \
stdbuf -oL -eL "$BUILD/opt/strata-hy4-sycl" --model "$MODEL" --no-engram --ctx 4096 \
--vram-experts-gb 18 --ram-experts-gb 14 --tokens "$BUILD/p512.ids" --out "$BUILD/out-opt" \
--gen 32 --draft dfly2 --spec-check 2>&1 | grep -E "gpu|vram-cache|runner|prefill|decode|spec|check|ERR|FAIL" || true
echo "== [2] Interleaved AB/BA (base vs opt) on 1024-tok prompt, gen=64 (plain + dfly2) =="
head -c 100000 "$BUILD/p2048.ids" | awk '{for(i=1;i<=1024;i++) printf "%s%s",$i,(i<1024?" ":"\n")}' > "$BUILD/p1024.ids"
for round in A1_base B1_opt B2_opt A2_base; do
if [[ "$round" == *base* ]]; then
BIN="$BUILD/base/strata-hy4-sycl"
ENV_PREFIX="UR_LOADER_USE_LEVEL_ZERO_V2=0 ONEAPI_DEVICE_SELECTOR=level_zero:gpu"
else
BIN="$BUILD/opt/strata-hy4-sycl"
ENV_PREFIX="env -u UR_LOADER_USE_LEVEL_ZERO_V2 ONEAPI_DEVICE_SELECTOR=level_zero:gpu"
fi
echo "--- $round plain (1024 prompt, gen=64) ---"
eval $ENV_PREFIX stdbuf -oL -eL "$BIN" --model "$MODEL" --no-engram --ctx 4096 \
--vram-experts-gb 18 --ram-experts-gb 14 --tokens "$BUILD/p1024.ids" --out "$BUILD/out-opt" \
--gen 64 --draft off 2>&1 | grep -E "vram-cache|prefill|decode|\[spec\]" || true
echo "--- $round dfly2 (1024 prompt, gen=64) ---"
eval $ENV_PREFIX stdbuf -oL -eL "$BIN" --model "$MODEL" --no-engram --ctx 4096 \
--vram-experts-gb 18 --ram-experts-gb 14 --tokens "$BUILD/p1024.ids" --out "$BUILD/out-opt" \
--gen 64 --draft dfly2 2>&1 | grep -E "vram-cache|prefill|decode|\[spec\]" || true
done
echo "B70_HY4_VERIFY_ALL_PASS=1"
- name: Cleanup B70 scratch
if: always()
run: rm -rf "$RUNNER_TEMP/b70-hy4-0220" || true
b70-inkling-sycl:
name: "Arc Pro B70 Inkling 2 Mini SYCL (UD-Q4_K_XL + SQ-20: chat, C1 / C32, 5-run fingerprint, needles)"
if: ${{ github.event_name == 'workflow_dispatch' && inputs.job == 'inkling' }}
runs-on: [self-hosted, Linux, X64, Intel]
timeout-minutes: 240
env:
NODE_OPTIONS: --use-system-ca
SSL_CERT_FILE: /etc/ssl/certs/ca-certificates.crt
REQUESTS_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt
HF_STRATA: https://huggingface.co/strata-engine/Inkling-2-Mini-Strata/resolve/main
HF_UNSLOTH: https://huggingface.co/unsloth/Inkling-2-Mini-GGUF/resolve/main
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 1
- name: 1. Build strata-inkling (SYCL, bmg_g31 + spir64), Python venv, tokenizer
run: |
set -euo pipefail
set +u
source /opt/intel/oneapi/setvars.sh --force >/dev/null 2>&1 || true
unset OMP_PLACES OMP_PROC_BIND GOMP_CPU_AFFINITY KMP_AFFINITY
set -u
W="$RUNNER_TEMP/b70-ink"
mkdir -p "$W/tok" "$W/models" "$W/logs"
echo "icpx=$(icpx --version | head -1)"; echo "MKLROOT=${MKLROOT:-unset}"
df -h "$RUNNER_TEMP"; free -h; sycl-ls || true
python3 -m venv "$W/venv"
"$W/venv/bin/pip" install -q --disable-pip-version-check -r terminal/requirements.txt cmake ninja
"$W/venv/bin/python" -c "import numpy, jinja2, regex, yaml; print('python deps ok')"
export PATH="$W/venv/bin:$PATH"
cmake -S engine/src/inkling2 -B "$W/build" -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx \
-DSTRATA_ENABLE_SYCL=ON -DSTRATA_SYCL_TARGETS=spir64,intel_gpu_bmg_g31 > "$W/logs/cmake.log" 2>&1 || { tail -30 "$W/logs/cmake.log"; exit 1; }
cmake --build "$W/build" --target strata-inkling -j "$(nproc)" > "$W/logs/build.log" 2>&1 || { tail -40 "$W/logs/build.log"; exit 1; }
ls -l "$W/build/strata-inkling"; "$W/build/strata-inkling" --version
for f in config.json tokenizer.json tokenizer_config.json special_tokens_map.json chat_template.jinja; do
curl -fsSL --retry 3 -o "$W/tok/$f" "$HF_STRATA/$f"
done
ls -l "$W/tok"
- name: 2. UD-Q4_K_XL (GGUF) + dspark drafter gate
run: |
set -uo pipefail
set +u
source /opt/intel/oneapi/setvars.sh --force >/dev/null 2>&1 || true
set -u
W="$RUNNER_TEMP/b70-ink"
AVAIL_GB=$(df -BG --output=avail "$RUNNER_TEMP" | tail -n1 | tr -dc '0-9')
echo "free disk ${AVAIL_GB} GB"
[ "$AVAIL_GB" -ge 40 ] || { echo "not enough disk for the 17.6 GB UD-Q4_K_XL"; exit 1; }
curl -fsSL --retry 3 --connect-timeout 30 -o "$W/models/Inkling-2-Mini-UD-Q4_K_XL.gguf" "$HF_UNSLOTH/Inkling-2-Mini-UD-Q4_K_XL.gguf"
curl -fsSL --retry 3 --connect-timeout 30 -o "$W/models/dspark-Inkling-2-Mini-Q8_0.gguf" "$HF_UNSLOTH/dspark-Inkling-2-Mini-Q8_0.gguf"
ls -l "$W/models"
bash .github/ci/inkling/b70_gate.sh q4kxl "$W/models/Inkling-2-Mini-UD-Q4_K_XL.gguf" "$W/build/strata-inkling" "$W/tok" \
"$W/venv/bin/python" "$PWD" "$W/logs/q4kxl" "$W/models/dspark-Inkling-2-Mini-Q8_0.gguf" 2>&1 | tee "$W/logs/q4kxl.summary"
rc=${PIPESTATUS[0]}
rm -f "$W/models/Inkling-2-Mini-UD-Q4_K_XL.gguf"
echo "GATE_Q4KXL_RC=$rc"
[ "$rc" -eq 0 ]
- name: 3. SQ-20 (.strata, embedded drafter) gate
if: always()
run: |
set -uo pipefail
set +u
source /opt/intel/oneapi/setvars.sh --force >/dev/null 2>&1 || true
set -u
W="$RUNNER_TEMP/b70-ink"
AVAIL_GB=$(df -BG --output=avail "$RUNNER_TEMP" | tail -n1 | tr -dc '0-9')
echo "free disk ${AVAIL_GB} GB"
[ "$AVAIL_GB" -ge 40 ] || { echo "not enough disk for the 19.3 GB SQ-20"; exit 1; }
curl -fsSL --retry 3 --connect-timeout 30 -o "$W/models/Inkling-2-Mini-SQ-20.strata" "$HF_STRATA/Inkling-2-Mini-SQ-20.strata"
echo "0bbfd52344f0dd4779a7807b5f73554a812f24c035e6877b63cd0d499f7e1b97 $W/models/Inkling-2-Mini-SQ-20.strata" | sha256sum -c -
bash .github/ci/inkling/b70_gate.sh sq20 "$W/models/Inkling-2-Mini-SQ-20.strata" "$W/build/strata-inkling" "$W/tok" \
"$W/venv/bin/python" "$PWD" "$W/logs/sq20" 2>&1 | tee "$W/logs/sq20.summary"
rc=${PIPESTATUS[0]}
rm -f "$W/models/Inkling-2-Mini-SQ-20.strata"
echo "GATE_SQ20_RC=$rc"
[ "$rc" -eq 0 ]
- name: 4. Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: b70-inkling-logs
path: ${{ runner.temp }}/b70-ink/logs
retention-days: 7
- name: Cleanup B70 scratch
if: always()
run: rm -rf "$RUNNER_TEMP/b70-ink" || true