Skip to content

cuda(perf): skip unused CUDA events - #11819

Merged
0ax1 merged 2 commits into
developfrom
ad/cuda-skip-unused-launch-events
Nov 23, 2026
Merged

0ax1 merged 2 commits into
developfrom
ad/cuda-skip-unused-launch-events

Conversation

@0ax1

@0ax1 0ax1 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

The default CUDA launch strategy recorded two events around every kernel and discarded them. Skip that pair unless the strategy asks for it: tracing and benchmarks can still time kernels, and the driver still tracks buffer dependencies across streams.

Breaking change: LaunchStrategy::event_flags now returns Option<CUevent_flags>. Return Some(previous_flags) to keep receiving completion callbacks, or None to skip both the events and the callback.

On GH200, mean BenchPress SF10 lineitem read latency was 1.4% lower hot and 3.5% lower cold across four pairs per cache mode.

Related: #9436 (closed as stale).

AI assistance: I used an OpenAI coding agent to implement the change and run BenchPress.

Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
@0ax1 0ax1 added the changelog/break A breaking API change label Nov 23, 2026
@0ax1

0ax1 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

BenchPress GPU reads of TPC-H SF10 lineitem (float64) on a GH200, compared with develop at 1990852. Times below are milliseconds per read; lower is better.

Cache Round Baseline reads Patched reads Mean time saved
Hot 1 40.90, 39.70 40.30, 39.11 0.60 ms (1.5%)
Hot 2 40.86, 39.34 39.48, 39.71 0.50 ms (1.3%)
Cold 1 76.86, 74.82 74.45, 71.32 2.96 ms (3.9%)
Cold 2 79.15, 74.82 75.97, 73.34 2.33 ms (3.0%)

Across both rounds the patch was faster in 3 of 4 hot pairs and 4 of 4 cold pairs. Mean latency fell 1.4% hot and 3.5% cold. The hot effect is small enough that one pair reversed.

Both rounds used the same release binaries (mimalloc), with native I/O, cuda_async, late strings enabled, and disk-backed scratch. One timed read per visit; build order was reversed for the second pair in each round. BenchPress staged the same 59,986,052 rows outside the timer; encoded files had the same size but were not byte-identical.

@0ax1
0ax1 requested a review from robert3005 November 23, 2026 12:51
@0ax1 0ax1 changed the title Skip unused events on default CUDA launches cuda(perf): Skip unused events on default CUDA launches Nov 23, 2026
@0ax1 0ax1 changed the title cuda(perf): Skip unused events on default CUDA launches cuda(perf): Skip unused CUDA events Nov 23, 2026
@0ax1 0ax1 changed the title cuda(perf): Skip unused CUDA events cuda(perf): skip unused CUDA events Nov 23, 2026
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
@codspeed

codspeed Bot commented Nov 23, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 10.71%

1 warning

⚠️ 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

⚡ 1 improved benchmark
✅ 2072 untouched benchmarks
⏩ 85 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Walltime decode_avx512[DeltaU8] 11.1 µs 10 µs +10.71%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ad/cuda-skip-unused-launch-events (7f4a8f7) with develop (3597b3a)

Open in CodSpeed

Footnotes

  1. 85 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. ↩

@0ax1 0ax1 added the changelog/performance A performance improvement label Nov 23, 2026
@0ax1
0ax1 enabled auto-merge (squash) November 23, 2026 13:09
@0ax1 0ax1 removed the changelog/break A breaking API change label Nov 23, 2026
@0ax1
0ax1 merged commit de41164 into develop Nov 23, 2026
111 of 113 checks passed
@0ax1
0ax1 deleted the ad/cuda-skip-unused-launch-events branch November 23, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/performance A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants