Skip to content

Revert "Revert "Support fp8 types in hiprtc (#2605)" (#3792)" - #4727

Merged
cjatin merged 4 commits into
developfrom
revert-3792-users/jatin/support_fp8_hiprtc
Apr 23, 2026
Merged

Revert "Revert "Support fp8 types in hiprtc (#2605)" (#3792)"#4727
cjatin merged 4 commits into
developfrom
revert-3792-users/jatin/support_fp8_hiprtc

Conversation

@satyanveshd

Copy link
Copy Markdown
Contributor

This reverts commit be0675a (#3792)

This change was earlier reverted due to issues seen in MIOpen via the rocm-systems bump PR ROCm/TheRock#3754.

Now, MIOpen has fixed the issues using https://github.com/ROCm/rocm-libraries/pull/5235/changes.
So reverting the revert to bring back the support for fp8 types in hiprtc.

Motivation

Users should be able to include fp8 header in hiprtc code.

Technical Details

Fix some include issues in fp8 header.

JIRA ID

ROCM-864

Test Plan

Added an fp8 test for hiprtc, basically include it from HIP directory and use it in rtc code.

Test Result

The test basically hiprtc output of fp8 conversion round trip float to what we get on CPU.

Submission Checklist

@satyanveshd
satyanveshd requested review from a team as code owners April 6, 2026 08:45
Copilot AI review requested due to automatic review settings April 6, 2026 08:45

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.

Pull request overview

This PR reintroduces HIPRTC support for FP8-related types/headers (reverting a prior revert) and adds/updates HIPRTC tests and bundled header content to ensure FP8 can be used from RTC-compiled code.

Changes:

  • Add a new HIPRTC unit test exercising FP8 conversions.
  • Update the existing HIPRTC FP16 header test kernel string to align with current half/half2 operator behavior.
  • Extend the HIPRTC “builtins” header bundle to include FP8/BF16/OCP/MX headers and adjust related include guards.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
projects/hip-tests/catch/unit/rtc/hiprtc_fp8.cc Adds a new unit test intended to validate FP8 usage in hiprtc-compiled kernels.
projects/hip-tests/catch/unit/rtc/hiprtc_fp16_HeaderTst.cc Adjusts FP16 header test kernel string comparisons/expressions.
projects/clr/hipamd/src/hiprtc/CMakeLists.txt Adds FP8/BF16/OCP/MX headers to the HIPRTC builtins header list.
projects/clr/hipamd/src/hiprtc/cmake/HIPRTC.cmake Minor formatting cleanup in the macro file.
projects/clr/hipamd/include/hip/amd_detail/amd_hip_ocp_types.h Adds HIPRTC-specific macro handling and uses HIP internal integer typedefs.
projects/clr/hipamd/include/hip/amd_detail/amd_hip_ocp_fp.hpp Adjusts include strategy for HIPRTC/non-HIPRTC builds.
projects/clr/hipamd/include/hip/amd_detail/amd_hip_mx_common.h Avoids including certain headers under HIPRTC builds.
projects/clr/hipamd/include/hip/amd_detail/amd_hip_fp8.h Tweaks include guards/ordering for HIPRTC compatibility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread projects/hip-tests/catch/unit/rtc/hiprtc_fp16_HeaderTst.cc Outdated
Comment thread projects/hip-tests/catch/unit/rtc/hiprtc_fp8.cc
Comment thread projects/hip-tests/catch/unit/rtc/hiprtc_fp8.cc
Comment thread projects/clr/hipamd/include/hip/amd_detail/amd_hip_fp8.h Outdated
@cjatin
cjatin force-pushed the revert-3792-users/jatin/support_fp8_hiprtc branch from 9f5e648 to 2d34c2e Compare April 7, 2026 20:51
@satyanveshd
satyanveshd requested a review from chrispaquot April 10, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants