File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
experimental/gen_ai/src/quantize Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -89,16 +89,25 @@ namespace fbgemm_gpu {
89
89
// outputs are of size float[D]
90
90
91
91
#if (defined(USE_ROCM) && ROCM_VERSION >= 60200)
92
+ #if HIP_FP8_TYPE_OCP
93
+ using __nv_fp8x4_e4m3 = __hip_fp8x4_e4m3;
94
+ using __nv_fp8x2_e4m3 = __hip_fp8x2_e4m3;
95
+ using __nv_fp8_e4m3 = __hip_fp8_e4m3;
96
+ using __nv_fp8_e5m2 = __hip_fp8_e5m2;
97
+ #define torch_fp8_e4m3 at::kFloat8_e4m3fn
98
+ #define torch_fp8_e5m2 at::kFloat8_e5m2
99
+ #else // HIP_FP8_TYPE_OCP
92
100
using __nv_fp8x4_e4m3 = __hip_fp8x4_e4m3_fnuz;
93
101
using __nv_fp8x2_e4m3 = __hip_fp8x2_e4m3_fnuz;
94
102
using __nv_fp8_e4m3 = __hip_fp8_e4m3_fnuz;
95
103
using __nv_fp8_e5m2 = __hip_fp8_e5m2_fnuz;
96
104
#define torch_fp8_e4m3 at::kFloat8_e4m3fnuz
97
105
#define torch_fp8_e5m2 at::kFloat8_e5m2fnuz
98
- #else
106
+ #endif // HIP_FP8_TYPE_OCP
107
+ #else // USE_ROCM
99
108
#define torch_fp8_e4m3 at::kFloat8_e4m3fn
100
109
#define torch_fp8_e5m2 at::kFloat8_e5m2
101
- #endif
110
+ #endif // USE_ROCM
102
111
103
112
#if defined(CUDA_VERSION) && (CUDA_VERSION >= 12080)
104
113
#include < torch/all.h>
Original file line number Diff line number Diff line change 32
32
#endif
33
33
34
34
#if (defined(USE_ROCM) && ROCM_VERSION >= 60200)
35
+ #if HIP_FP8_TYPE_OCP
36
+ using __nv_fp8_e4m3 = __hip_fp8_e4m3;
37
+ #else // HIP_FP8_TYPE_OCP
35
38
using __nv_fp8_e4m3 = __hip_fp8_e4m3_fnuz;
36
- #endif
39
+ #endif // HIP_FP8_TYPE_OCP
40
+ #endif // (defined(USE_ROCM) && ROCM_VERSION >= 60200)
37
41
38
42
namespace fbgemm_gpu {
39
43
You can’t perform that action at this time.
0 commit comments