Skip to content

[SYCLomatic] Add migration support for cudaKernelNodeParams, cudaKernelAddKernelNode, cudaGraphKernelNodeSetParams, cudaKernelNodeGetParams #2803

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

Open
wants to merge 19 commits into
base: SYCLomatic
Choose a base branch
from

Conversation

daiyaan-ahmed6
Copy link
Contributor

No description provided.

@daiyaan-ahmed6 daiyaan-ahmed6 requested a review from a team as a code owner April 24, 2025 01:52
Signed-off-by: Daiyaan Ahmed <[email protected]>
Signed-off-by: Daiyaan Ahmed <[email protected]>
Signed-off-by: Daiyaan Ahmed <[email protected]>
Signed-off-by: Daiyaan Ahmed <[email protected]>
@daiyaan-ahmed6 daiyaan-ahmed6 changed the title Graph kernel params [SYCLomatic] Add migration support for cudaKernelNodeParams, cudaKernelAddKernelNode, cudaGraphKernelNodeSetParams, cudaKernelNodeGetParams Apr 28, 2025
Signed-off-by: Daiyaan Ahmed <[email protected]>
Signed-off-by: Daiyaan Ahmed <[email protected]>
Signed-off-by: Daiyaan Ahmed <[email protected]>
Signed-off-by: Daiyaan Ahmed <[email protected]>
Signed-off-by: Ahmed, Daiyaan <[email protected]>
Signed-off-by: Ahmed, Daiyaan <[email protected]>
Signed-off-by: Ahmed, Daiyaan <[email protected]>
Signed-off-by: Ahmed, Daiyaan <[email protected]>
Signed-off-by: Ahmed, Daiyaan <[email protected]>
dpct::experimental::node_ptr *dependencies,
std::size_t numberOfDependencies,
dpct::experimental::kernel_node_params *params) {
node_graph_params_map[*node] = std::make_pair(graph, params);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why need to save graph, I don't see the usage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Launch, we need to add the nodes to the graph using the graph.add({}); API


void instantiate(dpct::experimental::command_graph_exec_ptr *execGraph,
dpct::experimental::command_graph_ptr graph) {
exec_graph_map[*execGraph] = graph;
Copy link
Contributor

Choose a reason for hiding this comment

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

execGraph is an out param, needs to be created in the function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

execGraph cannot be created as a new node until cudaGraphLaunch. Do you recommend to create a fake node to return?

// Retrieve the graph associated with execGraph
auto graph = exec_graph_map[execGraph];
auto &kernel_params_vector = graph_kernel_node_params_map[graph];
for (std::size_t i = 0; i < kernel_params_vector.size(); i++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why add the kernel nodes when launch, not on add_kernel_node called?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

During add_kernel_node we do not have queue information. Queue information is needed to launch a host task on graph. So This PR adds the nodes in a vector during add_kernel_node and actually adds them to the graph during launch.

auto next_dependency = next_node_params->get_dependencies()[i];
next_node_params->update_dependency(next_dependency, new_node);
}
node_kernel_params_pair.first = new_node;
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is the usage of new_node?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new_node is created and then assigned to the pointer address of the node passed in add_kernel_node

Signed-off-by: Ahmed, Daiyaan <[email protected]>
Signed-off-by: Ahmed, Daiyaan <[email protected]>
Signed-off-by: Ahmed, Daiyaan <[email protected]>
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.

2 participants