Skip to content

chore(squad): scribe round 8 — async-offload/correctness wave consolidation - #555

Merged
justinchuby merged 1 commit into
mainfrom
squad/scribe-round8
Jul 31, 2026
Merged

justinchuby merged 1 commit into
mainfrom
squad/scribe-round8

Conversation

@justinchuby

Copy link
Copy Markdown
Owner

Consolidates 6 inbox decision notes into decisions.md (20458->20332 B, under the 20480 gate) and archives two historical wave records. Updates agent histories.

Wave summary (all merged):

State-only change (decisions/histories/archive). Logs are gitignored.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

…wave

Merge 6 inbox notes into decisions.md (20458->20332 B, under gate);
archive two historical wave records to decisions-archive/2026-07.md.
Update mary/cohaagen/harry/melina histories (mary compacted to history-archive).

Wave: #544 async page-in increment-1, #552 capture observability,
#554 native-CUDA session-reuse recurrent-state reset (closes #553),
27B offload A/B proof (2.9x VRAM, byte-exact).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@justinchuby
justinchuby enabled auto-merge (squash) July 31, 2026 09:14
@codecov

codecov Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.16%. Comparing base (fa1afed) to head (b4591f8).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #555      +/-   ##
==========================================
+ Coverage   80.59%   81.16%   +0.57%     
==========================================
  Files         315      315              
  Lines      123446   123446              
  Branches   123446   123446              
==========================================
+ Hits        99489   100198     +709     
+ Misses      19907    19191     -716     
- Partials     4050     4057       +7     
Flag Coverage Δ
cli-ort-linux 83.27% <ø> (ø)
cli-ort-windows 82.67% <ø> (-0.11%) ⬇️
mlas 77.91% <ø> (ø)
offline 81.12% <ø> (+0.60%) ⬆️

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

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

@justinchuby
justinchuby merged commit bcdae6f into main Jul 31, 2026
14 checks passed
@justinchuby
justinchuby deleted the squad/scribe-round8 branch July 31, 2026 09:20
@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
🔴 matmul/medium_generic_bf16_threads=8/32x512x512 377.65 µs 675.98 µs +79.0%
🔴 matmul/large_generic_bf16_threads=8/32x1024x1024 1.35 ms 2.38 ms +76.7%
🔴 matmul/medium_generic_f32_threads=8/32x512x512 1.04 ms 1.79 ms +71.5%
🔴 gather/large_f32_threads=1-internal/131072 30.19 µs 48.17 µs +59.6%
🔴 matmul/large_generic_f32_threads=8/32x1024x1024 4.62 ms 6.86 ms +48.5%
🔴 matmul/medium_generic_f16_threads=8/32x512x512 30.47 µs 44.59 µs +46.3%
🔴 tokenization/decode_tokens_per_second 6.51 ms 8.85 ms +35.9%
🔴 matmul/large_generic_f16_threads=8/32x1024x1024 78.95 µs 105.24 µs +33.3%
⚠️ matmul/small_generic_bf16_threads=1/1x256x256 33.26 µs 43.19 µs +29.9%
⚠️ matmul/small_generic_f32_threads=8/1x256x256 39.79 µs 50.85 µs +27.8%
⚠️ gather/large_f16_threads=1-internal/131072 12.23 µs 15.40 µs +25.9%
⚠️ matmul/small_generic_bf16_threads=8/1x256x256 33.42 µs 39.16 µs +17.2%
⚠️ gather/large_bf16_threads=1-internal/131072 12.87 µs 14.98 µs +16.3%
⚠️ matmul/medium_generic_f16_threads=1/32x512x512 30.61 µs 35.41 µs +15.7%
✅ matmul/small_generic_f16_threads=8/1x256x256 32.67 µs 37.15 µs +13.7%
✅ matmul/large_generic_f16_threads=1/32x1024x1024 77.42 µs 87.84 µs +13.5%
✅ matmul/small_generic_f16_threads=1/1x256x256 31.82 µs 35.89 µs +12.8%
✅ kv_cache/alloc_dealloc_pages 35.43 µs 39.57 µs +11.7%
✅ grammar_masking/llguidance_compute_mask/32 68.95 µs 76.93 µs +11.6%
✅ sampling_latency/min_p_per_token 312.70 µs 348.62 µs +11.5%
✅ sampling_latency/greedy_per_token 3.00 µs 3.31 µs +10.4%
✅ logit_processing/seven_processor_chain_per_step 1.10 ms 1.20 ms +8.7%
✅ sampling_latency/top_p_per_token 919.06 µs 995.65 µs +8.3%
✅ add/medium_f32_threads=1-internal/262144 2.65 ms 2.86 ms +8.0%
✅ matmul/large_generic_bf16_threads=1/32x1024x1024 1.95 ms 2.09 ms +7.3%
✅ add/medium_f16_threads=1-internal/262144 2.76 ms 2.94 ms +6.6%
✅ matmul/small_generic_f32_threads=1/1x256x256 40.57 µs 43.23 µs +6.6%
✅ sampling_latency/top_k_per_token 472.13 µs 498.92 µs +5.7%
✅ matmul/medium_generic_bf16_threads=1/32x512x512 530.62 µs 547.44 µs +3.2%
✅ matmul/large_generic_f32_threads=1/32x1024x1024 9.71 ms 9.77 ms +0.6%
✅ add/small_bf16_threads=1-internal/1024 13.17 µs 12.81 µs -2.7%
✅ gather/medium_f16_threads=1-internal/32768 2.74 µs 2.64 µs -3.9%
✅ add/small_f16_threads=1-internal/1024 12.63 µs 12.05 µs -4.5%
✅ tokenization/encode_tokens_per_second 416.90 µs 396.19 µs -5.0%
✅ add/medium_bf16_threads=1-internal/262144 3.17 ms 2.92 ms -8.0%
✅ add/large_f32_threads=1-internal/4194304 47.58 ms 42.49 ms -10.7%
🟢 gather/small_f16_threads=1-internal/4096 569.1 ns 482.6 ns -15.2%
🟢 matmul/medium_generic_f32_threads=1/32x512x512 2.82 ms 2.38 ms -15.5%
🟢 gather/small_bf16_threads=1-internal/4096 594.0 ns 489.9 ns -17.5%
🟢 add/small_f32_threads=1-internal/1024 226.3 ns 181.7 ns -19.7%
🟢 gather/medium_bf16_threads=1-internal/32768 3.21 µs 2.56 µs -20.3%
🟢 gather/small_f32_threads=1-internal/4096 876.4 ns 680.0 ns -22.4%
🟢 add/large_f16_threads=1-internal/4194304 56.27 ms 43.10 ms -23.4%
🟢 reduce_mean/large_f32_threads=1-internal/262144 1.49 ms 1.11 ms -25.6%
🟢 reduce_mean/small_f32_threads=1-internal/4096 23.56 µs 16.66 µs -29.3%
🟢 add/large_bf16_threads=1-internal/4194304 66.15 ms 44.36 ms -32.9%
🟢 gather/medium_f32_threads=1-internal/32768 6.78 µs 4.41 µs -34.9%
🟢 reduce_mean/medium_f32_threads=1-internal/65536 419.98 µs 267.91 µs -36.2%

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.4.0 arm64
Rust: rustc 1.97.1 (8bab26f4f 2026-07-14)
Load avg: { 3.24 4.28 7.74 }
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)

