Skip to content

fix(cuda): bound concurrent stream-pool initialization - #10711

Merged
0ax1 merged 1 commit into
developfrom
ad/cuda-stream-pool-init
Oct 23, 2026
Merged

0ax1 merged 1 commit into
developfrom
ad/cuda-stream-pool-init

Conversation

@0ax1

@0ax1 0ax1 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Concurrent first use can create more CUDA streams than the pool's configured capacity.

Solution

Use OnceCell::get_or_try_init for each pool slot, replacing the custom initialization lock and ArcSwap.

Assessment

Initialized access remains lock-free and failed initialization can be retried. Uses once_cell because the fallible std::sync::OnceLock API is unstable. Based on #10726.

@codspeed

codspeed Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

2 warnings, 1 note

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ 20 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

ℹ️ 40 benchmarks have no flamegraph

The flamegraph wasn't generated: the symbols of the profiling trace could not be resolved, because no information about the language frames was collected.

See affected benchmarks

⚡ 4 improved benchmarks
❌ 1 regressed benchmark
✅ 2403 untouched benchmarks
⏩ 12 skipped benchmarks1
🗄️ 43 archived benchmarks run2

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Walltime bitpack_blocked_compress_avx2 6.8 µs 7.6 µs -10.4%
⚡ CPU Simulation decode_primitives[i64, (1000, 8)] 37.6 µs 24 µs +56.62%
⚡ CPU Simulation take[routing/alternating_chunks/primitive/nonnull/chunks=32/indices=1000] 247.1 µs 196.7 µs +25.62%
⚡ Walltime bitpack_blocked_compress_avx512 5.6 µs 4.8 µs +15.94%
⚡ Walltime words_gather_dispatch_neon[65536] 2 µs 1.8 µs +10.18%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ad/cuda-stream-pool-init (ceea114) with develop (e083440)

Open in CodSpeed

Footnotes

  1. 12 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. 43 benchmarks were run, but are now archived. If they were deleted in another branch, consider rebasing to remove them from the report. Instead if they were added back, click here to restore them. ↩

@0ax1 0ax1 added the changelog/fix A bug fix label Oct 23, 2026 — with ChatGPT Codex Connector
@0ax1
0ax1 changed the base branch from develop to ad/ctutils-security-update October 23, 2026 13:13
@0ax1
0ax1 force-pushed the ad/cuda-stream-pool-init branch 2 times, most recently from 0d9e7f1 to 40797c4 Compare October 23, 2026 13:27
@0ax1
0ax1 requested a review from robert3005 October 23, 2026 14:49
@0ax1
0ax1 marked this pull request as ready for review October 23, 2026 14:51
Comment thread vortex-cuda/src/stream_pool.rs Outdated
@0ax1
0ax1 force-pushed the ad/cuda-stream-pool-init branch from 40797c4 to b672055 Compare October 23, 2026 14:58
Base automatically changed from ad/ctutils-security-update to develop October 23, 2026 15:34
Serialize first use within each stream-pool slot while retaining lock-free access to initialized slots. Include lazy-creation, round-robin, and concurrent-capacity regression coverage.

Original-commit: ae60fd7950
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
@0ax1
0ax1 force-pushed the ad/cuda-stream-pool-init branch from b672055 to ceea114 Compare October 23, 2026 15:40
@0ax1
0ax1 merged commit 9df0034 into develop Oct 23, 2026
89 of 90 checks passed
@0ax1
0ax1 deleted the ad/cuda-stream-pool-init branch October 23, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants