Skip to content

chore(squad): qwen3.5-2b native ORT-win + general head-size kernel lever - #1269

Merged
justinchuby merged 1 commit into
mainfrom
chore/squad-qwen35-probe-0818
Aug 18, 2026
Merged

justinchuby merged 1 commit into
mainfrom
chore/squad-qwen35-probe-0818

Conversation

@justinchuby

Copy link
Copy Markdown
Owner

Wallace's different-architecture GPU probe result + coordinator standing-table update.

  • qwen3.5-2b (hybrid linear-attn, head_dim=256) native beats ORT in BOTH framings: eager 1.10x (within noise), capture 1.65x (clean, fallbacks=0). ORT CUDA EP can't place LinearAttention/CausalConvWithState on GPU (25 Memcpy nodes, graph blocked); native runs+captures the whole hybrid graph.
  • New lever (in flight, Deckard): general head-size fused GQA decode kernel — head_dim=256 falls out of the head<=128 fast path to gqa_attention_reference_f32 = 31% of decode. Generalized (per user directive) over head sizes {64,80,96,112,128,192,256} + asymmetric dual-head-size audit (Gemma/DeepSeek MLA).
  • Support gaps: Phi-3.5-mini generic-cpu If op; qwen3.5-9b multimodal harness.

Squad-state only (.squad/decisions.md, identity/now.md, agents/wallace/history.md).

…rnel lever

Wallace different-architecture GPU probe: qwen3.5-2b hybrid linear-attn native
beats ORT eager 1.10x / capture 1.65x (ORT can't place LinearAttention/
CausalConvWithState on GPU). New lever = general head-size fused GQA decode
kernel (kill 31% gqa_attention_reference_f32 hotspot on head_dim=256). Support
gaps: Phi-3.5-mini generic-cpu 'If' op, qwen3.5-9b multimodal harness.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@justinchuby
justinchuby merged commit cf6d0a2 into main Aug 18, 2026
3 of 14 checks passed
@justinchuby
justinchuby deleted the chore/squad-qwen35-probe-0818 branch August 18, 2026 16:23
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.96%. Comparing base (f3c3c22) to head (18d8219).
⚠️ Report is 57 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1269      +/-   ##
==========================================
- Coverage   80.44%   79.96%   -0.48%     
==========================================
  Files         359      361       +2     
  Lines      157898   157076     -822     
  Branches   157898   157076     -822     
==========================================
- Hits       127027   125613    -1414     
- Misses      26255    26829     +574     
- Partials     4616     4634      +18     
Flag Coverage Δ
mlas ?
offline 79.96% <ø> (-0.38%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 38 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown

🔴 Benchmark Regression Detected

Comparison of criterion micro-benchmarks: PR head vs merge-base, measured on the same runner in the same job (base first → PR second).

ℹ️ Absolute times are informational only — they vary with runner load. The % change column is the reliable signal because both sides ran under identical conditions.

Status Scenario Base PR Change
🔴 grammar_masking/llguidance_compute_mask/32 77.69 µs 128.55 µs +65.5%
🔴 qwen3_sampling_processors/top_p_full_sort_after_top_k_baseline 3.67 ms 5.63 ms +53.3%
🔴 qwen3_sampling_processors/top_k_partial_selection 145.33 µs 214.64 µs +47.7%
🔴 qwen3_sampling_processors/top_k_full_sort_baseline 2.14 ms 3.01 ms +40.7%
🔴 block_quantized_moe_cached_dense/mxfp4_cached_dense_expert_repeated_call/rows=1,H=256,I=256,E=4,top_k=1 131.88 µs 180.64 µs +37.0%
🔴 qwen3_sampling_processors/top_p_fast_after_top_k 525.17 µs 715.91 µs +36.3%
🔴 logit_processing/seven_processor_chain_per_step 322.26 µs 430.15 µs +33.5%
⚠️ qwen3_sampling_processors/top_k_top_p_fast 662.88 µs 792.26 µs +19.5%
⚠️ qwen3_sampling_processors/top_k_top_p_full_sort_baseline 5.83 ms 6.86 ms +17.6%
✅ kv_cache/alloc_dealloc_pages 39.30 µs 45.19 µs +15.0%
✅ matmul/large_generic_f16_threads=8/32x1024x1024 109.30 µs 125.23 µs +14.6%
✅ gather/large_bf16_threads=1-internal/131072 13.72 µs 15.59 µs +13.6%
✅ matmul/small_generic_f16_threads=1/1x256x256 37.99 µs 42.85 µs +12.8%
✅ block_quantized_moe_cached_dense/mxfp4_uncached_expert_dequant_each_call/rows=1,H=256,I=256,E=4,top_k=1 607.09 µs 679.63 µs +11.9%
✅ matmul/medium_generic_f16_threads=1/32x512x512 38.76 µs 42.08 µs +8.6%
✅ gather/small_f16_threads=1-internal/4096 476.7 ns 516.2 ns +8.3%
✅ tokenization/encode_tokens_per_second 384.46 µs 408.19 µs +6.2%
✅ block_quantized_matmul_cached_dense/mxfp4_preexpanded_dense_oncelock_like_proxy/1x1024x1024 102.58 µs 108.54 µs +5.8%
✅ matmul/small_generic_f32_threads=8/1x256x256 49.13 µs 51.71 µs +5.3%
✅ matmul/medium_generic_f16_threads=8/32x512x512 43.23 µs 45.09 µs +4.3%
✅ sampling_latency/greedy_per_token 3.27 µs 3.41 µs +4.3%
✅ add/medium_f32_threads=1-internal/262144 25.12 µs 26.01 µs +3.5%
✅ matmul/small_generic_f16_threads=8/1x256x256 37.73 µs 38.95 µs +3.2%
✅ matmul/medium_generic_f32_threads=8/32x512x512 1.91 ms 1.97 ms +2.9%
✅ add/medium_f16_threads=1-internal/262144 107.95 µs 111.04 µs +2.9%
✅ add/large_f16_threads=1-internal/4194304 1.71 ms 1.76 ms +2.7%
✅ gather/small_bf16_threads=1-internal/4096 477.4 ns 488.8 ns +2.4%
✅ add/large_f32_threads=1-internal/4194304 862.83 µs 879.76 µs +2.0%
✅ matmul/large_generic_f32_threads=1/32x1024x1024 9.59 ms 9.76 ms +1.8%
✅ matmul/large_generic_f32_threads=8/32x1024x1024 7.55 ms 7.68 ms +1.8%
✅ block_quantized_matmul_cached_dense/mxfp4_cached_dense_repeated_call/1x1024x1024 138.11 µs 139.95 µs +1.3%
✅ matmul/large_generic_bf16_threads=1/32x1024x1024 2.18 ms 2.21 ms +1.1%
✅ gather/large_f16_threads=1-internal/131072 14.61 µs 14.76 µs +1.0%
✅ matmul/large_generic_f16_threads=1/32x1024x1024 86.45 µs 87.29 µs +1.0%
✅ matmul/small_generic_bf16_threads=1/1x256x256 37.60 µs 37.95 µs +0.9%
✅ gather/small_f32_threads=1-internal/4096 670.7 ns 675.2 ns +0.7%
✅ block_quantized_matmul_cached_dense/mxfp4_uncached_dequant_each_call/1x1024x1024 1.29 ms 1.30 ms +0.6%
✅ matmul/medium_generic_f32_threads=1/32x512x512 2.35 ms 2.35 ms +0.1%
✅ matmul/medium_generic_bf16_threads=1/32x512x512 547.71 µs 547.90 µs +0.0%
✅ sampling_latency/min_p_per_token 209.16 µs 207.21 µs -0.9%
✅ reduce_mean/medium_f32_threads=1-internal/65536 252.60 µs 248.76 µs -1.5%
✅ sampling_latency/top_k_per_token 53.35 µs 52.29 µs -2.0%
✅ gather/medium_f32_threads=1-internal/32768 4.24 µs 4.14 µs -2.4%
✅ matmul/large_generic_bf16_threads=8/32x1024x1024 2.44 ms 2.38 ms -2.4%
✅ reduce_mean/large_f32_threads=1-internal/262144 1.02 ms 991.45 µs -2.5%
✅ tokenization/decode_tokens_per_second 6.73 ms 6.55 ms -2.7%
✅ gather/medium_f16_threads=1-internal/32768 2.52 µs 2.42 µs -3.6%
✅ matmul/small_generic_bf16_threads=8/1x256x256 39.53 µs 38.06 µs -3.7%
✅ matmul/small_generic_f32_threads=1/1x256x256 49.03 µs 47.02 µs -4.1%
✅ sampling_latency/top_p_per_token 390.08 µs 372.99 µs -4.4%
✅ add/small_f16_threads=1-internal/1024 469.6 ns 448.8 ns -4.4%
✅ matmul/medium_generic_bf16_threads=8/32x512x512 678.85 µs 648.07 µs -4.5%
✅ add/medium_bf16_threads=1-internal/262144 110.99 µs 104.83 µs -5.6%
✅ add/small_bf16_threads=1-internal/1024 468.5 ns 442.0 ns -5.7%
✅ gather/medium_bf16_threads=1-internal/32768 2.54 µs 2.39 µs -5.9%
✅ gather/large_f32_threads=1-internal/131072 40.92 µs 37.35 µs -8.7%
✅ reduce_mean/small_f32_threads=1-internal/4096 16.86 µs 15.33 µs -9.1%
✅ add/small_f32_threads=1-internal/1024 226.8 ns 198.3 ns -12.6%
🟢 add/large_bf16_threads=1-internal/4194304 2.03 ms 1.72 ms -15.0%

Visual flags: ⚠️ ≥ 15% slower, 🔴 ≥ 30% slower — calibrated against measured runner noise (~27% worst-case on multi-threaded matmul)

Host info
CPU: Apple M1 (Virtual)
Cores: 3
OS: Darwin 25.5.0 arm64
Rust: rustc 1.97.1 (8bab26f4f 2026-07-14)
Load avg: { 5.51 4.54 5.37 }
What this cannot catch
  • Regressions in code paths not covered by these benchmarks (e.g., end-to-end decode with a real model)
  • Sub-threshold regressions that compound over multiple PRs
  • Performance changes that only manifest under GPU execution
  • Latency changes in the ORT integration path (these benchmarks exercise the native Rust kernels)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant