Skip to content

Commit 0860461

Browse files
authored
Add reduce section for verify tests (#3677)
1 parent 2e59073 commit 0860461

32 files changed

+100
-14
lines changed

test/verify/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ target_link_libraries(test_verify migraphx migraphx_all_targets)
3131
target_include_directories(test_verify PUBLIC ../include)
3232
rocm_clang_tidy_check(test_verify)
3333

34-
foreach(SECTION general rnn conv gemm)
34+
foreach(SECTION general reduce rnn conv gemm)
3535
rocm_add_test(NAME test_verify_${SECTION} COMMAND test_verify ${SECTION})
3636
set_tests_properties(test_verify_${SECTION} PROPERTIES
3737
COST 100

test/verify/test_arg_ops.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ struct test_arg_ops : verify_program<test_arg_ops<T, DType, Axis, LastIndex, Non
5757
mm->add_instruction(T{Axis, LastIndex}, param);
5858
return p;
5959
}
60+
61+
std::string section() const { return "reduce"; }
6062
};
6163
// transpose argmax tests
6264
template struct test_arg_ops<migraphx::op::argmax, migraphx::shape::float_type, 0, true, 0>;

test/verify/test_block_reduce_small.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ struct test_block_reduce_small : verify_program<test_block_reduce_small<N, T>>
4646
mm->add_return({add});
4747
return p;
4848
};
49+
50+
std::string section() const { return "reduce"; }
4951
};
5052

5153
template <int N>

test/verify/test_instancenorm.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2015-2023 Advanced Micro Devices, Inc. All rights reserved.
4+
* Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved.
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -75,6 +75,8 @@ struct test_instancenorm : verify_program<test_instancenorm<TYPE>>
7575
add_instancenorm(*mm, x, {1, 2, 1, 1});
7676
return p;
7777
}
78+
79+
std::string section() const { return "reduce"; }
7880
};
7981
template struct test_instancenorm<migraphx::shape::float_type>;
8082
template struct test_instancenorm<migraphx::shape::half_type>;
@@ -91,6 +93,8 @@ struct test_instancenorm_large_3d : verify_program<test_instancenorm_large_3d<TY
9193
add_instancenorm(*mm, x, {1, 32, 1, 1, 1});
9294
return p;
9395
}
96+
97+
std::string section() const { return "reduce"; }
9498
};
9599

96100
template struct test_instancenorm_large_3d<migraphx::shape::float_type>;

test/verify/test_layernorm.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ struct test_layernorm : verify_program<test_layernorm>
4040
add_layernorm(*mm, x, dims);
4141
return p;
4242
}
43+
44+
std::string section() const { return "reduce"; }
4345
};
4446

4547
struct test_layernorm2 : verify_program<test_layernorm2>
@@ -53,6 +55,8 @@ struct test_layernorm2 : verify_program<test_layernorm2>
5355
add_layernorm(*mm, x, dims);
5456
return p;
5557
}
58+
59+
std::string section() const { return "reduce"; }
5660
};
5761

5862
struct test_layernorm_large : verify_program<test_layernorm_large>
@@ -66,6 +70,8 @@ struct test_layernorm_large : verify_program<test_layernorm_large>
6670
add_layernorm(*mm, x, dims);
6771
return p;
6872
}
73+
74+
std::string section() const { return "reduce"; }
6975
};
7076

7177
struct test_layernorm_fp16 : verify_program<test_layernorm_fp16>
@@ -79,6 +85,8 @@ struct test_layernorm_fp16 : verify_program<test_layernorm_fp16>
7985
add_layernorm(*mm, x, dims);
8086
return p;
8187
}
88+
89+
std::string section() const { return "reduce"; }
8290
};
8391

8492
struct test_layernorm_fp8_1 : verify_program<test_layernorm_fp8_1>
@@ -92,6 +100,8 @@ struct test_layernorm_fp8_1 : verify_program<test_layernorm_fp8_1>
92100
add_layernorm(*mm, x, dims);
93101
return p;
94102
}
103+
104+
std::string section() const { return "reduce"; }
95105
};
96106

97107
struct test_layernorm_fp8_2 : verify_program<test_layernorm_fp8_2>
@@ -105,6 +115,8 @@ struct test_layernorm_fp8_2 : verify_program<test_layernorm_fp8_2>
105115
add_layernorm(*mm, x, dims);
106116
return p;
107117
}
118+
119+
std::string section() const { return "reduce"; }
108120
};
109121

110122
struct test_layernorm_fp8_3 : verify_program<test_layernorm_fp8_3>
@@ -118,6 +130,8 @@ struct test_layernorm_fp8_3 : verify_program<test_layernorm_fp8_3>
118130
add_layernorm(*mm, x, dims);
119131
return p;
120132
}
133+
134+
std::string section() const { return "reduce"; }
121135
};
122136

123137
struct test_layernorm_fp8_4 : verify_program<test_layernorm_fp8_4>
@@ -131,6 +145,8 @@ struct test_layernorm_fp8_4 : verify_program<test_layernorm_fp8_4>
131145
add_layernorm(*mm, x, dims);
132146
return p;
133147
}
148+
149+
std::string section() const { return "reduce"; }
134150
};
135151

136152
struct test_layernorm_eps : verify_program<test_layernorm_eps>
@@ -144,6 +160,8 @@ struct test_layernorm_eps : verify_program<test_layernorm_eps>
144160
add_layernorm(*mm, x, dims, 1e-5f);
145161
return p;
146162
}
163+
164+
std::string section() const { return "reduce"; }
147165
};
148166

149167
struct test_layernorm_triadd : verify_program<test_layernorm_triadd>
@@ -161,6 +179,8 @@ struct test_layernorm_triadd : verify_program<test_layernorm_triadd>
161179
add_layernorm(*mm, add2, dims);
162180
return p;
163181
}
182+
183+
std::string section() const { return "reduce"; }
164184
};
165185

166186
struct test_layernorm_triadd_large : verify_program<test_layernorm_triadd_large>
@@ -178,6 +198,8 @@ struct test_layernorm_triadd_large : verify_program<test_layernorm_triadd_large>
178198
add_layernorm(*mm, add2, dims);
179199
return p;
180200
}
201+
202+
std::string section() const { return "reduce"; }
181203
};
182204

183205
struct test_add_layernorm_add_gemm_nonstd : verify_program<test_add_layernorm_add_gemm_nonstd>
@@ -210,4 +232,6 @@ struct test_pw_layernorm : verify_program<test_pw_layernorm>
210232
add_pointwise_layernorm(*mm, x, dims);
211233
return p;
212234
}
235+
236+
std::string section() const { return "reduce"; }
213237
};

test/verify/test_logsoftmax.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ struct test_logsoftmax : verify_program<test_logsoftmax<Axis, T>>
4040

4141
return p;
4242
}
43+
44+
std::string section() const { return "reduce"; }
4345
};
4446

4547
template struct test_logsoftmax<0, migraphx::shape::float_type>;

test/verify/test_logsoftmax1.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
4+
* Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved.
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -40,4 +40,6 @@ struct test_logsoftmax1 : verify_program<test_logsoftmax1>
4040
mm->add_return({r});
4141
return p;
4242
}
43+
44+
std::string section() const { return "reduce"; }
4345
};

test/verify/test_pointwise_broadcast_reduce.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,6 @@ struct test_pointwise_broadcast_reduce : verify_program<test_pointwise_broadcast
5252
mm->add_return({reshape});
5353
return p;
5454
};
55+
56+
std::string section() const { return "reduce"; }
5557
};

test/verify/test_reduce_add.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ struct test_reduce_add : verify_program<test_reduce_add<DType>>
4747
mm->add_return({add});
4848
return p;
4949
};
50+
51+
std::string section() const { return "reduce"; }
5052
};
5153

5254
template struct test_reduce_add<migraphx::shape::float_type>;

test/verify/test_reduce_mean_bias_half.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2015-2023 Advanced Micro Devices, Inc. All rights reserved.
4+
* Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved.
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -45,4 +45,6 @@ struct test_reduce_mean_bias_half : verify_program<test_reduce_mean_bias_half>
4545
mm->add_return({sqrt});
4646
return p;
4747
};
48+
49+
std::string section() const { return "reduce"; }
4850
};

test/verify/test_reduce_mean_large_half.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2015-2023 Advanced Micro Devices, Inc. All rights reserved.
4+
* Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved.
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -38,4 +38,6 @@ struct test_reduce_mean_large_half : verify_program<test_reduce_mean_large_half>
3838
mm->add_instruction(migraphx::make_op("reduce_mean", {{"axes", {2}}}), x);
3939
return p;
4040
};
41+
42+
std::string section() const { return "reduce"; }
4143
};

