Skip to content

cudax/stf: cuda_try migration — graph misc (PR6)#9301

Open
andralex wants to merge 6 commits into
NVIDIA:mainfrom
andralex:andralex/stf-cuda-try-graph-misc
Open

cudax/stf: cuda_try migration — graph misc (PR6)#9301
andralex wants to merge 6 commits into
NVIDIA:mainfrom
andralex:andralex/stf-cuda-try-graph-misc

Conversation

@andralex

@andralex andralex commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Migrate the three leaf graph/ headers from cuda_safe_call to templated cuda_try<>:
    • graph/internal/event_types.cuhcudaGraphAddEmptyNode
    • graph/interfaces/void_interface.cuhcudaGraphAddEmptyNode
    • graph/interfaces/slice.cuhcudaGraphAddMemcpyNode
  • Part of the staged STF cuda_safe_callcuda_try migration (PR6 of 11).

Test plan

  • Local build: ninja -j 12 -C build/cudax-cpp20 cudax.test.stf.graph.explicit_graph cudax.test.stf.interface.graph_use_device_data
  • CI

Convert the three remaining leaf graph headers (event_types, void_interface,
slice) to templated cuda_try for graph node creation calls.
@andralex andralex requested a review from a team as a code owner June 8, 2026 22:40
@andralex andralex requested a review from srinivasyadav18 June 8, 2026 22:40
@copy-pr-bot

copy-pr-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

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.

@github-project-automation github-project-automation Bot moved this to Todo in CCCL Jun 8, 2026
@andralex

andralex commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test b854c6c

@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Jun 8, 2026
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 11c35592-3ac1-48c3-b445-2398f8fc6516

📥 Commits

Reviewing files that changed from the base of the PR and between 4960c0b and fc48d74.

📒 Files selected for processing (3)
  • cudax/include/cuda/experimental/__stf/graph/interfaces/slice.cuh
  • cudax/include/cuda/experimental/__stf/graph/interfaces/void_interface.cuh
  • cudax/include/cuda/experimental/__stf/graph/internal/event_types.cuh
🚧 Files skipped from review as they are similar to previous changes (3)
  • cudax/include/cuda/experimental/__stf/graph/interfaces/void_interface.cuh
  • cudax/include/cuda/experimental/__stf/graph/interfaces/slice.cuh
  • cudax/include/cuda/experimental/__stf/graph/internal/event_types.cuh

Note: CodeRabbit is enabled on this repository as a convenience for maintainers
and contributors. Use your best judgment when considering its review comments and
suggestions — a suggested change may be inadequate, unnecessary, or safe to ignore.
Contributors are not expected to address every comment. Human reviews are what
ultimately matter for merging.

Overview

This PR continues the staged migration of the STF (Stateful Task Framework) from cuda_safe_call to the templated cuda_try<> for CUDA API error handling. This is part 6 of an 11-PR migration series.

Changes

Three leaf headers in the graph module were updated to use cuda_try<> and now directly include the header that defines cuda_try (instead of relying on transitive includes):

  • cudax/include/cuda/experimental/__stf/graph/internal/event_types.cuh

    • In graph_event_impl::factorize (path for events.size() > 16) the empty-node creation now assigns the node via cuda_try(...) and the cudaGraphNode_t is initialized to nullptr before use (avoids -Werror=maybe-uninitialized).
    • Lines changed: +3/-2
  • cudax/include/cuda/experimental/__stf/graph/interfaces/void_interface.cuh

    • In void_graph_interface::graph_data_copy, the empty-node creation now directly returns cuda_try(...) instead of using a temporary cudaGraphNode_t with cuda_safe_call.
    • Lines changed: +2/-3
  • cudax/include/cuda/experimental/__stf/graph/interfaces/slice.cuh

    • In slice_graph_interface::graph_data_copy, the CUDA memcpy node addition now returns the result of cuda_try(...) directly, replacing the prior local cudaGraphNode_t + cuda_safe_call pattern.
    • Lines changed: +2/-4

No public API signatures were changed.

Commits / Notes

  • Single commit: ensure each modified graph header directly includes the cuda_try utility and initialize out-parameter handles where needed to prevent -Werror=maybe-uninitialized.

Testing

Local build tested (ninja -j 12 -C build/cudax-cpp20) for:

  • cudax.test.stf.graph.explicit_graph
  • cudax.test.stf.interface.graph_use_device_data

CI validation pending.

Repository discussion

  • Three automated test-trigger comments by the author:
  • PR note includes reviewer username context: "Your username is coderabbitai."

suggestion:

Walkthrough

Three CUDA Graph node creation sites switch from the out-parameter cuda_safe_call(cudaGraphAdd*Node(&node,...)) pattern to returning node handles directly via cuda_try<cudaGraphAdd*Node>(...); headers now include cuda_safe_call.cuh and an event node variable is initialized to nullptr before assignment.

Changes

CUDA Graph Node Creation Error Handling

Layer / File(s) Summary
Migrate cuda_safe_call to cuda_try for graph node creation
cudax/include/cuda/experimental/__stf/graph/interfaces/slice.cuh, cudax/include/cuda/experimental/__stf/graph/interfaces/void_interface.cuh, cudax/include/cuda/experimental/__stf/graph/internal/event_types.cuh
cudaGraphAddMemcpyNode in slice interface, cudaGraphAddEmptyNode in void interface graph_data_copy, and cudaGraphAddEmptyNode in event factorization now return results directly via cuda_try<>; temporary out-parameter node variables were removed, headers now include cuda_safe_call.cuh, and the event-node handle is default-initialized to nullptr.

Possibly related PRs

  • NVIDIA/cccl#9165: Similar migration of graph node creation calls from cuda_safe_call(..., &node) to cuda_try<> returning cudaGraphNode_t.

Suggested reviewers

  • caugonnet

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: fdc337b9-f7f0-421f-9e74-7d7935334e50

📥 Commits

Reviewing files that changed from the base of the PR and between 2ca0829 and b854c6c.

📒 Files selected for processing (3)
  • cudax/include/cuda/experimental/__stf/graph/interfaces/slice.cuh
  • cudax/include/cuda/experimental/__stf/graph/interfaces/void_interface.cuh
  • cudax/include/cuda/experimental/__stf/graph/internal/event_types.cuh

Comment thread cudax/include/cuda/experimental/__stf/graph/interfaces/slice.cuh
andralex added 2 commits June 8, 2026 18:53
Initialize the out-parameter to nullptr before cuda_try<cudaGraphAddEmptyNode>
so GCC -Werror=maybe-uninitialized builds pass.
@andralex

andralex commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 4960c0b

Each header must directly include the utility that defines cuda_try
instead of relying on transitive includes.
@andralex

andralex commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test fc48d74

@github-actions

This comment has been minimized.

@andralex

andralex commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test fc48d74

@andralex

andralex commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 77bd508

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 1h 58m: Pass: 100%/55 | Total: 1d 00h | Max: 1h 04m | Hits: 15%/153894

See results here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants