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
cffbd40a
"docs/en_US/Tutorial/WebUI.md" did not exist on "4c12435d06f20c56b3dfd5036149148ea587566e"
Commit
cffbd40a
authored
Aug 23, 2022
by
Khalique Ahmed
Browse files
testing diff eps value
parent
66d50268
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
src/include/migraphx/match/layernorm.hpp
src/include/migraphx/match/layernorm.hpp
+2
-1
src/targets/gpu/kernels/include/migraphx/kernels/layernorm.hpp
...argets/gpu/kernels/include/migraphx/kernels/layernorm.hpp
+2
-2
No files found.
src/include/migraphx/match/layernorm.hpp
View file @
cffbd40a
...
@@ -51,7 +51,8 @@ struct layernorm_matcher
...
@@ -51,7 +51,8 @@ struct layernorm_matcher
return
f
(
"div"
)(
arg
(
0
)(
x_minus_mean
()),
return
f
(
"div"
)(
arg
(
0
)(
x_minus_mean
()),
arg
(
1
)(
skip_broadcasts
(
f
(
"sqrt"
)(
arg
(
1
)(
skip_broadcasts
(
f
(
"sqrt"
)(
arg
(
0
)(
f
(
"add"
)(
either_arg
(
0
,
1
)(
variance
(),
has_value
(
1e-12
f
))))))));
arg
(
0
)(
f
(
"add"
)(
either_arg
(
0
,
1
)(
variance
(),
is_constant
())))))));
// 71.7596/sec
// arg(0)(f("add")(either_arg(0, 1)(variance(), has_value(1e-12f)))))))); // 70.8157/sec
}
}
auto
matcher
()
const
{
return
layernorm_onnx
();
}
auto
matcher
()
const
{
return
layernorm_onnx
();
}
...
...
src/targets/gpu/kernels/include/migraphx/kernels/layernorm.hpp
View file @
cffbd40a
...
@@ -61,8 +61,8 @@ __device__ void generic_binary_layernorm(
...
@@ -61,8 +61,8 @@ __device__ void generic_binary_layernorm(
r
.
inner
([
&
](
auto
&
y
,
auto
x1
,
auto
x2
,
auto
...
xs
)
{
r
.
inner
([
&
](
auto
&
y
,
auto
x1
,
auto
x2
,
auto
...
xs
)
{
auto
x
=
op
(
x1
,
x2
);
auto
x
=
op
(
x1
,
x2
);
auto
m
=
x
-
mean_x
;
auto
m
=
x
-
mean_x
;
// m * rsqrt(mean(m ^ 2) + 1
e-12
)
// m * rsqrt(mean(m ^ 2) + 1
.00136e-05
)
y
=
compute
(
m
*
rsqrt
(
mean_x2
-
mean_x
+
value_type
{
1
e-12
}),
xs
...);
y
=
compute
(
m
*
rsqrt
(
mean_x2
-
mean_x
+
value_type
{
1
.00136e-05
}),
xs
...);
})(
output
,
input1
,
input2
,
inputs
...);
})(
output
,
input1
,
input2
,
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