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
bcc1f64a
Unverified
Commit
bcc1f64a
authored
Apr 28, 2023
by
Charlie Lin
Committed by
GitHub
Apr 28, 2023
Browse files
Removed split_single_dyn_dim compile flag (#1711)
parent
c017743a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
26 deletions
+12
-26
doc/src/driver/compile.rst
doc/src/driver/compile.rst
+0
-4
examples/migraphx/migraphx_driver/README.md
examples/migraphx/migraphx_driver/README.md
+0
-1
src/driver/main.cpp
src/driver/main.cpp
+0
-5
src/include/migraphx/compile_options.hpp
src/include/migraphx/compile_options.hpp
+0
-3
src/split_single_dyn_dim.cpp
src/split_single_dyn_dim.cpp
+10
-4
src/targets/gpu/target.cpp
src/targets/gpu/target.cpp
+2
-2
test/verify/test_split_single_dyn_dim.cpp
test/verify/test_split_single_dyn_dim.cpp
+0
-7
No files found.
doc/src/driver/compile.rst
View file @
bcc1f64a
...
@@ -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
...
...
examples/migraphx/migraphx_driver/README.md
View file @
bcc1f64a
...
@@ -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 |
...
...
src/driver/main.cpp
View file @
bcc1f64a
...
@@ -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
));
}
}
...
...
src/include/migraphx/compile_options.hpp
View file @
bcc1f64a
...
@@ -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
{};
};
};
...
...
src/split_single_dyn_dim.cpp
View file @
bcc1f64a
...
@@ -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
);
...
...
src/targets/gpu/target.cpp
View file @
bcc1f64a
...
@@ -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
{},
...
...
test/verify/test_split_single_dyn_dim.cpp
View file @
bcc1f64a
...
@@ -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
;
};
};
};
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