feat: opt-in host-to-device copy for aisio-cpu/posix - #13
Merged
Conversation
naddinadja
previously approved these changes
Aug 5, 2026
naddinadja
left a comment
Collaborator
There was a problem hiding this comment.
I have some questions, but nothing blocking
Add a copy_to_gpu option (--copy-to-gpu) that copies each file from host to device memory after reading. On the aisio-cpu path it allocates a parallel GPU buffer per host DMA buffer and issues one cudaMemcpy H->D per file after the reads drain, timed as part of io_time, and presents the GPU buffers as the iterator output. On the posix path it gates the existing host->device copy behind the same flag. This exposes the host-to-device transfer that aisio-p2p avoids, making the advantage of the P2P path clear. Signed-off-by: Karl Bonde Torp <k.torp@samsung.com>
Wire the boolean fil_opts fields that the C library already supported but the Python init() did not: buffered, async, register_bufs and the new copy_to_gpu. 'async' is a reserved word in Python, so it is exposed under the keyword 'async_'. Signed-off-by: Karl Bonde Torp <k.torp@samsung.com>
Signed-off-by: Karl Bonde Torp <k.torp@samsung.com>
karlowich
force-pushed
the
feat/copy-to-gpu
branch
from
August 5, 2026 11:43
248343c to
2cbc8a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
--copy-to-gpuoption that copies each file from host to devicememory after reading, so the host-to-device transfer that
aisio-p2pavoids is measured explicitly — making the P2P advantage visible in
benchmarks.
issues one
cudaMemcpyH -> D per file once the batch's reads drain. Thecopy is counted in
io_time, and the GPU buffers are presented as theiterator output (GPU-resident, like
aisio-p2p).Also wires the previously-unreachable boolean
fil_optsfields into thePython binding:
buffered,async(exposed asasync_, sinceasyncis a reserved word in Python),
register_bufs, andcopy_to_gpu.Note: The POSIX path previously always copied to GPU. It now only copies
when
--copy-to-gpuis passed (default off, symmetric withaisio-cpu).