Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@github-actions
Copy link

Description

Backport of #1188 to 12.9.x.

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Oct 28, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@leofang leofang added bug Something isn't working P1 Medium priority - Should do cuda.bindings Everything related to the cuda.bindings module labels Oct 28, 2025
@leofang leofang added this to the cuda-python 13-next, 12-next milestone Oct 28, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 backports a fix from #1188 to the 12.9.x branch that makes the dependencyData argument optional in the cuStreamBeginCaptureToGraph function binding. The change removes a runtime validation check that previously enforced dependencyData to contain at least numDependencies elements. This modification aligns the Python binding with the underlying CUDA API specification, where dependencyData can be NULL (None in Python) when numDependencies is 0 or when no dependencies need to be specified. The change affects the driver bindings layer in cuda_bindings/cuda/bindings/driver.pyx.in, which is a Cython template file that generates the low-level Python-to-CUDA interface.

Important Files Changed

Filename Score Overview
cuda_bindings/cuda/bindings/driver.pyx.in 1/5 Removes length validation for dependencyData parameter without visible context for null-safety handling

Confidence score: 0/5

  • This PR cannot be evaluated for safety without access to the complete file context showing parameter initialization, null-checking, and the underlying C API call
  • Score reflects the complete absence of file contents needed to verify that removing the length check doesn't introduce null pointer dereferences, buffer overruns, or incorrect behavior when dependencyData is None/NULL
  • Critical attention required: the entire change in cuda_bindings/cuda/bindings/driver.pyx.in must be reviewed with full file context, including how the function validates None values, initializes pointers, and passes arguments to the underlying CUDA C API

Sequence Diagram

sequenceDiagram
    participant User
    participant "Python Application" as App
    participant "driver.pyx.in" as Driver
    participant "CUDA Driver API" as CUDA

    User->>App: "Call cuStreamBeginCaptureToGraph()"
    App->>Driver: "cuStreamBeginCaptureToGraph(stream, graph, dependencies, dependencyData, ...)"
    alt dependencyData is None
        Driver->>Driver: "Set dependencyData to optional/default"
    else dependencyData is provided
        Driver->>Driver: "Use provided dependencyData"
    end
    Driver->>CUDA: "Forward call with processed arguments"
    CUDA-->>Driver: "Return status"
    Driver-->>App: "Return result"
    App-->>User: "Stream capture begun"
Loading

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@leofang
Copy link
Member

leofang commented Oct 28, 2025

/ok to test cd586e8

@leofang leofang merged commit b45bf89 into 12.9.x Oct 29, 2025
51 checks passed
@leofang leofang deleted the backport-1188-to-12.9.x branch October 29, 2025 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cuda.bindings Everything related to the cuda.bindings module P1 Medium priority - Should do

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants