Skip to content

style: apply rustfmt to matmul_nbits.rs - #1108

Merged
justinchuby merged 1 commit into
mainfrom
squad/leon-fmt2
Aug 17, 2026
Merged

justinchuby merged 1 commit into
mainfrom
squad/leon-fmt2

Conversation

@justinchuby

Copy link
Copy Markdown
Owner

main is currently red on cargo fmt --check: #1101 landed one slice expression that stable rustfmt reformats. That fails the "Check formatting" step in both Fast (Linux x86_64) and Rust quality, on main and on every open PR.

This applies exactly the diff CI printed, verbatim:

             for c in 0..group {
-                let block_values = &packed_rows[c]
-                    [block * packed_block_size..(block + 1) * packed_block_size];
+                let block_values =
+                    &packed_rows[c][block * packed_block_size..(block + 1) * packed_block_size];

No behaviour change, no other file touched. cargo fmt --all -- --check is clean locally after it.

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

#1101 left one slice expression unformatted, which makes `cargo fmt --check`
fail on `main` and therefore on every open pull request (both `Fast (Linux
x86_64)` and `Rust quality` fail at the "Check formatting" step).

This is exactly the diff CI printed, applied verbatim - no other change to the
file and no change to behaviour.

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

codecov Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.92%. Comparing base (1158698) to head (df59a39).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...es/onnx-runtime-ep-cpu/src/kernels/matmul_nbits.rs 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1108      +/-   ##
==========================================
+ Coverage   79.83%   79.92%   +0.09%     
==========================================
  Files         367      369       +2     
  Lines      157237   160217    +2980     
  Branches   157237   160217    +2980     
==========================================
+ Hits       125537   128061    +2524     
- Misses      26987    27425     +438     
- Partials     4713     4731      +18     
Flag Coverage Δ
cli-ort-linux 83.79% <ø> (ø)
cli-ort-windows 83.40% <ø> (ø)
mlas 84.50% <ø> (?)
offline 79.70% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...es/onnx-runtime-ep-cpu/src/kernels/matmul_nbits.rs 75.66% <0.00%> (ø)

... and 9 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
🔴 sampling_latency/top_p_per_token 384.67 µs 506.42 µs +31.7%
⚠️ tokenization/encode_tokens_per_second 397.29 µs 504.12 µs +26.9%
⚠️ sampling_latency/top_k_per_token 52.94 µs 66.50 µs +25.6%
⚠️ qwen3_sampling_processors/top_k_top_p_full_sort_baseline 5.99 ms 7.36 ms +22.9%
⚠️ matmul/large_generic_bf16_threads=1/32x1024x1024 2.29 ms 2.80 ms +22.2%
⚠️ tokenization/decode_tokens_per_second 6.60 ms 8.04 ms +21.9%
⚠️ block_quantized_matmul_cached_dense/mxfp4_uncached_dequant_each_call/1x1024x1024 890.94 µs 1.08 ms +21.2%
⚠️ qwen3_sampling_processors/top_k_full_sort_baseline 2.23 ms 2.66 ms +19.3%
⚠️ sampling_latency/min_p_per_token 215.92 µs 256.87 µs +19.0%
⚠️ qwen3_sampling_processors/top_k_partial_selection 156.75 µs 185.16 µs +18.1%
⚠️ qwen3_sampling_processors/top_p_full_sort_after_top_k_baseline 3.94 ms 4.53 ms +15.1%
✅ sampling_latency/greedy_per_token 3.31 µs 3.79 µs +14.5%
✅ qwen3_sampling_processors/top_p_fast_after_top_k 535.35 µs 601.24 µs +12.3%
✅ block_quantized_moe_cached_dense/mxfp4_cached_dense_expert_repeated_call/rows=1,H=256,I=256,E=4,top_k=1 187.44 µs 209.77 µs +11.9%
✅ gather/large_bf16_threads=1-internal/131072 13.63 µs 14.82 µs +8.7%
✅ logit_processing/seven_processor_chain_per_step 361.08 µs 392.19 µs +8.6%
✅ grammar_masking/llguidance_compute_mask/32 87.12 µs 92.92 µs +6.7%
✅ matmul/large_generic_f32_threads=8/32x1024x1024 5.45 ms 5.68 ms +4.1%
✅ gather/large_f16_threads=1-internal/131072 14.30 µs 14.74 µs +3.1%
✅ add/large_f16_threads=1-internal/4194304 1.71 ms 1.75 ms +2.3%
✅ block_quantized_matmul_cached_dense/mxfp4_preexpanded_dense_oncelock_like_proxy/1x1024x1024 106.89 µs 108.97 µs +1.9%
✅ matmul/medium_generic_f16_threads=8/32x512x512 47.15 µs 47.77 µs +1.3%
✅ matmul/small_generic_f32_threads=1/1x256x256 42.37 µs 42.83 µs +1.1%
✅ add/large_f32_threads=1-internal/4194304 777.88 µs 777.41 µs -0.1%
✅ qwen3_sampling_processors/top_k_top_p_fast 741.80 µs 741.24 µs -0.1%
✅ add/large_bf16_threads=1-internal/4194304 1.73 ms 1.72 ms -0.3%
✅ matmul/medium_generic_f32_threads=8/32x512x512 1.45 ms 1.43 ms -0.9%
✅ add/small_bf16_threads=1-internal/1024 511.9 ns 507.2 ns -0.9%
✅ matmul/small_generic_f16_threads=1/1x256x256 40.02 µs 39.57 µs -1.1%
✅ matmul/small_generic_bf16_threads=8/1x256x256 40.97 µs 40.26 µs -1.7%
✅ reduce_mean/small_f32_threads=1-internal/4096 16.34 µs 15.98 µs -2.2%
✅ matmul/large_generic_f32_threads=1/32x1024x1024 10.22 ms 9.89 ms -3.2%
✅ block_quantized_moe_cached_dense/mxfp4_uncached_expert_dequant_each_call/rows=1,H=256,I=256,E=4,top_k=1 644.97 µs 618.60 µs -4.1%
✅ gather/medium_f16_threads=1-internal/32768 2.78 µs 2.65 µs -4.5%
✅ gather/small_f32_threads=1-internal/4096 727.1 ns 693.1 ns -4.7%
✅ matmul/large_generic_f16_threads=1/32x1024x1024 90.43 µs 86.10 µs -4.8%
✅ add/small_f16_threads=1-internal/1024 505.4 ns 480.1 ns -5.0%
✅ matmul/small_generic_bf16_threads=1/1x256x256 40.60 µs 38.36 µs -5.5%
✅ add/medium_bf16_threads=1-internal/262144 119.10 µs 112.48 µs -5.6%
✅ reduce_mean/large_f32_threads=1-internal/262144 1.11 ms 1.04 ms -6.0%
✅ gather/medium_f32_threads=1-internal/32768 4.47 µs 4.20 µs -6.0%
✅ matmul/small_generic_f16_threads=8/1x256x256 41.40 µs 38.36 µs -7.3%
✅ matmul/medium_generic_bf16_threads=1/32x512x512 592.27 µs 546.44 µs -7.7%
✅ gather/small_f16_threads=1-internal/4096 536.7 ns 491.6 ns -8.4%
✅ gather/small_bf16_threads=1-internal/4096 528.9 ns 484.0 ns -8.5%
✅ matmul/medium_generic_f16_threads=1/32x512x512 40.70 µs 36.67 µs -9.9%
✅ add/medium_f16_threads=1-internal/262144 119.75 µs 107.80 µs -10.0%
✅ add/medium_f32_threads=1-internal/262144 28.26 µs 25.41 µs -10.1%
✅ gather/large_f32_threads=1-internal/131072 41.76 µs 37.32 µs -10.6%
✅ matmul/large_generic_f16_threads=8/32x1024x1024 113.77 µs 101.12 µs -11.1%
✅ matmul/medium_generic_f32_threads=1/32x512x512 2.73 ms 2.42 ms -11.2%
✅ matmul/small_generic_f32_threads=8/1x256x256 58.74 µs 51.98 µs -11.5%
✅ reduce_mean/medium_f32_threads=1-internal/65536 284.29 µs 249.97 µs -12.1%
✅ kv_cache/alloc_dealloc_pages 47.28 µs 40.79 µs -13.7%
🟢 block_quantized_matmul_cached_dense/mxfp4_cached_dense_repeated_call/1x1024x1024 123.77 µs 98.81 µs -20.2%
🟢 matmul/medium_generic_bf16_threads=8/32x512x512 656.50 µs 519.38 µs -20.9%
🟢 matmul/large_generic_bf16_threads=8/32x1024x1024 2.43 ms 1.87 ms -23.0%
🟢 gather/medium_bf16_threads=1-internal/32768 3.37 µs 2.41 µs -28.5%
🟢 add/small_f32_threads=1-internal/1024 283.9 ns 200.5 ns -29.4%

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: { 4.70 4.48 5.45 }
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
justinchuby merged commit f660f8a into main Aug 17, 2026
13 of 18 checks passed
@justinchuby
justinchuby deleted the squad/leon-fmt2 branch August 17, 2026 06:01
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