Skip to content

docs(cuda-memory): correct stale test_support cfg(test) claim (follow-up to #762's CI fix) - #818

Merged
justinchuby merged 1 commit into
mainfrom
squad/fix-cuda-test-support-gate
Aug 12, 2026
Merged

justinchuby merged 1 commit into
mainfrom
squad/fix-cuda-test-support-gate

Conversation

@justinchuby

@justinchuby justinchuby commented Aug 12, 2026 •

Copy link
Copy Markdown
Owner

Context

PR #762 merged into main at e9c0ab6a4 and already carries the fix for the
CI-wide compile break introduced by #807: crates/onnx-runtime-cuda-memory/src/lib.rs
gates pub mod test_support; on #[cfg(feature = "gpu-tests")] only (previously
#[cfg(any(test, feature = "gpu-tests"))]), and the one integration test that
uses TestStream (tests/vmm_kv_layout_residency_gpu.rs) cfg-gates its import
and body accordingly.

Root cause recap: cfg(test) is only set when a crate compiles as its own
unit-test binary. Integration tests under tests/*.rs link the crate as a
regular (non---test) dependency, so cfg(test) never applies to them. The
old gate any(test, feature = "gpu-tests") therefore never actually exposed
test_support to tests/vmm_kv_layout_residency_gpu.rs unless gpu-tests was
passed explicitly — which is exactly what broke CI's honesty-checker base
(cuda-only, no gpu-tests) build for 7 of 9 failed jobs on #762's own CI run.

What this PR does

Since the functional fix already reached main via #762, this PR is a
minimal, standalone doc correction
: test_support.rs's module doc still said
the module was compiled "behind the gpu-tests feature (and the crate's own
cfg(test))" — stale wording that contradicts the actual (correct) gate in
lib.rs and could mislead a future reader into re-introducing the same bug by
assuming cfg(test) alone helps here. Updated the doc to explicitly state the
gate is gpu-tests-only and explain why cfg(test) doesn't apply to
integration tests.

No functional/behavioral change. No .squad/ state included.

Delta vs. Opus-approved fix (afbd2c1 on #762)

git diff afbd2c131 origin/main -- crates/onnx-runtime-cuda-memory/src/lib.rs crates/onnx-runtime-cuda-memory/tests/vmm_kv_layout_residency_gpu.rs
is empty — main already has byte-identical content for both files via the
#762 merge. The only delta introduced by this branch beyond what Opus already
reviewed is the test_support.rs doc-comment correction (7 insertions / 3
deletions), which was never part of the reviewed diff. Flagging this so a tiny
follow-up look is optional but available before merge.

Validation (local, CPU-only host, matching CI's commands)

  • cargo test --locked -p onnx-runtime-cuda-memory --features cuda --tests --no-run — compiles clean (base/no-gpu-tests config)
  • cargo test --locked -p onnx-runtime-cuda-memory --features cuda,gpu-tests --tests --no-run — compiles clean (gpu-tests config)
  • python .github/scripts/verify_cuda_test_honesty.py — passes: 416 tests/66 targets identical in both configs (416 ignored without gpu-tests; 412 fail-loud/4 ignored/0 passed with gpu-tests on this no-CUDA host)
  • cargo clippy --locked -p onnx-runtime-cuda-memory --features cuda --all-targets -- -D warnings — clean
  • cargo clippy --locked -p onnx-runtime-cuda-memory --features cuda,gpu-tests --all-targets -- -D warnings — clean
  • cargo check --locked -p onnx-runtime-ep-cuda -p onnx-runtime-python --features onnx-runtime-python/cuda — clean
  • cargo test --locked -p onnx-runtime-ep-cuda --features cuda --test capture_sync_contract — 1 passed
  • cargo clippy -p onnx-runtime-ep-cuda --features cuda -- -D warnings — clean
  • cargo fmt --all -- --check — clean

Notes

…le doc

test_support's module doc still said the module was compiled 'behind the
gpu-tests feature (and the crate's own cfg(test))'. That's stale: the gate
is (and must be) feature = "gpu-tests" only. cfg(test) never usefully
gated this module because cfg(test) is only set when this crate compiles
as its own unit-test binary, not when tests/*.rs integration tests link
it as a regular dependency (#807's root cause). Clarify the doc so it
matches the actual gate in lib.rs and doesn't mislead future readers into
thinking cfg(test) alone would expose test_support to tests/*.rs.

No functional change: crates/onnx-runtime-cuda-memory/src/lib.rs and
tests/vmm_kv_layout_residency_gpu.rs already carry the feature-only gate
fix on origin/main (merged via PR #762, commit e9c0ab6), so this hotfix
branch only needed the doc correction on top of latest main.

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

codecov Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.47%. Comparing base (e9c0ab6) to head (dc00350).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #818      +/-   ##
==========================================
- Coverage   78.20%   77.47%   -0.74%     
==========================================
  Files         350      350              
  Lines      141311   141311              
  Branches   141311   141311              
==========================================
- Hits       110519   109475    -1044     
- Misses      26389    27437    +1048     
+ Partials     4403     4399       -4     
Flag Coverage Δ
cli-ort-linux 83.50% <ø> (ø)
cli-ort-windows 82.99% <ø> (-0.10%) ⬇️
mlas 80.92% <ø> (-0.42%) ⬇️
offline 77.17% <ø> (-0.78%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 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
🔴 gather/large_f32_threads=1-internal/131072 25.69 µs 43.67 µs +70.0%
🔴 matmul/small_generic_f32_threads=8/1x256x256 34.80 µs 55.28 µs +58.8%
🔴 matmul/small_generic_f16_threads=1/1x256x256 31.72 µs 45.90 µs +44.7%
🔴 gather/large_bf16_threads=1-internal/131072 11.13 µs 15.55 µs +39.7%
🔴 matmul/small_generic_f16_threads=8/1x256x256 30.88 µs 42.21 µs +36.7%
🔴 matmul/small_generic_f32_threads=1/1x256x256 37.85 µs 50.27 µs +32.8%
⚠️ gather/medium_f32_threads=1-internal/32768 3.73 µs 4.74 µs +27.2%
⚠️ gather/large_f16_threads=1-internal/131072 11.94 µs 15.04 µs +26.0%
⚠️ matmul/small_generic_bf16_threads=1/1x256x256 33.22 µs 41.24 µs +24.2%
⚠️ gather/medium_bf16_threads=1-internal/32768 2.43 µs 2.99 µs +23.1%
⚠️ gather/medium_f16_threads=1-internal/32768 2.44 µs 3.00 µs +22.9%
⚠️ gather/small_f16_threads=1-internal/4096 482.6 ns 574.3 ns +19.0%
⚠️ add/medium_f16_threads=1-internal/262144 2.54 ms 2.95 ms +16.1%
⚠️ gather/small_bf16_threads=1-internal/4096 479.7 ns 554.6 ns +15.6%
⚠️ add/large_f16_threads=1-internal/4194304 41.43 ms 47.71 ms +15.2%
✅ add/medium_bf16_threads=1-internal/262144 2.61 ms 3.00 ms +14.9%
✅ add/medium_f32_threads=1-internal/262144 2.51 ms 2.87 ms +14.4%
✅ logit_processing/seven_processor_chain_per_step 347.05 µs 395.15 µs +13.9%
✅ reduce_mean/large_f32_threads=1-internal/262144 1.00 ms 1.13 ms +12.9%
✅ matmul/small_generic_bf16_threads=8/1x256x256 36.33 µs 40.62 µs +11.8%
✅ add/large_f32_threads=1-internal/4194304 42.59 ms 47.26 ms +11.0%
✅ gather/small_f32_threads=1-internal/4096 678.8 ns 742.1 ns +9.3%
✅ matmul/large_generic_f32_threads=1/32x1024x1024 10.48 ms 11.21 ms +6.9%
✅ add/large_bf16_threads=1-internal/4194304 42.70 ms 45.42 ms +6.4%
✅ kv_cache/alloc_dealloc_pages 42.72 µs 44.45 µs +4.1%
✅ reduce_mean/small_f32_threads=1-internal/4096 15.49 µs 16.00 µs +3.2%
✅ block_quantized_moe_cached_dense/mxfp4_cached_dense_expert_repeated_call/rows=1,H=256,I=256,E=4,top_k=1 82.57 µs 85.04 µs +3.0%
✅ qwen3_sampling_processors/top_k_top_p_fast 697.05 µs 713.16 µs +2.3%
✅ add/small_bf16_threads=1-internal/1024 13.28 µs 13.57 µs +2.2%
✅ matmul/medium_generic_bf16_threads=1/32x512x512 568.35 µs 573.01 µs +0.8%
✅ matmul/medium_generic_f32_threads=1/32x512x512 2.42 ms 2.43 ms +0.7%
✅ grammar_masking/llguidance_compute_mask/32 87.48 µs 87.84 µs +0.4%
✅ add/small_f16_threads=1-internal/1024 13.47 µs 13.48 µs +0.0%
✅ matmul/medium_generic_f16_threads=1/32x512x512 32.94 µs 32.62 µs -1.0%
✅ qwen3_sampling_processors/top_p_fast_after_top_k 583.24 µs 576.76 µs -1.1%
✅ sampling_latency/top_p_per_token 421.72 µs 414.34 µs -1.8%
✅ reduce_mean/medium_f32_threads=1-internal/65536 278.03 µs 272.77 µs -1.9%
✅ qwen3_sampling_processors/top_k_partial_selection 165.23 µs 161.17 µs -2.5%
✅ add/small_f32_threads=1-internal/1024 213.1 ns 206.9 ns -2.9%
✅ qwen3_sampling_processors/top_p_full_sort_after_top_k_baseline 4.00 ms 3.87 ms -3.2%
✅ matmul/medium_generic_f32_threads=8/32x512x512 1.04 ms 992.68 µs -4.6%
✅ matmul/medium_generic_f16_threads=8/32x512x512 33.02 µs 31.36 µs -5.0%
✅ sampling_latency/top_k_per_token 58.81 µs 55.18 µs -6.2%
✅ qwen3_sampling_processors/top_k_top_p_full_sort_baseline 6.66 ms 6.16 ms -7.5%
✅ sampling_latency/min_p_per_token 227.09 µs 208.71 µs -8.1%
✅ qwen3_sampling_processors/top_k_full_sort_baseline 2.42 ms 2.22 ms -8.5%
✅ sampling_latency/greedy_per_token 3.78 µs 3.45 µs -8.6%
✅ tokenization/decode_tokens_per_second 8.25 ms 7.45 ms -9.7%
✅ tokenization/encode_tokens_per_second 472.51 µs 418.92 µs -11.3%
✅ matmul/medium_generic_bf16_threads=8/32x512x512 460.87 µs 400.03 µs -13.2%
🟢 matmul/large_generic_f16_threads=1/32x1024x1024 108.91 µs 83.15 µs -23.7%
🟢 matmul/large_generic_f32_threads=8/32x1024x1024 5.47 ms 3.97 ms -27.4%
🟢 block_quantized_moe_cached_dense/mxfp4_uncached_expert_dequant_each_call/rows=1,H=256,I=256,E=4,top_k=1 557.88 µs 403.20 µs -27.7%
🟢 block_quantized_matmul_cached_dense/mxfp4_cached_dense_repeated_call/1x1024x1024 80.43 µs 58.04 µs -27.8%
🟢 block_quantized_matmul_cached_dense/mxfp4_uncached_dequant_each_call/1x1024x1024 828.70 µs 596.51 µs -28.0%
🟢 block_quantized_matmul_cached_dense/mxfp4_preexpanded_dense_oncelock_like_proxy/1x1024x1024 81.80 µs 56.44 µs -31.0%
🟢 matmul/large_generic_bf16_threads=1/32x1024x1024 3.38 ms 2.13 ms -37.1%
🟢 matmul/large_generic_f16_threads=8/32x1024x1024 142.38 µs 88.91 µs -37.6%
🟢 matmul/large_generic_bf16_threads=8/32x1024x1024 3.10 ms 1.58 ms -49.1%

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.96 3.80 5.33 }
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 marked this pull request as ready for review August 12, 2026 16:00
@justinchuby
justinchuby merged commit c82934f into main Aug 12, 2026
10 of 15 checks passed
@justinchuby
justinchuby deleted the squad/fix-cuda-test-support-gate branch August 12, 2026 18:30
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