Unverified Commit bcc1f64a authored by Charlie Lin's avatar Charlie Lin Committed by GitHub
Browse files

Removed split_single_dyn_dim compile flag (#1711)

parent c017743a
...@@ -32,10 +32,6 @@ Disable fast math optimization ...@@ -32,10 +32,6 @@ Disable fast math optimization
Perform an exhaustive search to find the fastest version of generated kernels for selected backend Perform an exhaustive search to find the fastest version of generated kernels for selected backend
.. options:: --split-single-dyn-dim
Enable the split single dynamic dimension pass
.. option:: --fp16 .. option:: --fp16
Quantize for fp16 Quantize for fp16
......
...@@ -53,7 +53,6 @@ See below for a comprehensive list of commands and option arguments, as well as ...@@ -53,7 +53,6 @@ See below for a comprehensive list of commands and option arguments, as well as
| --enable-offload-copy | Enable implicit offload copying | | --enable-offload-copy | Enable implicit offload copying |
| --disable-fast-math | Disable fast math optimization | | --disable-fast-math | Disable fast math optimization |
| --exhaustive-tune | Enable exhaustive search to find fastest kernel | | --exhaustive-tune | Enable exhaustive search to find fastest kernel |
| --split-single-dyn-dim | Enable split_single_dyn_dim compiler pass |
| --fp16 | Quantize for fp16 | | --fp16 | Quantize for fp16 |
| --int8 | Quantize for int8 | | --int8 | Quantize for int8 |
| --tolerance | Tolerance for errors | | --tolerance | Tolerance for errors |
......
...@@ -436,11 +436,6 @@ struct compiler ...@@ -436,11 +436,6 @@ struct compiler
{"--exhaustive-tune"}, {"--exhaustive-tune"},
ap.help("Exhastively search for best tuning parameters for kernels"), ap.help("Exhastively search for best tuning parameters for kernels"),
ap.set_value(true)); ap.set_value(true));
ap(co.split_single_dyn_dim,
{"--split-single-dyn-dim"},
ap.help("If there is a single non-fixed dynamic dimension in the model, then split to "
"static submodules"),
ap.set_value(true));
ap(quantize, {"--fp16"}, ap.help("Quantize for fp16"), ap.set_value(precision::fp16)); ap(quantize, {"--fp16"}, ap.help("Quantize for fp16"), ap.set_value(precision::fp16));
ap(quantize, {"--int8"}, ap.help("Quantize for int8"), ap.set_value(precision::int8)); ap(quantize, {"--int8"}, ap.help("Quantize for int8"), ap.set_value(precision::int8));
} }
......
...@@ -40,9 +40,6 @@ struct compile_options ...@@ -40,9 +40,6 @@ struct compile_options
bool fast_math = true; bool fast_math = true;
bool exhaustive_tune = false; bool exhaustive_tune = false;
/// Use the split_single_dyn_dim pass
bool split_single_dyn_dim = false;
tracer trace{}; tracer trace{};
}; };
......
...@@ -100,10 +100,10 @@ struct find_static_2in_broadcasts ...@@ -100,10 +100,10 @@ struct find_static_2in_broadcasts
} // namespace } // namespace
/** /**
* Makes all the shapes in the dynamic_dimension range. * Makes all the shapes in the dynamic_dimension range. Probably won't work for `if`
* Probably won't work for `if` and `loop` instructions, depending on how the submodules for those * and `loop` instructions, depending on how the submodules for those
* work. Inserts select_module instruction to the top. Replaces return, bypassing other * work. Inserts select_module instruction to the top. Replaces return, bypassing other
* instructions. * instructions. Skips if the dynamic parameter outputs to a select_module operator.
*/ */
void split_single_dyn_dim::apply(module_pass_manager& mpm) const void split_single_dyn_dim::apply(module_pass_manager& mpm) const
{ {
...@@ -111,7 +111,13 @@ void split_single_dyn_dim::apply(module_pass_manager& mpm) const ...@@ -111,7 +111,13 @@ void split_single_dyn_dim::apply(module_pass_manager& mpm) const
auto param_names = mm->get_parameter_names(); auto param_names = mm->get_parameter_names();
auto param_shapes = mm->get_parameter_shapes(); auto param_shapes = mm->get_parameter_shapes();
optional<dynamic_dimensions_check> dd_check = has_one_dyn_dim(param_shapes); optional<dynamic_dimensions_check> dd_check = has_one_dyn_dim(param_shapes);
if(dd_check.has_value()) auto any_sm_next = [&](auto ddc) {
auto p_outputs = mm->get_parameter(ddc->dyn_param_str)->outputs();
return std::any_of(p_outputs.cbegin(), p_outputs.cend(), [](auto ins) {
return ins->name() == "select_module";
});
};
if(dd_check.has_value() and not any_sm_next(dd_check))
{ {
const auto& dyn_param = mm->get_parameter(dd_check->dyn_param_str); const auto& dyn_param = mm->get_parameter(dd_check->dyn_param_str);
auto dyn_param_shape = mm->get_parameter_shape(dd_check->dyn_param_str); auto dyn_param_shape = mm->get_parameter_shape(dd_check->dyn_param_str);
......
...@@ -101,8 +101,8 @@ std::vector<pass> target::get_passes(migraphx::context& gctx, const compile_opti ...@@ -101,8 +101,8 @@ std::vector<pass> target::get_passes(migraphx::context& gctx, const compile_opti
// clang-format off // clang-format off
return return
{ {
enable_pass(options.split_single_dyn_dim, split_single_dyn_dim{}), split_single_dyn_dim{},
enable_pass(options.split_single_dyn_dim, dead_code_elimination{}), dead_code_elimination{},
normalize_ops{}, normalize_ops{},
dead_code_elimination{}, dead_code_elimination{},
simplify_qdq{}, simplify_qdq{},
......
...@@ -46,11 +46,4 @@ struct test_split_single_dyn_dim : verify_program<test_split_single_dyn_dim> ...@@ -46,11 +46,4 @@ struct test_split_single_dyn_dim : verify_program<test_split_single_dyn_dim>
mm->add_return({add_ins}); mm->add_return({add_ins});
return p; return p;
} }
migraphx::compile_options get_compile_options() const
{
migraphx::compile_options co;
co.split_single_dyn_dim = true;
return co;
};
}; };
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