-
Notifications
You must be signed in to change notification settings - Fork 369
Revert "Support fp8 types in hiprtc" #3792
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -24,13 +24,14 @@ THE SOFTWARE. | |||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| #pragma once | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| #if !defined(__HIPCC_RTC__) | ||||||||||||||||||||||||||
| #include "amd_hip_common.h" | ||||||||||||||||||||||||||
| #include "host_defines.h" | ||||||||||||||||||||||||||
| #include "amd_hip_ocp_types.h" | ||||||||||||||||||||||||||
| #include "amd_hip_bf16.h" | ||||||||||||||||||||||||||
| #include "amd_hip_ocp_host.hpp" | ||||||||||||||||||||||||||
| #include <hip/amd_detail/amd_hip_bf16.h> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| #if !defined(__HIPCC_RTC__) | ||||||||||||||||||||||||||
| #include <hip/amd_detail/amd_hip_common.h> | ||||||||||||||||||||||||||
| #include <hip/amd_detail/host_defines.h> | ||||||||||||||||||||||||||
| #include <hip/amd_detail/amd_hip_ocp_types.h> | ||||||||||||||||||||||||||
| #include <hip/hip_fp16.h> | ||||||||||||||||||||||||||
| #include <hip/hip_bf16.h> | ||||||||||||||||||||||||||
| #include <climits> | ||||||||||||||||||||||||||
| #include <cstdio> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
@@ -40,6 +41,8 @@ static_assert(sizeof(uint32_t) * CHAR_BIT == 32); | |||||||||||||||||||||||||
| static_assert(sizeof(uint64_t) * CHAR_BIT == 64); | ||||||||||||||||||||||||||
| #endif // !defined(__HIPCC_RTC__) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| #include <hip/amd_detail/amd_hip_ocp_host.hpp> // Host Conversion | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // HW Detection | ||||||||||||||||||||||||||
| #if defined(__gfx950__) | ||||||||||||||||||||||||||
|
Comment on lines
42
to
47
|
||||||||||||||||||||||||||
| #endif // !defined(__HIPCC_RTC__) | |
| #include <hip/amd_detail/amd_hip_ocp_host.hpp> // Host Conversion | |
| // HW Detection | |
| #if defined(__gfx950__) | |
| #include <hip/amd_detail/amd_hip_ocp_host.hpp> // Host Conversion | |
| #endif // !defined(__HIPCC_RTC__) | |
| // HW Detection | |
| #if defined(__gfx950__) | |
| #if defined(__gfx950__) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,21 +24,11 @@ THE SOFTWARE. | |
|
|
||
| #pragma once | ||
|
|
||
| #if defined(__HIPCC_RTC__) | ||
| #define __OCP_FP_HOST__ | ||
| #define __OCP_FP_DEVICE__ __device__ | ||
| #define __OCP_FP_HOST_DEVICE__ __OCP_FP_HOST__ __OCP_FP_DEVICE__ | ||
| #define __OCP_FP_DEVICE_STATIC__ __OCP_FP_DEVICE__ static __inline__ __attribute__((always_inline)) | ||
| #define __OCP_FP_HOST_DEVICE_STATIC__ __OCP_FP_HOST_DEVICE__ static | ||
| #else | ||
| #include "host_defines.h" | ||
|
|
||
| #define __OCP_FP_HOST__ __host__ | ||
| #define __OCP_FP_DEVICE__ __device__ | ||
| #define __OCP_FP_HOST_DEVICE__ __OCP_FP_HOST__ __OCP_FP_DEVICE__ | ||
| #define __OCP_FP_DEVICE_STATIC__ __OCP_FP_DEVICE__ static __inline__ __attribute__((always_inline)) | ||
| #define __OCP_FP_HOST_DEVICE_STATIC__ __OCP_FP_HOST_DEVICE__ static | ||
|
Comment on lines
27
to
31
|
||
| #endif | ||
|
|
||
| static_assert(sizeof(unsigned int) == 4, ""); | ||
| static_assert(sizeof(float) == 4, ""); | ||
|
|
@@ -54,17 +44,17 @@ static_assert(sizeof(_Float16) == 2, ""); | |
| // header which will act as a base abstraction, and will be maintained in the future, it makes sense | ||
| // to keep these vector types separate from existing implementations. We can add conversion | ||
| // functions in a different header using these functions. | ||
| typedef __hip_uint8_t __amd_fp8_storage_t; | ||
| typedef __hip_uint16_t __amd_fp8x2_storage_t; | ||
| typedef __hip_uint8_t __amd_fp4x2_storage_t; | ||
| typedef __hip_uint32_t __amd_fp4x8_storage_t; | ||
| typedef uint8_t __amd_fp8_storage_t; | ||
| typedef uint16_t __amd_fp8x2_storage_t; | ||
| typedef uint8_t __amd_fp4x2_storage_t; | ||
| typedef uint32_t __amd_fp4x8_storage_t; | ||
| typedef __bf16 __amd_bf16_storage_t; | ||
| typedef _Float16 __amd_fp16_storage_t; | ||
| typedef __hip_int8_t __amd_scale_t; | ||
| typedef int8_t __amd_scale_t; | ||
|
Comment on lines
+47
to
+53
|
||
|
|
||
| #if defined(__clang__) && (__clang_major__ > 17) && defined(__HIP__) | ||
| typedef unsigned int __attribute__((ext_vector_type(2))) __amd_uintx2_storage_t; | ||
| typedef __hip_uint8_t __attribute__((ext_vector_type(8))) __amd_fp8x8_storage_t; | ||
| typedef uint8_t __attribute__((ext_vector_type(8))) __amd_fp8x8_storage_t; | ||
|
||
| typedef __bf16 __attribute__((ext_vector_type(2))) __amd_bf16x2_storage_t; | ||
| typedef __bf16 __attribute__((ext_vector_type(8))) __amd_bf16x8_storage_t; | ||
| typedef __bf16 __attribute__((ext_vector_type(32))) __amd_bf16x32_storage_t; | ||
|
|
@@ -75,7 +65,7 @@ typedef float __attribute__((ext_vector_type(32))) __amd_floatx32_storage_t; | |
| typedef _Float16 __attribute__((ext_vector_type(2))) __amd_fp16x2_storage_t; | ||
| typedef _Float16 __attribute__((ext_vector_type(8))) __amd_fp16x8_storage_t; | ||
| typedef _Float16 __attribute__((ext_vector_type(32))) __amd_fp16x32_storage_t; | ||
| typedef __hip_uint32_t __attribute__((ext_vector_type(6))) __amd_fp6x32_storage_t; | ||
| typedef uint32_t __attribute__((ext_vector_type(6))) __amd_fp6x32_storage_t; | ||
|
||
| typedef short __attribute__((ext_vector_type(2))) __amd_shortx2_storage_t; | ||
| #elif defined(__GNUC__) && (__GNUC__ > 13) | ||
| /* GCC expects vector size in bytes */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment indicates amd_hip_ocp_host.hpp is for host conversions, but it is now included unconditionally (including under HIPCC_RTC). If this header is host-only (or pulls in host-only dependencies), it should remain inside the !defined(HIPCC_RTC) block, or be made explicitly RTC-safe to keep include intent clear and avoid RTC build issues.