Commit 04efdb44 authored by Umang Yadav's avatar Umang Yadav
Browse files

add test for conv_bn with 1e-1f

parent 67a5ba86
...@@ -43,12 +43,11 @@ struct test_conv_bn : verify_program<test_conv_bn<DType>> ...@@ -43,12 +43,11 @@ struct test_conv_bn : verify_program<test_conv_bn<DType>>
auto x = mm->add_parameter("x", xs); auto x = mm->add_parameter("x", xs);
auto w = mm->add_parameter("w", ws); auto w = mm->add_parameter("w", ws);
// non-symmetrical tiling // non-symmetrical tiling
// auto conv = mm->add_instruction( auto conv = mm->add_instruction(
// migraphx::make_op("convolution", migraphx::make_op("convolution",
// {{"padding", {3, 3}}, {"stride", {2, 2}}, {"dilation", {1, 1}}}), {{"padding", {3, 3}}, {"stride", {2, 2}}, {"dilation", {1, 1}}}),
// x, x,
// w); w);
auto conv = mm->add_parameter("conv", migraphx::shape{DType, {1, 64, 112, 112}});
auto scale = mm->add_literal(migraphx::abs(migraphx::generate_literal(vars, 1))); auto scale = mm->add_literal(migraphx::abs(migraphx::generate_literal(vars, 1)));
auto bias = mm->add_literal(migraphx::abs(migraphx::generate_literal(vars, 2))); auto bias = mm->add_literal(migraphx::abs(migraphx::generate_literal(vars, 2)));
...@@ -56,7 +55,12 @@ struct test_conv_bn : verify_program<test_conv_bn<DType>> ...@@ -56,7 +55,12 @@ struct test_conv_bn : verify_program<test_conv_bn<DType>>
auto variance = mm->add_literal(migraphx::abs(migraphx::generate_literal(vars, 4))); auto variance = mm->add_literal(migraphx::abs(migraphx::generate_literal(vars, 4)));
auto rt = mm->add_literal(migraphx::literal{DType, {0.5}}); auto rt = mm->add_literal(migraphx::literal{DType, {0.5}});
auto eps = mm->add_literal(migraphx::literal{DType, {1e-5f}}); auto eps = mm->add_literal(migraphx::literal{DType, {1e-5f}});
if constexpr((DType) == migraphx::shape::fp8e4m3fnuz_type)
{
eps = mm->add_literal(migraphx::literal{DType, {1e-1f}});
}
auto usq_scale = auto usq_scale =
mm->add_instruction(migraphx::make_op("unsqueeze", {{"axes", {1, 2}}}), scale); mm->add_instruction(migraphx::make_op("unsqueeze", {{"axes", {1, 2}}}), scale);
......
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