Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
composable_kernel_ROCM
Commits
3289a5c9
Commit
3289a5c9
authored
Nov 21, 2024
by
Andriy Roshchenko
Browse files
Narrowing the scope of PR to OCP FP8 enablement only
parent
dbfb222d
Changes
63
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
111 deletions
+2
-111
library/include/ck/library/utility/host_tensor_generator.hpp
library/include/ck/library/utility/host_tensor_generator.hpp
+0
-104
test/grouped_convnd_bwd_weight/CMakeLists.txt
test/grouped_convnd_bwd_weight/CMakeLists.txt
+0
-7
test/pool/test_pool_fwd_common.hpp
test/pool/test_pool_fwd_common.hpp
+2
-0
No files found.
library/include/ck/library/utility/host_tensor_generator.hpp
View file @
3289a5c9
...
...
@@ -304,107 +304,3 @@ struct GeneratorTensor_Diagonal
return
pred
?
value
:
T
{
0
};
}
};
/**
* @brief Used to generate tensor entries from coefficients of Leibniz formula for Pi.
*
* @tparam T The type of the tensor values.
*
* Usage: For verification of GEMM
* a_m_k.GenerateTensorValue(GeneratorTensor_PI<ADataType>{});
* b_k_n.GenerateTensorValue(GeneratorTensor_1<BDataType>{1});
*
* c = a * b;
*
* We expect that |c[i][j]-M_PI| <= truncation_error(K)
*/
template
<
typename
T
>
struct
GeneratorTensor_PI
{
template
<
typename
...
Ts
>
T
operator
()(
Ts
...
Xs
)
const
{
static
constexpr
double
pi
=
3.14159265358979323846
;
std
::
array
<
ck
::
index_t
,
sizeof
...(
Ts
)
>
dims
=
{{
static_cast
<
ck
::
index_t
>
(
Xs
)...}};
if
constexpr
(
dims
.
size
()
>
0
)
{
constexpr
auto
last_dim
=
dims
.
size
()
-
1
;
size_t
i
=
dims
[
last_dim
];
float
fi
=
i
;
float
tmp
=
(
i
%
2
==
0
)
?
4.0
:
-
4.0
;
tmp
/=
(
2.0
*
fi
+
1.0
);
return
ck
::
type_convert
<
T
>
(
tmp
);
}
else
{
return
ck
::
type_convert
<
T
>
(
pi
);
}
}
static
double
truncation_error
(
size_t
N
)
{
return
4.0
/
(
2.0
*
N
+
1.0
);
}
};
/**
* @brief Used to generate tensor entries from coefficients of non-alternating version of Leibniz
* formula for Pi.
*
* @tparam T The type of the tensor values.
*
* Usage: For verification of GEMM
* a_m_k.GenerateTensorValue(GeneratorTensor_PI_A<ADataType>{});
* b_k_n.GenerateTensorValue(GeneratorTensor_PI_B<BDataType>{});
*
* c = a * b;
*
* We expect that |c[i][j]-M_PI| <= 0.00013 for K >= 4096 and a,b,c are float.
*/
template
<
typename
T
>
struct
GeneratorTensor_PI_A
{
static
constexpr
double
pi
=
3.14159265358979323846
;
template
<
typename
...
Ts
>
T
operator
()(
Ts
...
Xs
)
const
{
std
::
array
<
ck
::
index_t
,
sizeof
...(
Ts
)
>
dims
=
{{
static_cast
<
ck
::
index_t
>
(
Xs
)...}};
if
constexpr
(
dims
.
size
()
>
0
)
{
constexpr
auto
last_dim
=
dims
.
size
()
-
1
;
size_t
i
=
dims
[
last_dim
];
float
fi
=
i
;
float
tmp
=
2.0
/
(
4.0
*
fi
+
1.0
);
return
ck
::
type_convert
<
T
>
(
tmp
);
}
else
{
return
ck
::
type_convert
<
T
>
(
pi
/
2.0
);
}
}
};
template
<
typename
T
>
struct
GeneratorTensor_PI_B
{
static
constexpr
double
pi
=
3.14159265358979323846
;
template
<
typename
...
Ts
>
T
operator
()(
Ts
...
Xs
)
const
{
std
::
array
<
ck
::
index_t
,
sizeof
...(
Ts
)
>
dims
=
{{
static_cast
<
ck
::
index_t
>
(
Xs
)...}};
if
constexpr
(
dims
.
size
()
>
0
)
{
size_t
i
=
dims
[
0
];
float
fi
=
i
;
float
tmp
=
4.0
/
(
4.0
*
fi
+
3.0
);
return
ck
::
type_convert
<
T
>
(
tmp
);
}
else
{
return
ck
::
type_convert
<
T
>
(
2.0
);
}
}
};
test/grouped_convnd_bwd_weight/CMakeLists.txt
View file @
3289a5c9
add_custom_target
(
test_grouped_convnd_bwd_weight_target
)
if
(
GPU_TARGETS MATCHES
"gfx9"
OR DL_KERNELS
)
add_gtest_executable
(
test_grouped_convnd_bwd_weight test_grouped_convnd_bwd_weight.cpp
)
target_link_libraries
(
test_grouped_convnd_bwd_weight PRIVATE utility device_grouped_conv1d_bwd_weight_instance device_grouped_conv2d_bwd_weight_instance device_grouped_conv3d_bwd_weight_instance
)
add_dependencies
(
test_grouped_convnd_bwd_weight_target test_grouped_convnd_bwd_weight
)
elseif
(
GPU_TARGETS MATCHES
"gfx11"
)
add_gtest_executable
(
test_grouped_convnd_bwd_weight test_grouped_convnd_bwd_weight.cpp
)
target_link_libraries
(
test_grouped_convnd_bwd_weight PRIVATE utility device_grouped_conv3d_bwd_weight_instance
)
add_dependencies
(
test_grouped_convnd_bwd_weight_target test_grouped_convnd_bwd_weight
)
endif
()
add_gtest_executable
(
test_grouped_convnd_bwd_weight_interface_xdl test_grouped_convnd_bwd_weight_interface_xdl.cpp
)
if
(
result EQUAL 0
)
target_link_libraries
(
test_grouped_convnd_bwd_weight_interface_xdl PRIVATE utility
)
add_dependencies
(
test_grouped_convnd_bwd_weight_target test_grouped_convnd_bwd_weight_interface_xdl
)
endif
()
add_gtest_executable
(
test_grouped_convnd_bwd_weight_interface_wmma test_grouped_convnd_bwd_weight_interface_wmma.cpp
)
if
(
result EQUAL 0
)
target_link_libraries
(
test_grouped_convnd_bwd_weight_interface_wmma PRIVATE utility
)
add_dependencies
(
test_grouped_convnd_bwd_weight_target test_grouped_convnd_bwd_weight_interface_wmma
)
endif
()
add_gtest_executable
(
test_grouped_conv_bwd_weight_xdl_bilinear test_grouped_conv_bwd_weight_xdl_bilinear.cpp
)
if
(
result EQUAL 0
)
target_link_libraries
(
test_grouped_conv_bwd_weight_xdl_bilinear PRIVATE utility device_grouped_conv3d_bwd_weight_bilinear_instance
)
add_dependencies
(
test_grouped_convnd_bwd_weight_target test_grouped_conv_bwd_weight_xdl_bilinear
)
endif
()
test/pool/test_pool_fwd_common.hpp
View file @
3289a5c9
...
...
@@ -10,6 +10,8 @@ using F16 = ck::half_t;
using
BF16
=
ck
::
bhalf_t
;
using
F32
=
float
;
using
I32
=
int32_t
;
using
I8
=
int8_t
;
using
F8
=
ck
::
f8_t
;
using
ck
::
index_t
;
using
NDHWC
=
ck
::
tensor_layout
::
convolution
::
NDHWC
;
using
NHWC
=
ck
::
tensor_layout
::
convolution
::
NHWC
;
...
...
Prev
1
2
3
4
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment