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
MIGraphX
Commits
6f37331e
"src/vscode:/vscode.git/clone" did not exist on "0689f8739848b894dae0299893e6d379ea9ae780"
Commit
6f37331e
authored
Dec 07, 2023
by
Paul
Browse files
Merge commit '
8c73c72e
' into navi-reduce
parents
d00fdf6e
8c73c72e
Changes
71
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
155 additions
and
154 deletions
+155
-154
test/verify/gemm_2args_bmv.cpp
test/verify/gemm_2args_bmv.cpp
+8
-3
test/verify/gemm_2args_mm_1.cpp
test/verify/gemm_2args_mm_1.cpp
+8
-3
test/verify/gemm_2args_mm_2.cpp
test/verify/gemm_2args_mm_2.cpp
+9
-3
test/verify/gemm_2args_mm_3.cpp
test/verify/gemm_2args_mm_3.cpp
+9
-3
test/verify/gemm_2args_mm_4.cpp
test/verify/gemm_2args_mm_4.cpp
+9
-3
test/verify/gemm_2args_mm_5.cpp
test/verify/gemm_2args_mm_5.cpp
+8
-3
test/verify/gemm_2args_mm_6.cpp
test/verify/gemm_2args_mm_6.cpp
+9
-3
test/verify/gemm_2args_mm_7.cpp
test/verify/gemm_2args_mm_7.cpp
+8
-3
test/verify/gemm_2args_mm_8.cpp
test/verify/gemm_2args_mm_8.cpp
+8
-3
test/verify/gemm_2args_mv.cpp
test/verify/gemm_2args_mv.cpp
+8
-3
test/verify/gemm_2args_vbm.cpp
test/verify/gemm_2args_vbm.cpp
+8
-3
test/verify/gemm_2args_vm.cpp
test/verify/gemm_2args_vm.cpp
+8
-3
test/verify/gemm_2args_vv.cpp
test/verify/gemm_2args_vv.cpp
+8
-3
test/verify/gemm_add.cpp
test/verify/gemm_add.cpp
+10
-4
test/verify/gemm_add_broadcast1.cpp
test/verify/gemm_add_broadcast1.cpp
+10
-4
test/verify/gemm_add_broadcast2.cpp
test/verify/gemm_add_broadcast2.cpp
+10
-4
test/verify/gemm_add_broadcast_half.cpp
test/verify/gemm_add_broadcast_half.cpp
+0
-49
test/verify/gemm_add_half.cpp
test/verify/gemm_add_half.cpp
+0
-47
test/verify/gemm_literal.cpp
test/verify/gemm_literal.cpp
+8
-3
test/verify/gemm_multi_3args.cpp
test/verify/gemm_multi_3args.cpp
+9
-4
No files found.
test/verify/gemm_2args_bmv.cpp
View file @
6f37331e
...
...
@@ -27,14 +27,15 @@
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
gemm_2args_bmv
:
verify_program
<
gemm_2args_bmv
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_2args_bmv
:
verify_program
<
gemm_2args_bmv
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
float_t
ype
,
{
2
,
3
,
3
,
5
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
float_t
ype
,
{
5
}};
migraphx
::
shape
m1_shape
{
DT
ype
,
{
2
,
3
,
3
,
5
}};
migraphx
::
shape
m2_shape
{
DT
ype
,
{
5
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
l2
=
mm
->
add_parameter
(
"2"
,
m2_shape
);
auto
ul2
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
1
}}}),
l2
);
...
...
@@ -46,3 +47,7 @@ struct gemm_2args_bmv : verify_program<gemm_2args_bmv>
return
p
;
}
};
template
struct
gemm_2args_bmv
<
migraphx
::
shape
::
float_type
>;
template
struct
gemm_2args_bmv
<
migraphx
::
shape
::
half_type
>;
template
struct
gemm_2args_bmv
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_2args_mm_1.cpp
View file @
6f37331e
...
...
@@ -27,14 +27,15 @@
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
gemm_2args_mm_1
:
verify_program
<
gemm_2args_mm_1
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_2args_mm_1
:
verify_program
<
gemm_2args_mm_1
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
float_t
ype
,
{
2
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
float_t
ype
,
{
1
,
3
,
4
}};
migraphx
::
shape
m1_shape
{
DT
ype
,
{
2
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
DT
ype
,
{
1
,
3
,
4
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
l2
=
mm
->
add_parameter
(
"2"
,
m2_shape
);
auto
bl2
=
...
...
@@ -45,3 +46,7 @@ struct gemm_2args_mm_1 : verify_program<gemm_2args_mm_1>
return
p
;
}
};
template
struct
gemm_2args_mm_1
<
migraphx
::
shape
::
float_type
>;
template
struct
gemm_2args_mm_1
<
migraphx
::
shape
::
half_type
>;
template
struct
gemm_2args_mm_1
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_2args_mm_2.cpp
View file @
6f37331e
...
...
@@ -24,17 +24,19 @@
#include "verify_program.hpp"
#include <migraphx/program.hpp>
#include <migraphx/shape.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
gemm_2args_mm_2
:
verify_program
<
gemm_2args_mm_2
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_2args_mm_2
:
verify_program
<
gemm_2args_mm_2
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
float_t
ype
,
{
2
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
float_t
ype
,
{
3
,
4
}};
migraphx
::
shape
m1_shape
{
DT
ype
,
{
2
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
DT
ype
,
{
3
,
4
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
l2
=
mm
->
add_parameter
(
"2"
,
m2_shape
);
auto
bl2
=
...
...
@@ -45,3 +47,7 @@ struct gemm_2args_mm_2 : verify_program<gemm_2args_mm_2>
return
p
;
}
};
template
struct
gemm_2args_mm_2
<
migraphx
::
shape
::
float_type
>;
template
struct
gemm_2args_mm_2
<
migraphx
::
shape
::
half_type
>;
template
struct
gemm_2args_mm_2
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_2args_mm_3.cpp
View file @
6f37331e
...
...
@@ -24,17 +24,19 @@
#include "verify_program.hpp"
#include <migraphx/program.hpp>
#include <migraphx/shape.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
gemm_2args_mm_3
:
verify_program
<
gemm_2args_mm_3
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_2args_mm_3
:
verify_program
<
gemm_2args_mm_3
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
float_t
ype
,
{
1
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
float_t
ype
,
{
3
,
3
,
4
}};
migraphx
::
shape
m1_shape
{
DT
ype
,
{
1
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
DT
ype
,
{
3
,
3
,
4
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
bl1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_lens"
,
{
3
,
2
,
3
}}}),
l1
);
...
...
@@ -45,3 +47,7 @@ struct gemm_2args_mm_3 : verify_program<gemm_2args_mm_3>
return
p
;
}
};
template
struct
gemm_2args_mm_3
<
migraphx
::
shape
::
float_type
>;
template
struct
gemm_2args_mm_3
<
migraphx
::
shape
::
half_type
>;
template
struct
gemm_2args_mm_3
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_2args_mm_4.cpp
View file @
6f37331e
...
...
@@ -23,18 +23,20 @@
*/
#include "verify_program.hpp"
#include <migraphx/shape.hpp>
#include <migraphx/program.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
gemm_2args_mm_4
:
verify_program
<
gemm_2args_mm_4
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_2args_mm_4
:
verify_program
<
gemm_2args_mm_4
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
float_t
ype
,
{
2
,
3
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
float_t
ype
,
{
3
,
3
,
4
}};
migraphx
::
shape
m1_shape
{
DT
ype
,
{
2
,
3
}};
migraphx
::
shape
m2_shape
{
DT
ype
,
{
3
,
3
,
4
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
bl1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_lens"
,
{
3
,
2
,
3
}}}),
l1
);
...
...
@@ -45,3 +47,7 @@ struct gemm_2args_mm_4 : verify_program<gemm_2args_mm_4>
return
p
;
}
};
template
struct
gemm_2args_mm_4
<
migraphx
::
shape
::
float_type
>;
template
struct
gemm_2args_mm_4
<
migraphx
::
shape
::
half_type
>;
template
struct
gemm_2args_mm_4
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_2args_mm_5.cpp
View file @
6f37331e
...
...
@@ -27,14 +27,15 @@
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
gemm_2args_mm_5
:
verify_program
<
gemm_2args_mm_5
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_2args_mm_5
:
verify_program
<
gemm_2args_mm_5
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
float_t
ype
,
{
2
,
1
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
float_t
ype
,
{
2
,
3
,
3
,
4
}};
migraphx
::
shape
m1_shape
{
DT
ype
,
{
2
,
1
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
DT
ype
,
{
2
,
3
,
3
,
4
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
bl1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_lens"
,
{
2
,
3
,
2
,
3
}}}),
l1
);
...
...
@@ -45,3 +46,7 @@ struct gemm_2args_mm_5 : verify_program<gemm_2args_mm_5>
return
p
;
}
};
template
struct
gemm_2args_mm_5
<
migraphx
::
shape
::
float_type
>;
template
struct
gemm_2args_mm_5
<
migraphx
::
shape
::
half_type
>;
template
struct
gemm_2args_mm_5
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_2args_mm_6.cpp
View file @
6f37331e
...
...
@@ -27,14 +27,16 @@
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
gemm_2args_mm_6
:
verify_program
<
gemm_2args_mm_6
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_2args_mm_6
:
verify_program
<
gemm_2args_mm_6
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
float_t
ype
,
{
2
,
1
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
float_t
ype
,
{
1
,
3
,
3
,
4
}};
migraphx
::
shape
m1_shape
{
DT
ype
,
{
2
,
1
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
DT
ype
,
{
1
,
3
,
3
,
4
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
bl1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_lens"
,
{
2
,
3
,
2
,
3
}}}),
l1
);
...
...
@@ -47,3 +49,7 @@ struct gemm_2args_mm_6 : verify_program<gemm_2args_mm_6>
return
p
;
}
};
template
struct
gemm_2args_mm_6
<
migraphx
::
shape
::
float_type
>;
template
struct
gemm_2args_mm_6
<
migraphx
::
shape
::
half_type
>;
template
struct
gemm_2args_mm_6
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_2args_mm_7.cpp
View file @
6f37331e
...
...
@@ -27,14 +27,15 @@
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
gemm_2args_mm_7
:
verify_program
<
gemm_2args_mm_7
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_2args_mm_7
:
verify_program
<
gemm_2args_mm_7
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
float_t
ype
,
{
2
,
3
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
float_t
ype
,
{
2
,
3
,
3
,
4
}};
migraphx
::
shape
m1_shape
{
DT
ype
,
{
2
,
3
}};
migraphx
::
shape
m2_shape
{
DT
ype
,
{
2
,
3
,
3
,
4
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
bl1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_lens"
,
{
2
,
3
,
2
,
3
}}}),
l1
);
...
...
@@ -45,3 +46,7 @@ struct gemm_2args_mm_7 : verify_program<gemm_2args_mm_7>
return
p
;
}
};
template
struct
gemm_2args_mm_7
<
migraphx
::
shape
::
float_type
>;
template
struct
gemm_2args_mm_7
<
migraphx
::
shape
::
half_type
>;
template
struct
gemm_2args_mm_7
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_2args_mm_8.cpp
View file @
6f37331e
...
...
@@ -27,14 +27,15 @@
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
gemm_2args_mm_8
:
verify_program
<
gemm_2args_mm_8
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_2args_mm_8
:
verify_program
<
gemm_2args_mm_8
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
a_shape
{
migraphx
::
shape
::
float_t
ype
,
{
2
,
128
,
32
},
{
4096
,
1
,
128
}};
migraphx
::
shape
b_shape
{
migraphx
::
shape
::
float_t
ype
,
{
32
,
32
}};
migraphx
::
shape
a_shape
{
DT
ype
,
{
2
,
128
,
32
},
{
4096
,
1
,
128
}};
migraphx
::
shape
b_shape
{
DT
ype
,
{
32
,
32
}};
auto
a
=
mm
->
add_parameter
(
"a"
,
a_shape
);
auto
b
=
mm
->
add_parameter
(
"b"
,
b_shape
);
auto
bb
=
mm
->
add_instruction
(
...
...
@@ -45,3 +46,7 @@ struct gemm_2args_mm_8 : verify_program<gemm_2args_mm_8>
return
p
;
}
};
template
struct
gemm_2args_mm_8
<
migraphx
::
shape
::
float_type
>;
// template struct gemm_2args_mm_8<migraphx::shape::half_type>; // fails with CK, issue#2514
template
struct
gemm_2args_mm_8
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_2args_mv.cpp
View file @
6f37331e
...
...
@@ -27,14 +27,15 @@
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
gemm_2args_mv
:
verify_program
<
gemm_2args_mv
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_2args_mv
:
verify_program
<
gemm_2args_mv
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
float_t
ype
,
{
3
,
5
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
float_t
ype
,
{
5
}};
migraphx
::
shape
m1_shape
{
DT
ype
,
{
3
,
5
}};
migraphx
::
shape
m2_shape
{
DT
ype
,
{
5
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
l2
=
mm
->
add_parameter
(
"2"
,
m2_shape
);
auto
ul2
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
1
}}}),
l2
);
...
...
@@ -44,3 +45,7 @@ struct gemm_2args_mv : verify_program<gemm_2args_mv>
return
p
;
}
};
template
struct
gemm_2args_mv
<
migraphx
::
shape
::
float_type
>;
template
struct
gemm_2args_mv
<
migraphx
::
shape
::
half_type
>;
template
struct
gemm_2args_mv
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_2args_vbm.cpp
View file @
6f37331e
...
...
@@ -27,14 +27,15 @@
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
gemm_2args_vbm
:
verify_program
<
gemm_2args_vbm
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_2args_vbm
:
verify_program
<
gemm_2args_vbm
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
float_t
ype
,
{
5
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
float_t
ype
,
{
2
,
2
,
5
,
4
}};
migraphx
::
shape
m1_shape
{
DT
ype
,
{
5
}};
migraphx
::
shape
m2_shape
{
DT
ype
,
{
2
,
2
,
5
,
4
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
ul1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
0
}}}),
l1
);
auto
bul1
=
mm
->
add_instruction
(
...
...
@@ -48,3 +49,7 @@ struct gemm_2args_vbm : verify_program<gemm_2args_vbm>
return
p
;
}
};
template
struct
gemm_2args_vbm
<
migraphx
::
shape
::
float_type
>;
template
struct
gemm_2args_vbm
<
migraphx
::
shape
::
half_type
>;
template
struct
gemm_2args_vbm
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_2args_vm.cpp
View file @
6f37331e
...
...
@@ -27,14 +27,15 @@
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
gemm_2args_vm
:
verify_program
<
gemm_2args_vm
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_2args_vm
:
verify_program
<
gemm_2args_vm
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
float_t
ype
,
{
5
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
float_t
ype
,
{
5
,
4
}};
migraphx
::
shape
m1_shape
{
DT
ype
,
{
5
}};
migraphx
::
shape
m2_shape
{
DT
ype
,
{
5
,
4
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
ul1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
0
}}}),
l1
);
auto
l2
=
mm
->
add_parameter
(
"2"
,
m2_shape
);
...
...
@@ -45,3 +46,7 @@ struct gemm_2args_vm : verify_program<gemm_2args_vm>
return
p
;
}
};
template
struct
gemm_2args_vm
<
migraphx
::
shape
::
float_type
>;
template
struct
gemm_2args_vm
<
migraphx
::
shape
::
half_type
>;
template
struct
gemm_2args_vm
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_2args_vv.cpp
View file @
6f37331e
...
...
@@ -28,14 +28,15 @@
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
gemm_2args_vv
:
verify_program
<
gemm_2args_vv
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_2args_vv
:
verify_program
<
gemm_2args_vv
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
float_t
ype
,
{
8
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
float_t
ype
,
{
8
}};
migraphx
::
shape
m1_shape
{
DT
ype
,
{
8
}};
migraphx
::
shape
m2_shape
{
DT
ype
,
{
8
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
ul1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
0
}}}),
l1
);
auto
l2
=
mm
->
add_parameter
(
"2"
,
m2_shape
);
...
...
@@ -48,3 +49,7 @@ struct gemm_2args_vv : verify_program<gemm_2args_vv>
return
p
;
}
};
template
struct
gemm_2args_vv
<
migraphx
::
shape
::
float_type
>;
template
struct
gemm_2args_vv
<
migraphx
::
shape
::
half_type
>;
template
struct
gemm_2args_vv
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_add.cpp
View file @
6f37331e
...
...
@@ -27,15 +27,17 @@
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
#include <migraphx/apply_alpha_beta.hpp>
struct
gemm_add
:
verify_program
<
gemm_add
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_add
:
verify_program
<
gemm_add
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
float_t
ype
,
{
1
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
float_t
ype
,
{
1
,
3
,
4
}};
migraphx
::
shape
m3_shape
{
migraphx
::
shape
::
float_t
ype
,
{
1
,
2
,
4
}};
migraphx
::
shape
m1_shape
{
DT
ype
,
{
1
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
DT
ype
,
{
1
,
3
,
4
}};
migraphx
::
shape
m3_shape
{
DT
ype
,
{
1
,
2
,
4
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
l2
=
mm
->
add_parameter
(
"2"
,
m2_shape
);
auto
l3
=
mm
->
add_parameter
(
"3"
,
m3_shape
);
...
...
@@ -45,3 +47,7 @@ struct gemm_add : verify_program<gemm_add>
return
p
;
}
};
template
struct
gemm_add
<
migraphx
::
shape
::
float_type
>;
template
struct
gemm_add
<
migraphx
::
shape
::
half_type
>;
template
struct
gemm_add
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_add_broadcast1.cpp
View file @
6f37331e
...
...
@@ -27,15 +27,17 @@
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
#include <migraphx/apply_alpha_beta.hpp>
struct
gemm_add_broadcast1
:
verify_program
<
gemm_add_broadcast1
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_add_broadcast1
:
verify_program
<
gemm_add_broadcast1
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
float_t
ype
,
{
1
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
float_t
ype
,
{
1
,
3
,
4
}};
migraphx
::
shape
m3_shape
{
migraphx
::
shape
::
float_t
ype
,
{
1
,
1
,
4
}};
migraphx
::
shape
m1_shape
{
DT
ype
,
{
1
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
DT
ype
,
{
1
,
3
,
4
}};
migraphx
::
shape
m3_shape
{
DT
ype
,
{
1
,
1
,
4
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
l2
=
mm
->
add_parameter
(
"2"
,
m2_shape
);
auto
l3
=
mm
->
add_parameter
(
"3"
,
m3_shape
);
...
...
@@ -47,3 +49,7 @@ struct gemm_add_broadcast1 : verify_program<gemm_add_broadcast1>
return
p
;
}
};
template
struct
gemm_add_broadcast1
<
migraphx
::
shape
::
float_type
>;
template
struct
gemm_add_broadcast1
<
migraphx
::
shape
::
half_type
>;
template
struct
gemm_add_broadcast1
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_add_broadcast2.cpp
View file @
6f37331e
...
...
@@ -27,15 +27,17 @@
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
#include <migraphx/apply_alpha_beta.hpp>
struct
gemm_add_broadcast2
:
verify_program
<
gemm_add_broadcast2
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_add_broadcast2
:
verify_program
<
gemm_add_broadcast2
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
float_t
ype
,
{
1
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
float_t
ype
,
{
1
,
3
,
4
}};
migraphx
::
shape
m3_shape
{
migraphx
::
shape
::
float_t
ype
,
{
1
,
2
,
1
}};
migraphx
::
shape
m1_shape
{
DT
ype
,
{
1
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
DT
ype
,
{
1
,
3
,
4
}};
migraphx
::
shape
m3_shape
{
DT
ype
,
{
1
,
2
,
1
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
l2
=
mm
->
add_parameter
(
"2"
,
m2_shape
);
auto
l3
=
mm
->
add_parameter
(
"3"
,
m3_shape
);
...
...
@@ -47,3 +49,7 @@ struct gemm_add_broadcast2 : verify_program<gemm_add_broadcast2>
return
p
;
}
};
template
struct
gemm_add_broadcast2
<
migraphx
::
shape
::
float_type
>;
// template struct gemm_add_broadcast2<migraphx::shape::half_type>; // fails with CK, issue#2514
template
struct
gemm_add_broadcast2
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_add_broadcast_half.cpp
deleted
100644 → 0
View file @
d00fdf6e
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "verify_program.hpp"
#include <migraphx/program.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
#include <migraphx/apply_alpha_beta.hpp>
struct
gemm_add_broadcast_half
:
verify_program
<
gemm_add_broadcast_half
>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
half_type
,
{
1
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
half_type
,
{
1
,
3
,
4
}};
migraphx
::
shape
m3_shape
{
migraphx
::
shape
::
half_type
,
{
1
,
1
,
4
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
l2
=
mm
->
add_parameter
(
"2"
,
m2_shape
);
auto
l3
=
mm
->
add_parameter
(
"3"
,
m3_shape
);
auto
l3_b
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"multibroadcast"
,
{{
"out_lens"
,
{
1
,
2
,
4
}}}),
l3
);
auto
dot
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"dot"
),
l1
,
l2
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"add"
),
dot
,
l3_b
);
return
p
;
}
};
test/verify/gemm_add_half.cpp
deleted
100644 → 0
View file @
d00fdf6e
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "verify_program.hpp"
#include <migraphx/program.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
#include <migraphx/apply_alpha_beta.hpp>
struct
gemm_add_half
:
verify_program
<
gemm_add_half
>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
half_type
,
{
1
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
half_type
,
{
1
,
3
,
4
}};
migraphx
::
shape
m3_shape
{
migraphx
::
shape
::
half_type
,
{
1
,
2
,
4
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
l2
=
mm
->
add_parameter
(
"2"
,
m2_shape
);
auto
l3
=
mm
->
add_parameter
(
"3"
,
m3_shape
);
auto
dot
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"dot"
),
l1
,
l2
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"add"
),
dot
,
l3
);
return
p
;
}
};
test/verify/gemm_literal.cpp
View file @
6f37331e
...
...
@@ -27,14 +27,15 @@
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
gemm_literal
:
verify_program
<
gemm_literal
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_literal
:
verify_program
<
gemm_literal
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
a_shape
{
migraphx
::
shape
::
float_t
ype
,
{
2
,
4
}};
migraphx
::
shape
b_shape
{
migraphx
::
shape
::
float_t
ype
,
{
4
,
4
}};
migraphx
::
shape
a_shape
{
DT
ype
,
{
2
,
4
}};
migraphx
::
shape
b_shape
{
DT
ype
,
{
4
,
4
}};
auto
a
=
mm
->
add_literal
(
migraphx
::
generate_literal
(
a_shape
));
auto
b
=
mm
->
add_parameter
(
"b"
,
b_shape
);
...
...
@@ -43,3 +44,7 @@ struct gemm_literal : verify_program<gemm_literal>
return
p
;
}
};
template
struct
gemm_literal
<
migraphx
::
shape
::
float_type
>;
template
struct
gemm_literal
<
migraphx
::
shape
::
half_type
>;
template
struct
gemm_literal
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/gemm_multi_3args.cpp
View file @
6f37331e
...
...
@@ -28,15 +28,16 @@
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct
gemm_multi_3args
:
verify_program
<
gemm_multi_3args
>
template
<
migraphx
::
shape
::
type_t
DType
>
struct
gemm_multi_3args
:
verify_program
<
gemm_multi_3args
<
DType
>>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
float_t
ype
,
{
2
,
3
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
float_t
ype
,
{
2
,
3
,
3
,
2
}};
migraphx
::
shape
m3_shape
{
migraphx
::
shape
::
float_t
ype
,
{
2
,
3
,
2
,
2
}};
migraphx
::
shape
m1_shape
{
DT
ype
,
{
2
,
3
,
2
,
3
}};
migraphx
::
shape
m2_shape
{
DT
ype
,
{
2
,
3
,
3
,
2
}};
migraphx
::
shape
m3_shape
{
DT
ype
,
{
2
,
3
,
2
,
2
}};
auto
l1
=
mm
->
add_parameter
(
"1"
,
m1_shape
);
auto
l2
=
mm
->
add_parameter
(
"2"
,
m2_shape
);
...
...
@@ -47,3 +48,7 @@ struct gemm_multi_3args : verify_program<gemm_multi_3args>
return
p
;
}
};
template
struct
gemm_multi_3args
<
migraphx
::
shape
::
float_type
>;
template
struct
gemm_multi_3args
<
migraphx
::
shape
::
half_type
>;
template
struct
gemm_multi_3args
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
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