Saved in:
Bibliographic Details
Main Authors: Narayanaswami, Sai Kiran, Srinivasan, Gopalakrishnan, Ravindran, Balaraman
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2412.00408
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915042280079360
author Narayanaswami, Sai Kiran
Srinivasan, Gopalakrishnan
Ravindran, Balaraman
author_facet Narayanaswami, Sai Kiran
Srinivasan, Gopalakrishnan
Ravindran, Balaraman
contents As machine learning gets deployed more and more widely, and model sizes continue to grow, improving computational efficiency during model inference has become a key challenge. In many commonly used model architectures, including Transformers, a significant portion of the inference computation is comprised of exponential non-linearities such as Softmax. In this work, we develop QuAKE, a collection of novel operators that leverage certain properties of IEEE-754 floating point representations to quickly approximate the exponential function without requiring specialized hardware, extra memory, or precomputation. We propose optimizations that enhance the efficiency of QuAKE in commonly used exponential non-linearities such as Softmax, GELU, and the Logistic function. Our benchmarks demonstrate substantial inference speed improvements between 10% and 35% on server CPUs, and 5% and 45% on embedded and mobile-scale CPUs for a variety of model architectures and sizes. Evaluations of model performance on standard datasets and tasks from various domains show that QuAKE operators are able to provide sizable speed benefits with little to no loss of performance on downstream tasks.
format Preprint
id arxiv_https___arxiv_org_abs_2412_00408
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle QuAKE: Speeding up Model Inference Using Quick and Approximate Kernels for Exponential Non-Linearities
Narayanaswami, Sai Kiran
Srinivasan, Gopalakrishnan
Ravindran, Balaraman
Machine Learning
Numerical Analysis
Neural and Evolutionary Computing
As machine learning gets deployed more and more widely, and model sizes continue to grow, improving computational efficiency during model inference has become a key challenge. In many commonly used model architectures, including Transformers, a significant portion of the inference computation is comprised of exponential non-linearities such as Softmax. In this work, we develop QuAKE, a collection of novel operators that leverage certain properties of IEEE-754 floating point representations to quickly approximate the exponential function without requiring specialized hardware, extra memory, or precomputation. We propose optimizations that enhance the efficiency of QuAKE in commonly used exponential non-linearities such as Softmax, GELU, and the Logistic function. Our benchmarks demonstrate substantial inference speed improvements between 10% and 35% on server CPUs, and 5% and 45% on embedded and mobile-scale CPUs for a variety of model architectures and sizes. Evaluations of model performance on standard datasets and tasks from various domains show that QuAKE operators are able to provide sizable speed benefits with little to no loss of performance on downstream tasks.
title QuAKE: Speeding up Model Inference Using Quick and Approximate Kernels for Exponential Non-Linearities
topic Machine Learning
Numerical Analysis
Neural and Evolutionary Computing
url https://arxiv.org/abs/2412.00408