-
Couldn't load subscription status.
- Fork 217
fix: allow cuStreamBeginCaptureToGraph argument dependencyData to be optional #1188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Greptile Summary
This PR fixes a parameter validation bug in the cuStreamBeginCaptureToGraph binding. The function accepts an optional dependencyData parameter that can be None according to the CUDA API specification, but the implementation was incorrectly enforcing a length check against numDependencies for this optional parameter. The removed validation line (37008) was causing RuntimeErrors when users legitimately passed None for dependencyData. The fix removes this incorrect validation while preserving the necessary length check for the required dependencies parameter. This change aligns the Python bindings in cuda_bindings with the CUDA driver API specification and resolves issue #617.
Important Files Changed
| Filename | Score | Overview |
|---|---|---|
| cuda_bindings/cuda/bindings/driver.pyx.in | 5/5 | Removed incorrect validation for optional dependencyData parameter in cuStreamBeginCaptureToGraph function |
Confidence score: 5/5
- This PR is safe to merge with minimal risk
- Score reflects a straightforward bug fix that removes incorrect validation logic for an optional parameter without introducing new complexity or side effects; the change correctly aligns the bindings with CUDA API semantics
- No files require special attention
Sequence Diagram
sequenceDiagram
participant User
participant "Python Binding" as Binding
participant "CUDA Driver API" as CUDA
participant "GPU Stream" as Stream
participant "CUDA Graph" as Graph
User->>Binding: "cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies, dependencyData, numDependencies, mode)"
Note over User,Binding: dependencyData can now be None/optional
Binding->>Binding: "Validate parameters"
alt dependencyData is None
Binding->>CUDA: "cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies, NULL, numDependencies, mode)"
else dependencyData is provided
Binding->>CUDA: "cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies, dependencyData, numDependencies, mode)"
end
CUDA->>Stream: "Begin capture mode"
Stream->>Graph: "Capture operations to graph"
CUDA-->>Binding: "Return CUDA result"
Binding-->>User: "Return result or raise exception"
1 file reviewed, no comments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes #617.