Skip to content

fix: allow cuStreamBeginCaptureToGraph argument dependencyData to be optional - #1188

Merged
cpcloud merged 1 commit into
NVIDIA:mainfrom
cpcloud:make-dep-data-optional
Oct 24, 2025
Merged

fix: allow cuStreamBeginCaptureToGraph argument dependencyData to be optional#1188
cpcloud merged 1 commit into
NVIDIA:mainfrom
cpcloud:make-dep-data-optional

Conversation

@cpcloud

Copy link
Copy Markdown
Contributor

Closes#617.

@copy-pr-bot

Copy link
Copy Markdown
Contributor

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.

@cpcloud

Copy link
Copy Markdown
ContributorAuthor

/ok to test

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

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

FilenameScoreOverview
cuda_bindings/cuda/bindings/driver.pyx.in5/5Removed 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"
Loading

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@github-actions

Copy link
Copy Markdown

@mdboommdboom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cpcloud
cpcloud enabled auto-merge (squash) October 24, 2025 17:12
@cpcloud
cpcloud merged commit 9f1269b into NVIDIA:mainOct 24, 2025
64 checks passed
@rparolinrparolin added this to the cuda.core beta 8 milestone Oct 24, 2025
@leofangleofang added bug Something isn't working P1 Medium priority - Should do cuda.bindings Everything related to the cuda.bindings module to-be-backported Trigger the bot to raise a backport PR upon merge labels Oct 28, 2025
github-actionsBot pushed a commit that referenced this pull request Oct 28, 2025
@github-actions

Copy link
Copy Markdown

leofang pushed a commit that referenced this pull request Oct 29, 2025
…optional (#1188) (#1196)
(cherry picked from commit 9f1269b)
Co-authored-by: Phillip Cloud <417981+cpcloud@users.noreply.github.com>
github-actionsBot pushed a commit that referenced this pull request Nov 10, 2025
Removed preview folders for the following PRs:
- PR #1021
- PR #1034
- PR #1052
- PR #1059
- PR #1069
- PR #1086
- PR #1090
- PR #1096
- PR #1102
- PR #1103
- PR #1106
- PR #1107
- PR #1117
- PR #1133
- PR #1140
- PR #1166
- PR #1174
- PR #1185
- PR #1188
- PR #1191
... and 41 more
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugSomething isn't workingcuda.bindingsEverything related to the cuda.bindings moduleP1Medium priority - Should doto-be-backportedTrigger the bot to raise a backport PR upon merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: cuStreamBeginCaptureToGraph dependencyData should be optional

4 participants

@cpcloud@mdboom@rparolin@leofang