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
122ffe97
Commit
122ffe97
authored
Jul 11, 2023
by
Khalique Ahmed
Browse files
debugging
parent
75bb9a6f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
9 deletions
+22
-9
src/auto_contiguous.cpp
src/auto_contiguous.cpp
+17
-5
src/layout_nhwc.cpp
src/layout_nhwc.cpp
+2
-2
src/targets/gpu/fuse_ops.cpp
src/targets/gpu/fuse_ops.cpp
+2
-2
src/targets/gpu/target.cpp
src/targets/gpu/target.cpp
+1
-0
No files found.
src/auto_contiguous.cpp
View file @
122ffe97
...
...
@@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "migraphx/instruction_ref.hpp"
#include <migraphx/auto_contiguous.hpp>
#include <migraphx/program.hpp>
#include <migraphx/instruction.hpp>
...
...
@@ -64,13 +65,24 @@ void auto_contiguous::apply(module& m) const
// for last instruction that is NOT a return
if
(
ins
->
outputs
().
empty
()
and
ins
!=
last
)
continue
;
shape
s
=
ins
->
get_shape
();
if
((
ins
->
name
()
==
"pooling"
or
ins
->
name
()
==
"dot"
)
and
not
s
.
dynamic
()
and
not
s
.
standard
()
and
s
.
elements
()
!=
0
)
if
(
ins
->
name
()
==
"pooling"
or
ins
->
name
()
==
"dot"
)
{
auto
c
=
m
.
insert_instruction
(
std
::
next
(
ins
),
make_op
(
"contiguous"
),
ins
);
m
.
replace_instruction
(
ins
,
c
);
// auto c = m.insert_instruction(ins, make_op("contiguous"), ins);
std
::
vector
<
instruction_ref
>
new_args
;
for
(
auto
args
:
ins
->
inputs
())
{
new_args
.
push_back
(
m
.
insert_instruction
(
ins
,
make_op
(
"contiguous"
),
args
));
}
auto
op
=
m
.
insert_instruction
(
ins
,
ins
->
get_operator
(),
new_args
);
m
.
replace_instruction
(
ins
,
op
);
}
// shape s = ins->get_shape();
// if(not s.dynamic() and
// not s.standard() and s.elements() != 0)
// {
// auto c = m.insert_instruction(std::next(ins), make_op("contiguous"), ins);
// m.replace_instruction(ins, c);
// }
}
}
...
...
src/layout_nhwc.cpp
View file @
122ffe97
...
...
@@ -143,8 +143,8 @@ void layout_nhwc::apply(module_pass_manager& mpm) const
mpm
.
get_module
().
debug_print
();
transform_convolutions
(
mpm
.
get_module
(),
this
->
skip_elim_contiguous
);
mpm
.
run_pass
(
dead_code_elimination
{});
if
(
not
this
->
skip_elim_contiguous
)
mpm
.
run_pass
(
eliminate_contiguous
{
"contiguous"
});
//
if(not this->skip_elim_contiguous)
//
mpm.run_pass(eliminate_contiguous{"contiguous"});
mpm
.
run_pass
(
dead_code_elimination
{});
// remove_layout(mpm.get_module(), output_layouts);
// mpm.run_pass(dead_code_elimination{});
...
...
src/targets/gpu/fuse_ops.cpp
View file @
122ffe97
...
...
@@ -842,7 +842,7 @@ struct find_concat_pointwise
void
fuse_ops
::
apply
(
module
&
m
)
const
{
match
::
find_matches
(
m
,
find_contiguous_pointwise
{});
//
match::find_matches(m, find_contiguous_pointwise{});
run_passes
(
m
,
{
dead_code_elimination
{}});
match
::
find_matches
(
m
,
find_conv_pointwise
{
ctx
},
find_conv_bias_relu
{
ctx
},
find_conv_bias
{
ctx
});
run_passes
(
m
,
{
dead_code_elimination
{}});
...
...
@@ -852,7 +852,7 @@ void fuse_ops::apply(module& m) const
find_gemm_pointwise
{},
find_contiguous_tranpose_gemm
{},
find_commutative_broadcast
{});
match
::
find_matches
(
m
,
find_contiguous
{});
//
match::find_matches(m, find_contiguous{});
}
}
// namespace gpu
...
...
src/targets/gpu/target.cpp
View file @
122ffe97
...
...
@@ -133,6 +133,7 @@ std::vector<pass> target::get_passes(migraphx::context& gctx, const compile_opti
prefuse_ops
{},
dead_code_elimination
{},
auto_contiguous
{},
dead_code_elimination
{},
optimize_module
{},
fuse_pointwise
{},
dead_code_elimination
{},
...
...
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