Fast Gauss Sums via Flash Attention
Gaussian kernel sums are the computational core of maximum mean discrepancies (MMDs), kernel gradient flows, Stein variational gradient descent (SVGD), and many other kernel methods. At the same time, softmax attention has received an extraordinary amount of hardware-aware code engineering, culminating in flash attention. We show that Gauss kernel sums with arbitrary, signed weights can be evaluated via flash attention: two small input augmentations turn the normalized softmax reduction into the unnormalized Gauss sum, without writing a single line of custom GPU code. For feature dimension D>8 in fp16, this approach beats compiled PyTorch code as well as PyKeOps kernels (often significantly) in speed, memory-overhead and accuracy. Indeed, its memory scaling remains linear.
Code (0)
등록된 구현이 없습니다.
Similar Papers 제목 키워드 기반
Pricing Bermudan Swaption under Two Factor Hull-White Model with Fast Gauss Transform
This paper describes a fast and stable algorithm for evaluating Bermudan swaption under the two factor Hull-White model. We discretize the calculation of the expected value in the evaluation of Bermudan swaption by numer…
Numerical IntegrationFastAttention: Extend FlashAttention2 to NPUs and Low-resource GPUs
FlashAttention series has been widely applied in the inference of large language models (LLMs). However, FlashAttention series only supports the high-level GPU architectures, e.g., Ampere and Hopper. At present, FlashAtt…
CPUGPUFlashAvatar: High-fidelity Head Avatar with Efficient Gaussian Embedding
We propose FlashAvatar, a novel and lightweight 3D animatable avatar representation that could reconstruct a digital avatar from a short monocular video sequence in minutes and render high-fidelity photo-realistic images…
Face ModelGPUINT-FlashAttention: Enabling Flash Attention for INT8 Quantization
As the foundation of large language models (LLMs), self-attention module faces the challenge of quadratic time and memory complexity with respect to sequence length. FlashAttention accelerates attention computation and r…
GPUQuantizationFlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
Transformers are slow and memory-hungry on long sequences, since the time and memory complexity of self-attention are quadratic in sequence length. Approximate attention methods have attempted to address this problem by …
16k4kDocument ClassificationGPU+2