Unverified Commit e09d54fe authored by kahmed10's avatar kahmed10 Committed by GitHub
Browse files

Gelu fp16 (#674)



* initial testing

* change tolerance

* remove extra changes
Co-authored-by: default avatarShucai Xiao <shucai.xiao@amd.com>
Co-authored-by: default avatarPaul Fultz II <pfultz2@yahoo.com>
Co-authored-by: default avatarmvermeulen <5479696+mvermeulen@users.noreply.github.com>
parent 1c417ae7
......@@ -373,8 +373,8 @@ struct find_gelu
match::used_once(),
match::arg(0)(match::used_once(),
match::name("gpu::mul")(match::either_arg(0, 1)(
match::none_of(match::has_value(M_SQRT1_2)).bind("x"),
match::has_value(M_SQRT1_2)))));
match::none_of(match::has_value(M_SQRT1_2, 1e-3)).bind("x"),
match::has_value(M_SQRT1_2, 1e-3)))));
}
static auto add_erf()
......@@ -436,7 +436,7 @@ struct find_gelu_new
return match::name("gpu::tanh")(
match::used_once(),
match::arg(0)(match::name("gpu::mul")(match::either_arg(0, 1)(
match::args(match::has_value(sqrt(M_2_PI))),
match::args(match::has_value(sqrt(M_2_PI), 1e-3)),
match::name("gpu::add")(
match::any_arg(0, 1)(match::name("gpu::mul")(match::either_arg(0, 1)(
match::args(match::has_value(0.044715f)), pow_fn()))))))));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment