"tests/models/unets/test_models_unet_2d_condition.py" did not exist on "5d4f59ee962f4ed2c36842dfcf8a40ab6ebd010e"
Commit acf8854e authored by Rostyslav Geyyer's avatar Rostyslav Geyyer
Browse files

Fix build logic

parent b8f4de71
...@@ -10,7 +10,7 @@ namespace ck { ...@@ -10,7 +10,7 @@ namespace ck {
// Declare a template function for scaled conversion // Declare a template function for scaled conversion
template <typename Y, typename X> template <typename Y, typename X>
#if CK_USE_NATIVE_MX_SUPPORT || CK_USE_OCP_FP8 #if CK_USE_OCP_FP8
__host__ __device__ constexpr Y scaled_type_convert(e8m0_bexp_t scale, X x); __host__ __device__ constexpr Y scaled_type_convert(e8m0_bexp_t scale, X x);
#else #else
__host__ constexpr Y scaled_type_convert(e8m0_bexp_t scale, X x); __host__ constexpr Y scaled_type_convert(e8m0_bexp_t scale, X x);
...@@ -339,13 +339,11 @@ inline __host__ bf8x32_ocp_t scaled_type_convert<bf8x32_ocp_t, float32_t>(e8m0_b ...@@ -339,13 +339,11 @@ inline __host__ bf8x32_ocp_t scaled_type_convert<bf8x32_ocp_t, float32_t>(e8m0_b
#endif #endif
} }
// activate for architectures with native MX support
#if CK_USE_NATIVE_MX_SUPPORT
// convert fp4 to fp32 // convert fp4 to fp32
template <> template <>
#if CK_USE_NATIVE_MX_SUPPORT
inline __host__ __device__ float scaled_type_convert<float, f4_t>(e8m0_bexp_t scale, f4_t x) inline __host__ __device__ float scaled_type_convert<float, f4_t>(e8m0_bexp_t scale, f4_t x)
#else
inline __host__ float scaled_type_convert<float, f4_t>(e8m0_bexp_t scale, f4_t x)
#endif
{ {
#if defined(__gfx950__) #if defined(__gfx950__)
union union
...@@ -363,12 +361,8 @@ inline __host__ float scaled_type_convert<float, f4_t>(e8m0_bexp_t scale, f4_t x ...@@ -363,12 +361,8 @@ inline __host__ float scaled_type_convert<float, f4_t>(e8m0_bexp_t scale, f4_t x
// convert vector of 2 fp4 to vector of 2 fp32 // convert vector of 2 fp4 to vector of 2 fp32
template <> template <>
#if CK_USE_NATIVE_MX_SUPPORT
inline __host__ __device__ float2_t scaled_type_convert<float2_t, f4x2_t>(e8m0_bexp_t scale, inline __host__ __device__ float2_t scaled_type_convert<float2_t, f4x2_t>(e8m0_bexp_t scale,
f4x2_t x) f4x2_t x)
#else
inline __host__ float2_t scaled_type_convert<float2_t, f4x2_t>(e8m0_bexp_t scale, f4x2_t x)
#endif
{ {
#if defined(__gfx950__) #if defined(__gfx950__)
union union
...@@ -389,12 +383,8 @@ inline __host__ float2_t scaled_type_convert<float2_t, f4x2_t>(e8m0_bexp_t scale ...@@ -389,12 +383,8 @@ inline __host__ float2_t scaled_type_convert<float2_t, f4x2_t>(e8m0_bexp_t scale
// convert vector of 32 fp4 to vector of 32 fp32 // convert vector of 32 fp4 to vector of 32 fp32
template <> template <>
#if CK_USE_NATIVE_MX_SUPPORT
inline __host__ __device__ float32_t scaled_type_convert<float32_t, f4x32_t>(e8m0_bexp_t scale, inline __host__ __device__ float32_t scaled_type_convert<float32_t, f4x32_t>(e8m0_bexp_t scale,
f4x32_t x) f4x32_t x)
#else
inline __host__ float32_t scaled_type_convert<float32_t, f4x32_t>(e8m0_bexp_t scale, f4x32_t x)
#endif
{ {
#if defined(__gfx950__) #if defined(__gfx950__)
union union
...@@ -626,11 +616,7 @@ inline __host__ float32_t scaled_type_convert<float32_t, f4x32_t>(e8m0_bexp_t sc ...@@ -626,11 +616,7 @@ inline __host__ float32_t scaled_type_convert<float32_t, f4x32_t>(e8m0_bexp_t sc
// convert fp32 to fp4 // convert fp32 to fp4
template <> template <>
#if CK_USE_NATIVE_MX_SUPPORT
inline __host__ __device__ f4_t scaled_type_convert<f4_t, float>(e8m0_bexp_t scale, float x) inline __host__ __device__ f4_t scaled_type_convert<f4_t, float>(e8m0_bexp_t scale, float x)
#else
inline __host__ f4_t scaled_type_convert<f4_t, float>(e8m0_bexp_t scale, float x)
#endif
{ {
#if CK_USE_SR_F4_CONVERSION #if CK_USE_SR_F4_CONVERSION
return f4_convert_sr(x, type_convert<float>(scale)); return f4_convert_sr(x, type_convert<float>(scale));
...@@ -641,12 +627,8 @@ inline __host__ f4_t scaled_type_convert<f4_t, float>(e8m0_bexp_t scale, float x ...@@ -641,12 +627,8 @@ inline __host__ f4_t scaled_type_convert<f4_t, float>(e8m0_bexp_t scale, float x
// convert vector of 2 fp32 to vector of 2 fp4 // convert vector of 2 fp32 to vector of 2 fp4
template <> template <>
#if CK_USE_NATIVE_MX_SUPPORT
inline __host__ __device__ f4x2_t scaled_type_convert<f4x2_t, float2_t>(e8m0_bexp_t scale, inline __host__ __device__ f4x2_t scaled_type_convert<f4x2_t, float2_t>(e8m0_bexp_t scale,
float2_t x) float2_t x)
#else
inline __host__ f4x2_t scaled_type_convert<f4x2_t, float2_t>(e8m0_bexp_t scale, float2_t x)
#endif
{ {
#if CK_USE_SR_F4_CONVERSION #if CK_USE_SR_F4_CONVERSION
return f4_convert_sr(x, type_convert<float>(scale)); return f4_convert_sr(x, type_convert<float>(scale));
...@@ -657,12 +639,8 @@ inline __host__ f4x2_t scaled_type_convert<f4x2_t, float2_t>(e8m0_bexp_t scale, ...@@ -657,12 +639,8 @@ inline __host__ f4x2_t scaled_type_convert<f4x2_t, float2_t>(e8m0_bexp_t scale,
// convert vector of 32 fp32 to vector of 32 fp4 // convert vector of 32 fp32 to vector of 32 fp4
template <> template <>
#if CK_USE_NATIVE_MX_SUPPORT
inline __host__ __device__ f4x32_t scaled_type_convert<f4x32_t, float32_t>(e8m0_bexp_t scale, inline __host__ __device__ f4x32_t scaled_type_convert<f4x32_t, float32_t>(e8m0_bexp_t scale,
float32_t x) float32_t x)
#else
inline __host__ f4x32_t scaled_type_convert<f4x32_t, float32_t>(e8m0_bexp_t scale, float32_t x)
#endif
{ {
#if CK_USE_SR_F4_CONVERSION #if CK_USE_SR_F4_CONVERSION
return f4_convert_sr(x, type_convert<float>(scale)); return f4_convert_sr(x, type_convert<float>(scale));
...@@ -680,11 +658,7 @@ inline __host__ f4x32_t scaled_type_convert<f4x32_t, float32_t>(e8m0_bexp_t scal ...@@ -680,11 +658,7 @@ inline __host__ f4x32_t scaled_type_convert<f4x32_t, float32_t>(e8m0_bexp_t scal
* @return The converted 32-bit float representation of the input. * @return The converted 32-bit float representation of the input.
*/ */
template <> template <>
#if CK_USE_NATIVE_MX_SUPPORT
inline __host__ __device__ float scaled_type_convert<float, f6_t>(e8m0_bexp_t scale, f6_t x) inline __host__ __device__ float scaled_type_convert<float, f6_t>(e8m0_bexp_t scale, f6_t x)
#else
inline __host__ float scaled_type_convert<float, f6_t>(e8m0_bexp_t scale, f6_t x)
#endif
{ {
#if defined(__gfx950__) #if defined(__gfx950__)
union union
...@@ -708,12 +682,8 @@ inline __host__ float scaled_type_convert<float, f6_t>(e8m0_bexp_t scale, f6_t x ...@@ -708,12 +682,8 @@ inline __host__ float scaled_type_convert<float, f6_t>(e8m0_bexp_t scale, f6_t x
} }
template <> template <>
#if CK_USE_NATIVE_MX_SUPPORT
inline __host__ __device__ float32_t scaled_type_convert<float32_t, f6x32_t>(e8m0_bexp_t scale, inline __host__ __device__ float32_t scaled_type_convert<float32_t, f6x32_t>(e8m0_bexp_t scale,
f6x32_t x) f6x32_t x)
#else
inline __host__ float32_t scaled_type_convert<float32_t, f6x32_t>(e8m0_bexp_t scale, f6x32_t x)
#endif
{ {
#if defined(__gfx950__) #if defined(__gfx950__)
return __builtin_amdgcn_cvt_scalef32_pk32_f32_fp6(x, type_convert<float>(scale)); return __builtin_amdgcn_cvt_scalef32_pk32_f32_fp6(x, type_convert<float>(scale));
...@@ -746,11 +716,7 @@ inline __host__ float32_t scaled_type_convert<float32_t, f6x32_t>(e8m0_bexp_t sc ...@@ -746,11 +716,7 @@ inline __host__ float32_t scaled_type_convert<float32_t, f6x32_t>(e8m0_bexp_t sc
* @return The converted 32-bit float representation of the input. * @return The converted 32-bit float representation of the input.
*/ */
template <> template <>
#if CK_USE_NATIVE_MX_SUPPORT
inline __host__ __device__ float scaled_type_convert<float, bf6_t>(e8m0_bexp_t scale, bf6_t x) inline __host__ __device__ float scaled_type_convert<float, bf6_t>(e8m0_bexp_t scale, bf6_t x)
#else
inline __host__ float scaled_type_convert<float, bf6_t>(e8m0_bexp_t scale, bf6_t x)
#endif
{ {
#if defined(__gfx950__) #if defined(__gfx950__)
union union
...@@ -774,12 +740,8 @@ inline __host__ float scaled_type_convert<float, bf6_t>(e8m0_bexp_t scale, bf6_t ...@@ -774,12 +740,8 @@ inline __host__ float scaled_type_convert<float, bf6_t>(e8m0_bexp_t scale, bf6_t
} }
template <> template <>
#if CK_USE_NATIVE_MX_SUPPORT
inline __host__ __device__ float32_t scaled_type_convert<float32_t, bf6x32_t>(e8m0_bexp_t scale, inline __host__ __device__ float32_t scaled_type_convert<float32_t, bf6x32_t>(e8m0_bexp_t scale,
bf6x32_t x) bf6x32_t x)
#else
inline __host__ float32_t scaled_type_convert<float32_t, bf6x32_t>(e8m0_bexp_t scale, bf6x32_t x)
#endif
{ {
#if defined(__gfx950__) #if defined(__gfx950__)
return __builtin_amdgcn_cvt_scalef32_pk32_f32_bf6(x, type_convert<float>(scale)); return __builtin_amdgcn_cvt_scalef32_pk32_f32_bf6(x, type_convert<float>(scale));
...@@ -815,11 +777,7 @@ inline __host__ float32_t scaled_type_convert<float32_t, bf6x32_t>(e8m0_bexp_t s ...@@ -815,11 +777,7 @@ inline __host__ float32_t scaled_type_convert<float32_t, bf6x32_t>(e8m0_bexp_t s
* @return The converted 6-bit floating-point value (f6_t). * @return The converted 6-bit floating-point value (f6_t).
*/ */
template <> template <>
#if CK_USE_NATIVE_MX_SUPPORT
inline __host__ __device__ f6_t scaled_type_convert<f6_t, float>(e8m0_bexp_t scale, float x) inline __host__ __device__ f6_t scaled_type_convert<f6_t, float>(e8m0_bexp_t scale, float x)
#else
inline __host__ f6_t scaled_type_convert<f6_t, float>(e8m0_bexp_t scale, float x)
#endif
{ {
#if CK_USE_SR_F6_CONVERSION #if CK_USE_SR_F6_CONVERSION
return f6_convert_sr(x, type_convert<float>(scale)); return f6_convert_sr(x, type_convert<float>(scale));
...@@ -829,12 +787,8 @@ inline __host__ f6_t scaled_type_convert<f6_t, float>(e8m0_bexp_t scale, float x ...@@ -829,12 +787,8 @@ inline __host__ f6_t scaled_type_convert<f6_t, float>(e8m0_bexp_t scale, float x
} }
template <> template <>
#if CK_USE_NATIVE_MX_SUPPORT
inline __host__ __device__ f6x32_t scaled_type_convert<f6x32_t, float32_t>(e8m0_bexp_t scale, inline __host__ __device__ f6x32_t scaled_type_convert<f6x32_t, float32_t>(e8m0_bexp_t scale,
float32_t x) float32_t x)
#else
inline __host__ f6x32_t scaled_type_convert<f6x32_t, float32_t>(e8m0_bexp_t scale, float32_t x)
#endif
{ {
#if CK_USE_SR_F6_CONVERSION #if CK_USE_SR_F6_CONVERSION
return f6_convert_sr(x, type_convert<float>(scale)); return f6_convert_sr(x, type_convert<float>(scale));
...@@ -855,11 +809,7 @@ inline __host__ f6x32_t scaled_type_convert<f6x32_t, float32_t>(e8m0_bexp_t scal ...@@ -855,11 +809,7 @@ inline __host__ f6x32_t scaled_type_convert<f6x32_t, float32_t>(e8m0_bexp_t scal
* @return The converted 6-bit floating-point value (bf6_t). * @return The converted 6-bit floating-point value (bf6_t).
*/ */
template <> template <>
#if CK_USE_NATIVE_MX_SUPPORT
inline __host__ __device__ bf6_t scaled_type_convert<bf6_t, float>(e8m0_bexp_t scale, float x) inline __host__ __device__ bf6_t scaled_type_convert<bf6_t, float>(e8m0_bexp_t scale, float x)
#else
inline __host__ bf6_t scaled_type_convert<bf6_t, float>(e8m0_bexp_t scale, float x)
#endif
{ {
#if CK_USE_SR_F6_CONVERSION #if CK_USE_SR_F6_CONVERSION
return bf6_convert_sr(x, type_convert<float>(scale)); return bf6_convert_sr(x, type_convert<float>(scale));
...@@ -869,12 +819,8 @@ inline __host__ bf6_t scaled_type_convert<bf6_t, float>(e8m0_bexp_t scale, float ...@@ -869,12 +819,8 @@ inline __host__ bf6_t scaled_type_convert<bf6_t, float>(e8m0_bexp_t scale, float
} }
template <> template <>
#if CK_USE_NATIVE_MX_SUPPORT
inline __host__ __device__ bf6x32_t scaled_type_convert<bf6x32_t, float32_t>(e8m0_bexp_t scale, inline __host__ __device__ bf6x32_t scaled_type_convert<bf6x32_t, float32_t>(e8m0_bexp_t scale,
float32_t x) float32_t x)
#else
inline __host__ bf6x32_t scaled_type_convert<bf6x32_t, float32_t>(e8m0_bexp_t scale, float32_t x)
#endif
{ {
#if CK_USE_SR_F6_CONVERSION #if CK_USE_SR_F6_CONVERSION
return bf6_convert_sr(x, type_convert<float>(scale)); return bf6_convert_sr(x, type_convert<float>(scale));
...@@ -882,5 +828,6 @@ inline __host__ bf6x32_t scaled_type_convert<bf6x32_t, float32_t>(e8m0_bexp_t sc ...@@ -882,5 +828,6 @@ inline __host__ bf6x32_t scaled_type_convert<bf6x32_t, float32_t>(e8m0_bexp_t sc
return bf6_convert_rne(x, type_convert<float>(scale)); return bf6_convert_rne(x, type_convert<float>(scale));
#endif #endif
} }
#endif // #if CK_USE_NATIVE_MX_SUPPORT
} // namespace ck } // namespace ck
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment