English

K-TanH: Efficient TanH For Deep Learning

Machine Learning 2020-06-09 v3 Neural and Evolutionary Computing Machine Learning

Abstract

We propose K-TanH, a novel, highly accurate, hardware efficient approximation of popular activation function TanH for Deep Learning. K-TanH consists of parameterized low-precision integer operations, such as, shift and add/subtract (no floating point operation needed) where parameters are stored in very small look-up tables that can fit in CPU registers. K-TanH can work on various numerical formats, such as, Float32 and BFloat16. High quality approximations to other activation functions, e.g., Sigmoid, Swish and GELU, can be derived from K-TanH. Our AVX512 implementation of K-TanH demonstrates >5×>5\times speed up over Intel SVML, and it is consistently superior in efficiency over other approximations that use floating point arithmetic. Finally, we achieve state-of-the-art Bleu score and convergence results for training language translation model GNMT on WMT16 data sets with approximate TanH obtained via K-TanH on BFloat16 inputs.

Cite

@article{arxiv.1909.07729,
  title  = {K-TanH: Efficient TanH For Deep Learning},
  author = {Abhisek Kundu and Alex Heinecke and Dhiraj Kalamkar and Sudarshan Srinivasan and Eric C. Qin and Naveen K. Mellempudi and Dipankar Das and Kunal Banerjee and Bharat Kaul and Pradeep Dubey},
  journal= {arXiv preprint arXiv:1909.07729},
  year   = {2020}
}

Comments

6 pages, 1 figures

R2 v1 2026-06-23T11:17:46.084Z