Skip to content

perf(cuda): reuse file mappings - #10717

Open
0ax1 wants to merge 1 commit into
developfrom
ad/cuda-file-mapping-cache
Open

0ax1 wants to merge 1 commit into
developfrom
ad/cuda-file-mapping-cache

Conversation

@0ax1

@0ax1 0ax1 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Repeated scans rebuild file mappings and page tables; caching them also needs explicit support for cold-cache eviction.

Solution

Cache mappings by file identity/version and add release_file_mappings() and vx_cuda_release_file_mappings().

Assessment

Callers can release cached mappings before eviction while active readers retain ownership. Depends on #10716.

@codspeed

codspeed Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 24.75%

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

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

❌ 2 regressed benchmarks
✅ 2406 untouched benchmarks
⏩ 12 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ CPU Simulation decode_primitives[i64, (1000, 8)] 24 µs 37.6 µs -36.15%
❌ Walltime bitpack_blocked_compress_avx2 6.7 µs 7.6 µs -11.32%

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-file-mapping-cache (a149621) with ad/cuda-mapped-copy (5d8b5f3)

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

@0ax1 0ax1 added the changelog/performance A performance improvement label Oct 23, 2026 — with ChatGPT Codex Connector
@0ax1
0ax1 force-pushed the ad/cuda-file-mapping-cache branch from 8ed5762 to 18c5897 Compare October 23, 2026 13:13
@0ax1
0ax1 force-pushed the ad/cuda-mapped-copy branch from d006295 to 715005f 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 changed the title perf(cuda): reuse file mappings without breaking cold scans perf(cuda): reuse file mappings Oct 23, 2026
@0ax1
0ax1 force-pushed the ad/cuda-mapped-copy branch 2 times, most recently from cbbedfc to 5d8b5f3 Compare October 23, 2026 15:43
@0ax1
0ax1 force-pushed the ad/cuda-file-mapping-cache branch from 18c5897 to a149621 Compare October 23, 2026 15:43
Base automatically changed from ad/cuda-mapped-copy to develop October 23, 2026 17:11
Cache mappings by file identity and version so repeated scans reuse filled page tables. Add Rust and C APIs to release cached mappings before cold-cache eviction while active readers retain their mappings. Include reuse, versioning, release, and concurrent-read coverage.

Original-commit: a31e77427e
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
@0ax1
0ax1 force-pushed the ad/cuda-file-mapping-cache branch from a149621 to 34a45d9 Compare October 23, 2026 17:13

This branch has not been deployed

No deployments
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