analiza aiqbench
This research demonstrates how Flash Attention mechanisms can be repurposed to accelerate Gaussian kernel sums, which are fundamental to various kernel methods like MMDs and SVGD. By leveraging existing hardware-aware optimizations for softmax attention, the authors achieve significant speedups in memory usage and accuracy without requiring custom GPU code. This work bridges the gap between transformer-specific optimizations and broader machine learning computational needs.
Fast Gauss Sums via Flash Attention
De la arXiv
Text integralGaussian 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.
Text integral sub licența deschisă a publicației · 113 cuvinte