Conversation
Sync launchers now accept impl KernelSliceArg and impl KernelSliceArgMut, matching the generic async slice contracts. RowWidth gains a defaulted buffer type parameter, so existing RowWidth::new(&mut c, n) calls remain unchanged. The slice traits are available without the async feature. Caller-defined views now typecheck through sync, async, and owned launchers. Retargets the launcher half of NVlabs#1081 and NVlabs#968. Signed-off-by: David Holtz <david.richard.holtz@gmail.com>
nihalpasham
requested changes
Sep 24, 2026
nihalpasham
left a comment
Collaborator
There was a problem hiding this comment.
I would reject this version. The interop goal is useful, but safe prepared launches need more than a pointer and length:
- These launchers enqueue work and return; the Rust borrow ends before the GPU necessarily finishes. The slice traits only promise validity for that borrow.
- The cudarc adapter drops its event guard before the launch and uses the read accessor for writable arguments. cudarc therefore cannot track oxide's reads/writes or wait for them before freeing on another stream.
- The example uses one default stream, which orders that example correctly. The generated safe API also accepts other streams, where that ordering is absent.
This needs a stream-aware use/lifetime contract, with read/write dependencies recorded around submission and storage kept valid through completion. An explicitly unsafe interop API could also be scoped separately. I haven't patched around the issue because it changes the abstraction itself.
The host and macro suites pass with default and all features. The example also needs a supported cudarc/toolkit selection: its normal check fails on CUDA 13.4 and passes with the CUDA 13.0 binding override.
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.
What this proposes
Allow generated sync launchers to accept custom
KernelSliceArg/KernelSliceArgMutimplementations in every slice position, including row-width arguments. Move the traits out of the async feature gate and demonstrate cudarc-owned memory.Review blocker
Safe prepared launches enqueue work without retaining the Rust borrow through device completion. The pointer/length traits do not tell an allocation owner which stream or access mode was used, so they cannot establish ordering and lifetime guarantees for a general third-party allocation.
The cudarc example uses one default stream. Its adapter drops cudarc's event guard before submission and does not track writes, so it does not establish a safe general adapter for other streams.
The current design is recommended for rejection. A follow-up needs a stream-aware use/lifetime contract or a separately scoped unsafe interop API.
Verification
Related: #968 and #1081.