Skip to content

perf: prefer copy bandwidth over compute overlap for large batch memcpys - #2

Open
felipeblazing wants to merge 2 commits into
sirius-db:release/26.06from
felipeblazing:perf/memcpy-prefer-bandwidth
Open

perf: prefer copy bandwidth over compute overlap for large batch memcpys#2
felipeblazing wants to merge 2 commits into
sirius-db:release/26.06from
felipeblazing:perf/memcpy-prefer-bandwidth

Conversation

@felipeblazing

Copy link
Copy Markdown

cudf::detail::memcpy_batch_async unconditionally passed
cudaMemcpyFlagPreferOverlapWithCompute. That flag caps device-to-device
throughput at ~470 GB/s on GB300 regardless of copy size, while the default
flag reaches ~3.2 TB/s -- a 6.8x gap on the multi-GB buffer copies behind
cudf::concatenate's for_each_concatenate path.

The flag is not useless: for batches of small buffers the driver fuses the
copies far more effectively with it (213 GB/s vs 40 GB/s for 256 x 64 KiB), so
dropping it outright regresses the small-copy IO paths by up to 5x. Measured
crossover is ~1 MiB per copy and is nearly independent of the batch count, so
select on the mean bytes per copy with a 2 MiB threshold.

Host-device copies measured insensitive to the flag (within 1% pinned and
pageable at every size), so this only changes device-to-device behavior.

Also returns early on an empty batch, which the mean computation requires.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

cudf::detail::memcpy_batch_async unconditionally passed
cudaMemcpyFlagPreferOverlapWithCompute. That flag caps device-to-device
throughput at ~470 GB/s on GB300 regardless of copy size, while the default
flag reaches ~3.2 TB/s -- a 6.8x gap on the multi-GB buffer copies behind
cudf::concatenate's for_each_concatenate path.

The flag is not useless: for batches of small buffers the driver fuses the
copies far more effectively with it (213 GB/s vs 40 GB/s for 256 x 64 KiB), so
dropping it outright regresses the small-copy IO paths by up to 5x. Measured
crossover is ~1 MiB per copy and is nearly independent of the batch count, so
select on the mean bytes per copy with a 2 MiB threshold.

Host-device copies measured insensitive to the flag (within 1% pinned and
pageable at every size), so this only changes device-to-device behavior.

Also returns early on an empty batch, which the mean computation requires.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mike-wendt
mike-wendt force-pushed the release/26.06 branch 5 times, most recently from eb2e22f to d49c634 Compare August 21, 2026 19:39
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.

2 participants