Repository navigation
fix(cuda): Preserve CUDA buffer alignment metadata during upload - #11329
Merged
Merged
Conversation
Preserve source alignment after host-to-device uploads without an additional data copy. Report unsupported pointer alignment as an error and reduce alignment metadata when slicing device buffers. Add regression coverage for async and synchronous decimal uploads, metadata-only alignment updates, and sliced buffers. Signed-off-by: Alexander Droste <[email protected]>
Signed-off-by: Alexander Droste <[email protected]>
Contributor
Author
|
fixes: #11303 |
0ax1
enabled auto-merge (squash)
November 9, 2026 11:43
0ax1
disabled auto-merge
November 9, 2026 11:43
robert3005
approved these changes
Nov 9, 2026
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.
Summary
Preserve alignment metadata when uploading host buffers through
ensure_on_deviceand its synchronous variant. Uploading a typed buffer asbytes currently reduces its recorded alignment to one byte, even when the
CUDA allocation satisfies the original alignment. This causes decimal
reconstruction to reject otherwise valid device buffers, as exposed by the
Widen tests in #11303.
Restore the source alignment with a metadata-only update after the existing
upload. No additional data copy, device allocation, or synchronization is
introduced for alignment.
Changes
Already-device buffers remain unchanged.
offset. Requests above 256 bytes remain supported when the address
satisfies them.
satisfy the requested alignment. Uploads now explicitly fail if the source
alignment cannot be preserved.
retaining an invalid stronger guarantee.
uploads, both upload paths, already-device identity, and metadata-only
alignment updates.