mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
[ROCm][layer_norm] Use __builtin_amdgcn_rcpf(x) instead of 1.f/x (#165589)
Replace (more) exact calculation with hardware approximation. Benefits: Reduced code size. Improved performance for certain scenarios. Experiments show low reduction in precision. Experiments show no significant performance regressions. bfloat16 as well as float16 related calculations may benefit largely from this change. Co-author: @mhalk @amd-hhashemi Pull Request resolved: https://github.com/pytorch/pytorch/pull/165589 Approved by: https://github.com/jeffdaily
This commit is contained in:
committed by
PyTorch MergeBot
parent
9fe3b2afbe
commit
202f83dc4e
4
setup.py
4
setup.py
@ -156,6 +156,10 @@
|
||||
# USE_ROCM_KERNEL_ASSERT=1
|
||||
# Enable kernel assert in ROCm platform
|
||||
#
|
||||
# USE_LAYERNORM_FAST_RECIPROCAL
|
||||
# If set, enables the use of builtin functions for fast reciprocals (1/x) w.r.t.
|
||||
# layer normalization. Default: enabled.
|
||||
#
|
||||
# USE_ROCM_CK_GEMM=1
|
||||
# Enable building CK GEMM backend in ROCm platform
|
||||
#
|
||||
|
Reference in New Issue
Block a user