-
Notifications
You must be signed in to change notification settings - Fork 357
[Op] Add FP32 fused l2 normalize op and grad op. #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
tensorflow/python/ops/nn_impl.py
Outdated
| @tf_export(v1=["math.l2_normalize", "linalg.l2_normalize", "nn.l2_normalize"]) | ||
| @deprecated_args(None, "dim is deprecated, use axis instead", "dim") | ||
| def l2_normalize(x, axis=None, epsilon=1e-12, name=None, dim=None): | ||
| def l2_normalize(x, axis=None, epsilon=1e-12, do_fusion=True, name=None, dim=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我建议这里不要在中间位置加参数,这样导致用户不得不改代码。新参数加到dim后面
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我建议这里还是不要改变原有l2_normalize的接口,我们既然新添了v2,就让v2默认打开fusion,并且保持v2有do_fusion这个可配置的参数
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v1版本去掉do_fusion只能默认启用或关闭了,那v1在调用v2接口的时候是默认启用还是关闭?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v1的行为是关闭的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
bazel test --action_env=TF_CPP_MIN_VLOG_LEVEL=1 --action_env=TF_CPP_MIN_LOG_LEVEL=0 --flaky_test_attempts 1 --test_output=all --nocache_test_results --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 --copt=-march=skylake-avx512 -- //tensorflow/core/kernels:fused_l2_normalize_ops_test
bazel test --action_env=TF_CPP_MIN_VLOG_LEVEL=1 --action_env=TF_CPP_MIN_LOG_LEVEL=0 --flaky_test_attempts 1 --test_output=all --nocache_test_results --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 --copt=-march=skylake-avx512 -- //tensorflow/python:nn_test
1f08039 to
dd05512
Compare
No description provided.