Skip to content

Fix amd_ck_fp8.hpp macro definitions #2325

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 8 commits into
base: develop
Choose a base branch
from
Open

Fix amd_ck_fp8.hpp macro definitions #2325

wants to merge 8 commits into from

Conversation

xli
Copy link

@xli xli commented Jun 10, 2025

Proposed changes

  1. Remove CK_USE_FNUZ_FP8 and CK_USE_OCP_FP8 definitions, they are default behavior of preprocessor before compilation. Undefined macro is replaced with 0 when used in #if. In rocm 6.4, there is include/ck/config.h header file defines both CK_USE_FNUZ_FP8 and CK_USE_OCP_FP8 as ON, the current definition inside amd_ck_fp8.hpp will cause macro-redefined error.
  2. Prefix __assert_fnuz_support and __assert_ocp_support with namespace fp8_impl to avoid redefined error when building with rocm 6.4 (include/hip/amd_detail/amd_hip_fp8.h)

Checklist

Please put an x into the boxes that apply. You can also fill these out after creating the PR. If you're not sure, please don't hesitate to ask.

  • I have added tests relevant to the introduced functionality, and the unit tests are passing locally
  • I have added the test to REGRESSION_TESTS list defined at the top of CMakeLists.txt in tests/CMakeLists.txt, IF the test takes more than 30 seconds to run.
  • I have added inline documentation which enables the maintainers with understanding the motivation
  • I have removed the stale documentation which is no longer relevant after this pull request
  • (If this change is user-facing) I have added release notes which provide the end users with a brief summary of the improvement from this pull request
  • I have run clang-format on all changed files
  • Any dependent changes have been merged

1. Remove CK_USE_FNUZ_FP8 and CK_USE_OCP_FP8 definitions, they are
   default behavior of preprocessor before compilation. Undefined macro
   is replaced with 0 when used in #if.
   In rocm 6.4, there is rocm/6.4.0/include/ck/config.h header file
   defines both CK_USE_FNUZ_FP8 and CK_USE_OCP_FP8, the current
   definition inside amd_ck_fp8.hpp will cause macro-redefined error.
2. Prefix __assert_fnuz_support and __assert_ocp_support with namespace
   fp8_impl to avoid redefined error when building with rocm 6.4+
   (rocm/6.4.0/include/hip/amd_detail/amd_hip_fp8.h)
xli and others added 4 commits June 11, 2025 11:03
1. Remove CK_USE_FNUZ_FP8 and CK_USE_OCP_FP8 definitions, they are
   default behavior of preprocessor before compilation. Undefined macro
   is replaced with 0 when used in #if.
   In rocm 6.4, there is rocm/6.4.0/include/ck/config.h header file
   defines both CK_USE_FNUZ_FP8 and CK_USE_OCP_FP8, the current
   definition inside amd_ck_fp8.hpp will cause macro-redefined error.
2. Prefix __assert_fnuz_support and __assert_ocp_support with namespace
   fp8_impl to avoid redefined error when building with rocm 6.4+
   (rocm/6.4.0/include/hip/amd_detail/amd_hip_fp8.h)
@andriy-ca
Copy link
Contributor

@xli , do you have a reproducer for the issue?

The originally proposed changes did not pass our CI. Could you verify the latest commit? 92fcbea

@xli
Copy link
Author

xli commented Jun 13, 2025

@xli , do you have a reproducer for the issue?

The originally proposed changes did not pass our CI. Could you verify the latest commit? 92fcbea

this works for me.

@xli
Copy link
Author

xli commented Jun 17, 2025

@andriy-ca what is broken now?

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