Archived
libxe2: the DFlash2 path fast -- exact draft head, DPAS verify GEMV, parallel rerank
- gemm_nt_q over the zero-point grids at M <= 16 (the drafter's 2-bit vocabulary head, N=248320): a sub-group a column, the group sums exact integers in f32, libref's group terms added in group order through lane broadcasts -- bit-identical to the exact kernel on the live head (checked in the engine: 0 differing bytes of 3.5 MB, every round). 252 ms -> well under 1 ms a call. - m2xfp4 at 2 <= M <= 16 (the verify width) on XMX: a lane a column decodes its codes a 64-byte line at a time into its sub-group's VNNI slice of local memory (subnormal-bit fp16 pairs times (1 + k/4) * 2^(e - e_max + 14)), eight K16 DPAS a step against the permuted fp16 activation, K split for narrow N, partials added in order. On the vector ALUs M = 8 cost five times M = 1; gate_up at M = 8 1159 -> ~490 us. rad-kbench on the 27B: 50/50, rel_l2 ~8.5e-4 (tol 4e-2). - logit_rerank: a work-group a row, a sub-group a candidate along K, libref's double sum as a float pair (two-product, two-sum, a fixed lane tree), libref's selection; 136 ms -> negligible a call. - the gated delta net's gate, beta and decay (libref's double exp / log1p) once a (token, head) in a prepass instead of once a column block; still bit-identical (10/10 at rel_l2 0). - profile_decode.sh: KEEP=DIR keeps the per-geometry tables. 27B on the B65, greedy: 12.1 tok/s plain, 13.2 tok/s with the drafter (device time a token 217 -> 76 ms under speculation). The drafter's text now departs from plain decoding at a near-tie (byte 246 of 256 tokens): the verify forward runs the M = 8 DPAS path and plain decoding the M = 1 GEMV, whose roundings differ (~1e-3); with the exact kernels the two were identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
This commit is contained in:
1 parent
07cdc546a3
commit
55a350f0c6
7 files changed
+399
-7
No files matched your search
@@ -11,6 +11,7 @@
|
||||
# PROMPT_FILE plain text, sent as one /v1/completions prompt
|
||||
# STEPS decode steps measured (default 128)
|
||||
# Needs the oneAPI environment (it sources setvars.sh if icpx is not on PATH) and build-sycl/.
|
||||
# KEEP=DIR keeps the two servers' logs (the per-geometry tables) in DIR.
|
||||
set -eu
|
||||
model=${1:?usage: profile_decode.sh MODEL PROMPT_FILE [STEPS] [flags...]}
|
||||
prompt=${2:?usage: profile_decode.sh MODEL PROMPT_FILE [STEPS] [flags...]}
|
||||
@@ -48,6 +49,7 @@ run() { # run TOKENS FLAGS... -> $work/TOKENS.tsv: op, total ms, calls
|
||||
|
||||
run 1 "$@"
|
||||
run $((steps + 1)) "$@"
|
||||
[ -n "${KEEP:-}" ] && cp "$work"/*.log "$KEEP"/
|
||||
join "$work/1.tsv" "$work/$((steps + 1)).tsv" | awk -v n="$steps" '
|
||||
{ d = $4 - $2; T += d; a[$1] = d; k[$1] = ($5 - $3) / n }
|
||||
END {
|
||||
|
||||
Reference in new issue
Block a user