Skip to content

perf(cuda): reuse pinned buffer completion events - #10713

Merged
0ax1 merged 1 commit into
developfrom
ad/cuda-pinned-event-reuse
Oct 23, 2026
Merged

0ax1 merged 1 commit into
developfrom
ad/cuda-pinned-event-reuse

Conversation

@0ax1

@0ax1 0ax1 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Pinned-buffer reclamation allocates an extra completion event for each transfer.

Solution

Reuse the buffer owner's event to track inflight transfers.

Assessment

Preserves the source-retention guarantees and event flags from #10712, which must merge first.

@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

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

⚡ 8 improved benchmarks
❌ 1 regressed benchmark
✅ 2399 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.7 µs 7.6 µs -11.31%
⚡ Walltime filter_neon[8] 1,997 ns 916 ns ×2.2
⚡ Walltime threshold_neon[8] 2.6 µs 1.3 µs +98.46%
⚡ Walltime threshold_neon[64] 3.5 µs 2.5 µs +39.8%
⚡ Walltime filter_neon[64] 2.5 µs 1.8 µs +38.41%
⚡ Walltime threshold_neon[80] 4.6 µs 3.4 µs +36.84%
⚡ Walltime filter_neon[80] 3.4 µs 2.6 µs +31.46%
⚡ Walltime decode_chunked_neon[i64, 524288] 15.7 µs 13.3 µs +18.09%
⚡ CPU Simulation test_scan_filter[int] 3.4 ms 3 ms +12.7%

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-pinned-event-reuse (8acd798) with develop (c750fbd)

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/performance A performance improvement label Oct 23, 2026 — with ChatGPT Codex Connector
@0ax1
0ax1 force-pushed the ad/cuda-pinned-event-reuse branch from a03d03f to b0d3e4a Compare October 23, 2026 13:13
@0ax1
0ax1 force-pushed the ad/cuda-pinned-transfer-safety branch from 1f87c45 to 40f13e2 Compare October 23, 2026 13:13
@0ax1
0ax1 requested a review from robert3005 October 23, 2026 14:50
@0ax1
0ax1 marked this pull request as ready for review October 23, 2026 14:51
@0ax1
0ax1 force-pushed the ad/cuda-pinned-transfer-safety branch from 40f13e2 to cd9ea47 Compare October 23, 2026 15:44
@0ax1
0ax1 force-pushed the ad/cuda-pinned-event-reuse branch from b0d3e4a to 81e4221 Compare October 23, 2026 15:45
0ax1 added a commit that referenced this pull request Oct 23, 2026
## Problem

A failed or resubmitted transfer can recycle pinned source memory before its previous DMA completes.

## Solution

Check contexts, wait on the previous source fence, and establish completion before recycling buffers.

## Assessment

If completion cannot be established, retain the allocation rather than risk freeing active DMA memory. Based on #10726; prerequisite for #10713.

Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Base automatically changed from ad/cuda-pinned-transfer-safety to develop October 23, 2026 17:14
Use each pinned buffer owner event for inflight reclamation instead of allocating another completion event per transfer. Preserve the source-retention and failure-recovery guarantees of the parent change.

Original-commit: ff5e49b1f0
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
@0ax1
0ax1 force-pushed the ad/cuda-pinned-event-reuse branch from 81e4221 to 8acd798 Compare October 23, 2026 17:16
@0ax1
0ax1 merged commit 0373c93 into develop Oct 23, 2026
92 of 97 checks passed
@0ax1
0ax1 deleted the ad/cuda-pinned-event-reuse branch October 23, 2026 18:08
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