Revert "Revert "Support fp8 types in hiprtc (#2605)" (#3792)" - #4727
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.
cjatin
force-pushed
the
revert-3792-users/jatin/support_fp8_hiprtc
branch
from
April 7, 2026 14:52
b4c71e8 to
83316cc
Compare
cjatin
force-pushed
the
revert-3792-users/jatin/support_fp8_hiprtc
branch
from
April 7, 2026 16:20
83316cc to
9f5e648
Compare
cjatin
force-pushed
the
revert-3792-users/jatin/support_fp8_hiprtc
branch
from
April 7, 2026 20:51
9f5e648 to
2d34c2e
Compare
cjatin
approved these changes
Apr 14, 2026
gandryey
approved these changes
Apr 22, 2026
cjatin
force-pushed
the
revert-3792-users/jatin/support_fp8_hiprtc
branch
from
April 23, 2026 15:00
1e2dca8 to
f814fa2
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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