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
4d50c338
Commit
4d50c338
authored
Mar 31, 2023
by
Paul
Browse files
Fix used_once fusions
parent
60f852b3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
src/pass_manager.cpp
src/pass_manager.cpp
+1
-0
src/simplify_algebra.cpp
src/simplify_algebra.cpp
+1
-1
src/targets/gpu/fuse_ops.cpp
src/targets/gpu/fuse_ops.cpp
+3
-3
No files found.
src/pass_manager.cpp
View file @
4d50c338
...
@@ -94,6 +94,7 @@ struct module_pm : module_pass_manager
...
@@ -94,6 +94,7 @@ struct module_pm : module_pass_manager
virtual
module
*
get_common_parent
()
override
{
return
common_parent
;
}
virtual
module
*
get_common_parent
()
override
{
return
common_parent
;
}
virtual
void
run_pass
(
const
pass
&
p
)
override
virtual
void
run_pass
(
const
pass
&
p
)
override
{
{
trace
(
"Pass: "
,
p
.
name
());
assert
(
mod
);
assert
(
mod
);
assert
(
mod
->
validate
()
==
mod
->
end
());
assert
(
mod
->
validate
()
==
mod
->
end
());
if
(
enabled
(
MIGRAPHX_TIME_PASSES
{}))
if
(
enabled
(
MIGRAPHX_TIME_PASSES
{}))
...
...
src/simplify_algebra.cpp
View file @
4d50c338
...
@@ -270,7 +270,7 @@ struct find_dot_mul
...
@@ -270,7 +270,7 @@ struct find_dot_mul
auto
matcher
()
const
auto
matcher
()
const
{
{
auto
const_broadcast
=
match
::
name
(
"broadcast"
,
"multibroadcast"
)(
match
::
is_constant
());
auto
const_broadcast
=
match
::
name
(
"broadcast"
,
"multibroadcast"
)(
match
::
is_constant
());
auto
mul
=
match
::
name
(
"mul"
)(
match
::
either_arg
(
0
,
1
)(
auto
mul
=
match
::
name
(
"mul"
)(
match
::
used_once
(),
match
::
either_arg
(
0
,
1
)(
const_broadcast
.
bind
(
"d"
),
match
::
none_of
(
match
::
is_constant
()).
bind
(
"z"
)));
const_broadcast
.
bind
(
"d"
),
match
::
none_of
(
match
::
is_constant
()).
bind
(
"z"
)));
return
match
::
name
(
"dot"
)(
match
::
either_arg
(
0
,
1
)(
mul
,
match
::
is_constant
().
bind
(
"c"
)));
return
match
::
name
(
"dot"
)(
match
::
either_arg
(
0
,
1
)(
mul
,
match
::
is_constant
().
bind
(
"c"
)));
}
}
...
...
src/targets/gpu/fuse_ops.cpp
View file @
4d50c338
...
@@ -770,7 +770,7 @@ struct find_contiguous_pointwise
...
@@ -770,7 +770,7 @@ struct find_contiguous_pointwise
{
{
auto
matcher
()
const
auto
matcher
()
const
{
{
return
match
::
name
(
"gpu::contiguous"
)(
match
::
arg
(
0
)(
precompile_name
(
"pointwise"
)));
return
match
::
name
(
"gpu::contiguous"
)(
match
::
arg
(
0
)(
precompile_name
(
"pointwise"
)
(
match
::
used_once
())
));
}
}
void
apply
(
module
&
m
,
const
match
::
matcher_result
&
r
)
const
void
apply
(
module
&
m
,
const
match
::
matcher_result
&
r
)
const
...
@@ -790,7 +790,7 @@ struct find_layernorm_pointwise
...
@@ -790,7 +790,7 @@ struct find_layernorm_pointwise
auto
matcher
()
const
auto
matcher
()
const
{
{
return
precompile_name
(
"pointwise"
)(
match
::
arg
(
0
)(
return
precompile_name
(
"pointwise"
)(
match
::
arg
(
0
)(
precompile_name
(
"gpu::prelayernorm"
,
"gpu::preadd_layernorm"
).
bind
(
"layernorm"
)));
precompile_name
(
"gpu::prelayernorm"
,
"gpu::preadd_layernorm"
)
(
match
::
used_once
())
.
bind
(
"layernorm"
)));
}
}
void
apply
(
module
&
m
,
const
match
::
matcher_result
&
r
)
const
void
apply
(
module
&
m
,
const
match
::
matcher_result
&
r
)
const
...
@@ -813,7 +813,7 @@ struct find_concat_pointwise
...
@@ -813,7 +813,7 @@ struct find_concat_pointwise
auto
matcher
()
const
auto
matcher
()
const
{
{
return
precompile_name
(
"pointwise"
)(
return
precompile_name
(
"pointwise"
)(
match
::
arg
(
0
)(
precompile_name
(
"concat"
).
bind
(
"concat"
)));
match
::
arg
(
0
)(
precompile_name
(
"concat"
)
(
match
::
used_once
())
.
bind
(
"concat"
)));
}
}
void
apply
(
module
&
m
,
const
match
::
matcher_result
&
r
)
const
void
apply
(
module
&
m
,
const
match
::
matcher_result
&
r
)
const
...
...
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