Skip to content

HIP: bug fixes and optimizations#9635

Merged
chvamshi-xilinx merged 1 commit intoXilinx:masterfrom
svup-xilinx:HIPGraphOpt
Mar 2, 2026
Merged

HIP: bug fixes and optimizations#9635
chvamshi-xilinx merged 1 commit intoXilinx:masterfrom
svup-xilinx:HIPGraphOpt

Conversation

@svup-xilinx
Copy link
Collaborator

Problem solved by the commit

bug fixes and optimizations

  • Remove the kernelParams null check in hip_module_launch_kernel(). kernelParams is allowed to be null for kernels that take no parameters.
  • Set the command state to init before submitting each node so executable graphs can be replayed.
  • Use single loop: set stream, wait on deps, then submit/enqueue in one pass
  • Use static_pointer_cast for event commands after get_type() check
  • Cache command type in cmd_type to avoid repeated get_type() calls

Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered

hip_module_launch_kernel() rejected null kernelParams even though kernels with no parameters are allowed to pass null.
Command state was not reset before submitting, so executable graphs could not be replayed after the first run.

How problem was solved, alternative solutions (if any) and why they were rejected

The null check on kernelParams was removed in hip_module_launch_kernel() so kernels with no parameters can be launched with kernelParams == nullptr.
Before submitting each node in graph_exec::execute(), the command’s state is set to command::state::init, so the same graph executable can be run again.

Risks (if any) associated the changes in the commit

Low

What has been tested and how, request additional testing if necessary

Tested with test cases that has kernelParams == nullptr and repeated launch of executable graph

Documentation impact (if any)

NA

- Remove the kernelParams null check in hip_module_launch_kernel(). kernelParams
  is allowed to be null for kernels that take no parameters.
- Set the command state to init before submitting each node so executable
  graphs can be replayed.
- Use single loop: set stream, wait on deps, then submit/enqueue in one pass
- Use static_pointer_cast for event commands after get_type() check
- Cache command type in cmd_type to avoid repeated get_type() calls

Signed-off-by: Srikanth Vuppala <120363307+svup-xilinx@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

clang-tidy review says "All clean, LGTM! 👍"

@chvamshi-xilinx chvamshi-xilinx merged commit 53aecac into Xilinx:master Mar 2, 2026
21 checks passed
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