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
ae13eb93
"docs/vscode:/vscode.git/clone" did not exist on "74e5ea90a04276ba93f99fad21d2f49e91a85149"
Commit
ae13eb93
authored
Nov 23, 2022
by
Paul
Browse files
Format
parent
9080a1df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
src/include/migraphx/match/layernorm.hpp
src/include/migraphx/match/layernorm.hpp
+3
-2
src/targets/gpu/prefuse_ops.cpp
src/targets/gpu/prefuse_ops.cpp
+3
-3
No files found.
src/include/migraphx/match/layernorm.hpp
View file @
ae13eb93
...
@@ -49,9 +49,10 @@ struct layernorm_matcher
...
@@ -49,9 +49,10 @@ struct layernorm_matcher
auto
layernorm_onnx
()
const
auto
layernorm_onnx
()
const
{
{
auto
add_eps
=
f
(
"add"
)(
either_arg
(
0
,
1
)(
variance
(),
is_constant
().
bind
(
"eps"
)));
auto
add_eps
=
f
(
"add"
)(
either_arg
(
0
,
1
)(
variance
(),
is_constant
().
bind
(
"eps"
)));
return
f
(
"div"
)(
arg
(
0
)(
x_minus_mean
()),
return
f
(
"div"
)(
arg
(
0
)(
x_minus_mean
()),
arg
(
1
)(
skip_broadcasts
(
f
(
"sqrt"
)(
arg
(
0
)(
match
::
any_of
(
add_eps
,
variance
()))))));
arg
(
1
)(
skip_broadcasts
(
f
(
"sqrt"
)(
arg
(
0
)(
match
::
any_of
(
add_eps
,
variance
()))))));
}
}
auto
matcher
()
const
{
return
layernorm_onnx
();
}
auto
matcher
()
const
{
return
layernorm_onnx
();
}
...
...
src/targets/gpu/prefuse_ops.cpp
View file @
ae13eb93
...
@@ -104,9 +104,9 @@ struct find_add_layernorm
...
@@ -104,9 +104,9 @@ struct find_add_layernorm
{
{
auto
ins
=
r
.
result
;
auto
ins
=
r
.
result
;
auto
add_ins
=
r
.
instructions
[
"add"
];
auto
add_ins
=
r
.
instructions
[
"add"
];
float
eps
=
0
;
float
eps
=
0
;
if
(
contains
(
r
.
instructions
,
"eps"
))
if
(
contains
(
r
.
instructions
,
"eps"
))
eps
=
r
.
instructions
[
"eps"
]
->
eval
().
at
<
float
>
();
eps
=
r
.
instructions
[
"eps"
]
->
eval
().
at
<
float
>
();
m
.
replace_instruction
(
ins
,
add_layernorm
{
eps
},
add_ins
->
inputs
());
m
.
replace_instruction
(
ins
,
add_layernorm
{
eps
},
add_ins
->
inputs
());
}
}
...
...
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