test/verify/test_reduce_mean_nhwc.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ struct test_reduce_mean_nhwc : verify_program<test_reduce_mean_nhwc<DType>>
4343
mm->add_return({sqrt});
4444
return p;
4545
};
46+
47+
std::string section() const { return "reduce"; }
4648
};
4749

4850
template struct test_reduce_mean_nhwc<migraphx::shape::float_type>;

test/verify/test_reduce_mean_reduce_sum.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,6 @@ struct test_reduce_mean_reduce_sum : verify_program<test_reduce_mean_reduce_sum>
5151
mm->add_return({mean_div2});
5252
return p;
5353
};
54+
55+
std::string section() const { return "reduce"; }
5456
};

test/verify/test_reduce_mean_variance.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,6 @@ struct test_reduce_mean_variance : verify_program<test_reduce_mean_variance>
4545
mm->add_return({add});
4646
return p;
4747
};
48+
49+
std::string section() const { return "reduce"; }
4850
};

test/verify/test_reduce_noop_add.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2015-2023 Advanced Micro Devices, Inc. All rights reserved.
4+
* Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved.
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -45,4 +45,6 @@ struct test_reduce_noop_add : verify_program<test_reduce_noop_add>
4545
mm->add_return({add});
4646
return p;
4747
};
48+
49+
std::string section() const { return "reduce"; }
4850
};

test/verify/test_reduce_op_large.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ struct test_reduce_op_large : verify_program<test_reduce_op_large<Op, Axis, T>>
4545
mm->add_instruction(Op{{Axis}}, x);
4646
return p;
4747
};
48+
49+
std::string section() const { return "reduce"; }
4850
};
4951

5052
template struct test_reduce_op_large<migraphx::op::reduce_max, 1, migraphx::shape::float_type>;

test/verify/test_reduce_op_small.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ struct test_reduce_op_small : verify_program<test_reduce_op_small<Op, Axis, T>>
4545
mm->add_instruction(Op{{Axis}}, x);
4646
return p;
4747
};
48+
49+
std::string section() const { return "reduce"; }
4850
};
4951

5052
template struct test_reduce_op_small<migraphx::op::reduce_sum, 1, migraphx::shape::float_type>;

test/verify/test_select_module_reduce.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2015-2023 Advanced Micro Devices, Inc. All rights reserved.
4+
* Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved.
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -66,4 +66,6 @@ struct test_select_module_reduce : verify_program<test_select_module_reduce>
6666

6767
return p;
6868
}
69+
70+
std::string section() const { return "reduce"; }
6971
};

test/verify/test_softmax.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ struct test_softmax : verify_program<test_softmax<Axis, T>>
4040

4141
return p;
4242
}
43+
44+
std::string section() const { return "reduce"; }
4345
};
4446

4547
template struct test_softmax<0, migraphx::shape::float_type>;

test/verify/test_softmax1.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
4+
* Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved.
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -37,4 +37,6 @@ struct test_softmax1 : verify_program<test_softmax1>
3737
mm->add_instruction(migraphx::make_op("softmax", {{"axis", 0}}), x);
3838
return p;
3939
}
40+
41+
std::string section() const { return "reduce"; }
4042
};

test/verify/test_softmax2.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
4+
* Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved.
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -38,4 +38,6 @@ struct test_softmax2 : verify_program<test_softmax2>
3838
mm->add_instruction(migraphx::make_op("softmax"), x);
3939
return p;
4040
}
41+
42+
std::string section() const { return "reduce"; }
4143
};

test/verify/test_softmax3.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
4+
* Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved.
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -41,4 +41,6 @@ struct test_softmax3 : verify_program<test_softmax3>
4141
mm->add_return({r});
4242
return p;
4343
}
44+
45+
std::string section() const { return "reduce"; }
4446
};

test/verify/test_softmax4.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2015-2023 Advanced Micro Devices, Inc. All rights reserved.
4+
* Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved.
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -38,4 +38,6 @@ struct test_softmax4 : verify_program<test_softmax4>
3838
mm->add_instruction(migraphx::make_op("softmax", {{"axis", 3}}), x);
3939
return p;
4040
}
41+
42+
std::string section() const { return "reduce"; }
4143
};

test/verify/test_softmax_large1.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
4+
* Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved.
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -40,4 +40,6 @@ struct test_softmax_large1 : verify_program<test_softmax_large1>
4040
mm->add_instruction(migraphx::make_op("softmax", {{"axis", -1}}), add);
4141
return p;
4242
}
43+
44+
std::string section() const { return "reduce"; }
4345
};

0 commit comments

Comments
 (0)