From e74e5b2413c6bcce7730710ecdfa3abbd8f8b31c Mon Sep 17 00:00:00 2001 From: pascallinxweiler Date: Fri, 23 Oct 2026 23:01:05 +0200 Subject: [PATCH] sycl: profile_decode.sh reports calls and us a call; the BetterBench runs recorded The decode profile now prints calls a step and the time a call for every op, from the same two differenced runs. SYCL_PROGRESS records the a869226 run that was missing from the table and the b07da2a run: decode 51.8 / 41.4 tok/s (median / 1% low), prefill 1575.6 tok/s @2000. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1 --- docs/SYCL_PROGRESS.md | 4 +++- scripts/sycl/profile_decode.sh | 11 +++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/SYCL_PROGRESS.md b/docs/SYCL_PROGRESS.md index bebf5ef9..b4b3a28a 100644 --- a/docs/SYCL_PROGRESS.md +++ b/docs/SYCL_PROGRESS.md @@ -12,7 +12,7 @@ from it alone. | 1 codebase study, `SYCL_PORTING.md` | done (`docs/SYCL_PORTING.md` §1-§3, Appendix A) | | 2 design | done: device backend, build integration, core kernels (`device_test_sycl` on the B65) | | 3 correctness-first kernels | **Milestone A reached 2026-10-23** (`874f8d2`): MiniCPM5-2B bf16 serves on the B65, greedy-identical to the libref host backend; Milestone B next | -| 4 performance | not started | +| 4 performance | in progress on MiniCPM5-2B bf16: decode 4.2 -> 51.8 tok/s, prefill 17 -> 1576 tok/s (BetterBench quick, `b07da2a`) | | 5 broaden and finish | not started | ## Open blockers / questions for the user @@ -158,6 +158,8 @@ fonts (this host has none; the first post had no text) -- all unpacked without r | date | commit | model | backend | flags | prefill tok/s (median / 1% low) | decode tok/s (median / 1% low) | vs previous | report | |---|---|---|---|---|---|---|---|---| | 2026-10-23 | `874f8d2` | minicpm5-2b-bf16 | sycl, correctness-first kernels | `--num-speculative-tokens 0 --max-model-len 8192 --max-num-seqs 4` | 17.3 / 17.3 @2000 (8000+ skipped: over the 8192 context) | 4.2 / 3.5 | first run | `~/radiance-bench/runs/20261023-165102-minicpm5-2b-bf16-874f8d2/results.html`, posted with `report.jpg` | +| 2026-10-23 | `a869226` | minicpm5-2b-bf16 | sycl, Phase 4 step 1 (GEMV) | same | 17.5 / 17.4 @2000 | 25.3 / 16.2 | decode +504.5% | `~/radiance-bench/runs/20261023-194856-minicpm5-2b-bf16-a869226/results.html`, posted with `report.jpg` | +| 2026-10-23 | `b07da2a` | minicpm5-2b-bf16 | sycl, Phase 4 steps 2-6 (XMX prefill, split-KV attention, norms, GEMV split) | same | 1575.6 / 1547.1 @2000 | 51.8 / 41.4 | decode +104.7%, prefill 90x | `~/radiance-bench/runs/20261023-221354-minicpm5-2b-bf16-b07da2a/results.html`, posted with `report.jpg` | ## Models diff --git a/scripts/sycl/profile_decode.sh b/scripts/sycl/profile_decode.sh index dae459a3..ccb8db56 100755 --- a/scripts/sycl/profile_decode.sh +++ b/scripts/sycl/profile_decode.sh @@ -22,7 +22,7 @@ work=$(mktemp -d) trap 'rm -rf "$work"' EXIT port=${PORT:-8139} -run() { # run TOKENS FLAGS... -> $work/TOKENS.tsv: op, total ms +run() { # run TOKENS FLAGS... -> $work/TOKENS.tsv: op, total ms, calls tok=$1; shift RADIANCE_SYCL_TIMING=1 RADIANCE_HOME="$root/build-sycl/radiance_home" \ "$root/build-sycl/bin/radiance" --model "$model" --profile-ops --max-num-seqs 1 \ @@ -41,15 +41,18 @@ run() { # run TOKENS FLAGS... -> $work/TOKENS.tsv: op, total ms kill -INT $pid wait $pid 2>/dev/null || true n=$(grep -n -E 'calls +total ms' "$work/$tok.log" | tail -1 | cut -d: -f1) - awk -v from="$n" 'NR > from && $4 == "dev" { t[$7] += $2 } END { for (o in t) print o, t[o] }' \ + awk -v from="$n" 'NR > from && $4 == "dev" { t[$7] += $2; c[$7] += $1 } + END { for (o in t) print o, t[o], c[o] }' \ "$work/$tok.log" | sort > "$work/$tok.tsv" } run 1 "$@" run $((steps + 1)) "$@" join "$work/1.tsv" "$work/$((steps + 1)).tsv" | awk -v n="$steps" ' - { d = $3 - $2; T += d; a[$1] = d } + { d = $4 - $2; T += d; a[$1] = d; k[$1] = ($5 - $3) / n } END { - for (o in a) printf "%8.3f ms/step %5.1f%% %s\n", a[o] / n, 100 * a[o] / T, o + for (o in a) + printf "%8.3f ms/step %5.1f%% %5.1f calls/step %7.1f us/call %s\n", a[o] / n, + 100 * a[o] / T, k[o], (k[o] > 0 ? 1000 * a[o] / n / k[o] : 0), o printf "%8.3f ms/step of device time over %d decode steps\n", T / n, n }' | sort -rn