Skip to content

Fix CUDA plugin user stream test lifetime - #32449

Merged
Tianlei Wu (tianleiwu) merged 2 commits into
mainfrom
copilot/fix-cuda-plugin-segfault
Sep 8, 2026
Merged

Tianlei Wu (tianleiwu) merged 2 commits into
mainfrom
copilot/fix-cuda-plugin-segfault

Conversation

Copilot AI commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Description

  • Destroy CUDA graph sessions before their caller-owned streams.
  • Apply the corrected lifetime ordering to capture/replay and graph annotation tests.

Motivation and Context

CaptureAndReplayOnUserStream segfaulted after stream teardown began draining arena state. The tests destroyed the user stream before the session, violating the required lifetime ordering.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CUDA plugin segfault in CaptureAndReplayOnUserStream Fix CUDA plugin user stream test lifetime Sep 5, 2026
@tianleiwu
Tianlei Wu (tianleiwu) marked this pull request as ready for review September 5, 2026 06:06
Copilot AI balanced review requested due to automatic review settings September 5, 2026 06:06

Copilot AI 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.

🟢 Approval recommended

The lifetime ordering is corrected, with no unresolved issues found.

Pull request overview

Ensures caller-owned CUDA streams outlive the graph sessions that use them, preventing teardown crashes.

Changes:

  • Scope capture/replay and graph-annotation sessions so they are destroyed before their user streams.
File summaries
File Description
onnxruntime/test/providers/cuda/plugin/cuda_plugin_user_stream_graph_test.cc Corrects session and stream destruction order.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@tianleiwu
Tianlei Wu (tianleiwu) enabled auto-merge (squash) September 5, 2026 07:50
@xadupre

Copy link
Copy Markdown
Member

Copilot fix lint

Copilot AI commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Copilot fix lint

Targeted lintrunner and clang-format checks pass with no source changes needed. The failed CI Lint run was the Optional Lint misspell container failing to fetch a Debian package (HTTP 404), not a repository lint violation.

@tianleiwu
Tianlei Wu (tianleiwu) merged commit 9f913ae into main Sep 8, 2026
91 of 92 checks passed
@tianleiwu
Tianlei Wu (tianleiwu) deleted the copilot/fix-cuda-plugin-segfault branch September 8, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CUDA plugin segfault in CaptureAndReplayOnUserStream after #31983

5 participants