justinchuby added a commit that referenced this pull request Aug 23, 2026
…-starvation, stale-figure disclaimers)

Adds to the same EXPERIMENTAL spike test file:
- QWEN15_MOE_A27B fixture shape (experts=60, hidden=2048, inter=1408,
  top_k=4, cited from Qwen1.5-MoE-A2.7B's published config.json) and a
  new #[ignore]d test exercising it, since prior architecture notes name
  this exact fixture ("qwen15-moe-qmoe") and it had not been measured
  directly before.
- A deterministic "real cold bytes/step, measured from fixture, NOT
  modeled" print emitted before any control run or timing number, for
  every shape, per measurement-discipline's bytes/counters-first rule.
- A new resize-starvation stress test
  (qmoe_routed_residency_guard_resize_starvation_stress_1000_steps)
  driving the real CudaWeightResidency::acquire_routed_residency /
  resize_safe_point / execute_resize machinery through 1000 back-to-back
  acquire-hold-release cycles simulating sequential decode-step dispatch:
  every resize attempted while a guard is held is confirmed rejected
  (NotSafePoint), every resize attempted in the inter-step gap is
  confirmed accepted and executed -- no starvation, no guard-count drift
  over 1000 cycles. Explicitly scoped: single-threaded/sequential only;
  concurrent-stream starvation remains a separate, larger follow-up spike.

No new allocator/cache, no kernel ABI change, no sub-weight VMM/host-map
composition attempted or built -- per the reviewing instruction, this
spike remains bounded to what today's whole-tensor-granularity zero-copy
mechanism and existing RoutedResidencyGuard/resize machinery already
support. Verdict unchanged: NO-GO for whole-tensor-granularity A' as a
production per-expert cold path.

Correctness: still bit-identical on every arm across all 3 shapes, 2 more
independent idle-A100 runs (GPU 5 and GPU 6). Bandwidth close to and
consistent with the original 2-shape run (~31.5-35.6 GB/s all-cold,
~25.8-29.1 GB/s mixed fc1-cold across all 3 shapes) -- these are freshly
measured on A100/Linux/real-QMoE-GEMV and are NOT #880's RTX4060/WDDM
5.6 GB/s figure nor #925's H200/Linux dense-qwen14b 6.795 GB ceiling;
neither prior figure is reused or blended into these numbers.

Full updated report in
.squad/decisions/inbox/deckard-a-prime-spike-results-cycle7.md, including
the correction that Mobius #550/#555 now close the DeepSeek-V4/GLM-5.2
exporter prerequisite (artifacts still absent from this box).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Native CUDA decode corrupts generation #2+ in a reused session (per-session state not reset)

1 participant