Skip to content

Add HIP/ROCm support to cuda_kernel_launch_stats#321

Open
1274085042 wants to merge 1 commit intofacebookresearch:mainfrom
1274085042:add-hip-support-kernel-launch-stats
Open

Add HIP/ROCm support to cuda_kernel_launch_stats#321
1274085042 wants to merge 1 commit intofacebookresearch:mainfrom
1274085042:add-hip-support-kernel-launch-stats

Conversation

@1274085042
Copy link
Copy Markdown

@1274085042 1274085042 commented Mar 11, 2026

Add support for HIP runtime events (hipLaunchKernel, hipLaunchKernelExC, hipMemcpyAsync, hipMemsetAsync) in cuda_kernel_launch_stats method, enabling kernel launch statistics analysis for ROCm/HIP traces.

Changes:

  • Add HIP symbol lookups alongside existing CUDA symbols
  • Include hipLaunchKernel/hipLaunchKernelExC in launch_ids
  • Include hipMemcpyAsync/hipMemsetAsync in memory event filtering
  • Use isin() for memory event filtering (cleaner, handles None safely)
  • Add comprehensive unit tests (9 test cases) covering:
    • HIP launch kernel events
    • HIP memory events (include/exclude)
    • Mixed CUDA+HIP traces
    • Pure ROCm traces (no CUDA symbols)
    • Negative launch delay clipping
    • Multiple ranks
    • Empty trace handling

Add support for HIP runtime events (hipLaunchKernel, hipLaunchKernelExC,
hipMemcpyAsync, hipMemsetAsync) in cuda_kernel_launch_stats method, enabling
kernel launch statistics analysis for ROCm/HIP traces.

Changes:
- Add HIP symbol lookups alongside existing CUDA symbols
- Include hipLaunchKernel/hipLaunchKernelExC in launch_ids
- Include hipMemcpyAsync/hipMemsetAsync in memory event filtering
- Use isin() for memory event filtering (cleaner, handles None safely)
- Add comprehensive unit tests (9 test cases) covering:
  - HIP launch kernel events
  - HIP memory events (include/exclude)
  - Mixed CUDA+HIP traces
  - Pure ROCm traces (no CUDA symbols)
  - Negative launch delay clipping
  - Multiple ranks
  - Empty trace handling"'
@meta-cla
Copy link
Copy Markdown

meta-cla bot commented Mar 11, 2026

Hi @1274085042!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla
Copy link
Copy Markdown

meta-cla bot commented Mar 12, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 12, 2026
@1274085042
Copy link
Copy Markdown
Author

Hi @firoz1905 @fengxizhou,

CLA has been signed. This PR adds HIP/ROCm support to cuda_kernel_launch_stats, enabling kernel launch statistics
for ROCm/HIP traces. Would appreciate your review when you have time. Thanks!

@1274085042
Copy link
Copy Markdown
Author

Hi @fengxizhou @sanrise, could you please review this PR when you have a chance? It adds HIP/ROCm support to cuda_kernel_launch_stats, enabling kernel launch statistics analysis for ROCm/HIP traces.
Comprehensive unit tests are included. Thanks!

@1274085042
Copy link
Copy Markdown
Author

Hi @albanD , could you please review this PR when you have a chance? It adds HIP/ROCm support to cuda_kernel_launch_stats, enabling kernel launch statistics analysis for ROCm/HIP traces.
Comprehensive unit tests are included. Thanks!

@albanD
Copy link
Copy Markdown
Contributor

albanD commented Mar 25, 2026

I don't think I have review rights on this repo.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: rocm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants