惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
Apple Machine Learning Research
Apple Machine Learning Research
O
OpenAI News
酷 壳 – CoolShell
酷 壳 – CoolShell
The GitHub Blog
The GitHub Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 聂微东
Engineering at Meta
Engineering at Meta
W
WeLiveSecurity
Hacker News: Ask HN
Hacker News: Ask HN
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News
D
Docker
F
Full Disclosure
AI
AI
罗磊的独立博客
博客园 - 【当耐特】
U
Unit 42
S
SegmentFault 最新的问题
Stack Overflow Blog
Stack Overflow Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
P
Palo Alto Networks Blog
博客园_首页
H
Help Net Security
量子位
月光博客
月光博客
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 司徒正美
F
Fortinet All Blogs
D
DataBreaches.Net
B
Blog RSS Feed
Webroot Blog
Webroot Blog
TaoSecurity Blog
TaoSecurity Blog
S
Secure Thoughts
爱范儿
爱范儿
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Attack and Defense Labs
Attack and Defense Labs
Application and Cybersecurity Blog
Application and Cybersecurity Blog
C
CERT Recently Published Vulnerability Notes
Martin Fowler
Martin Fowler
Blog — PlanetScale
Blog — PlanetScale
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Securelist

cs.DS updates on arXiv.org

PAC Learning with Bandit Feedback: Sharp Sample Complexity in the Realizable Setting Algorithms with Polynomially-Improved Approximation Factors for the $2 \rightarrow q$ Norm, and Applications A computational phase transition for learning-to-sample from Ising models Covering vertices by sequential stars Fermi-Dirac machines as quantizations of neurons A Comprehensive Evaluation of Vertex Elimination Algorithms for Algorithmic Differentiation A Tight Bound on Localization of Electrical Flows Optimal Dimension-Free Sampling for Regularized Classification Reducing the Randomness in Partition Oracles for Bounded Degree Minor-Free Graphs Beyond the Half-Approximation: Fair and Efficient Online Class Matching Efficient Uniform Sampling of Surjections via their Profiles Tractable Maximization of Budgeted Phylogenetic Diversity on Networks Utilizing Node Scanwidth Fairness in Aggregation: Optimal Top-$k$ and Improved Full Ranking Learning-Augmented Online Scheduling with Parsimonious Preemption Entropy Equivalence Testing Lumberjack: Better Differentially Private Random Forests through Heavy Hitter Detection in Trees The Secretary Problem with a Stochastic Precursor Polynomial-Time Robust Multiclass Linear Classification under Gaussian Marginals Efficient Banzhaf-Based Data Valuation for $k$-Nearest Neighbors Classification Block-Sphere Vector Quantization An Approximation Algorithm for Graph Label Selection Iterative Chow Filtering for Learning with Distribution Shift Complexity of Non-Log-Concave Sampling in Fisher Information Stochastic Matching via Local Sparsification Finite Sample Bounds for Learning with Score Matching What is Learnable in Valiant's Theory of the Learnable? Provable Quantization with Randomized Hadamard Transform Min-Max Optimization Requires Exponentially Many Queries Fast and Compact Graph Cuts for the Boykov-Kolmogorov Algorithm A proximal gradient algorithm for composite log-concave sampling Adaptive Multi-Round Allocation with Stochastic Arrivals The tractability landscape of diffusion alignment: regularization, rewards, and computational primitives Mistake-Bounded Language Generation Positional LSH: Binary Block Matrix Approximation for Attention with Linear Biases Learning-Augmented Scalable Linear Assignment Problem Optimization via Neural Dual Warm-Starts A Note on Non-Negative $L_1$-Approximating Polynomials Curvature Beyond Positivity: Greedy Guarantees for Arbitrary Submodular Functions Convex Optimization with Nested Evolving Feasible Sets On the Complexity of the Matching Problem of Regular Expressions with Backreferences Simple KNN-Based Outlier Detection Achieves Robust Clustering Online Allocation with Unknown Shared Supply Equivalence of Coarse and Fine-Grained Models for Learning with Distribution Shift Accelerated Relax-and-Round for Concave Coverage Problems Contrastive Identification and Generation in the Limit Quantizing With Randomized Hadamard Transforms: Efficient Heuristic Now Proven Nearly Optimal Attention Coresets On Computing Total Variation Distance Between Mixtures of Product Distributions Exact and Approximate Algorithms for Polytree Learning Provable Accuracy Collapse in Embedding-Based Representations under Dimensionality Mismatch New Bounds for Kernel Sums via Fast Spherical Embeddings Unlearning Offline Stochastic Multi-Armed Bandits Matroid Algorithms Under Size-Sensitive Independence Oracles On the Learning Curves of Revenue Maximization Asymptotically Robust Learning-Augmented Algorithms for Preemptive FIFO Buffer Management Flashback: A Reversible Bilateral Run-Peeling Decomposition of Strings Incremental Strongly Connected Components with Predictions Characterizing Admissible Objective Functions for Hierarchical Clustering Well-Conditioned Oblivious Perturbations in Linear Space Mathematical Foundations for Peer-to-Peer Lattice Computation Graph Neural Network-Informed Predictive Flows for Faster Ford-Fulkerson and PAC-Learnability A weighted angle distance on strings Towards Universal Convergence of Backward Error in Linear System Solvers Constant-Factor Approximations for Doubly Constrained Fair k-Center, k-Median and k-Means Tight Bounds for Learning Polyhedra with a Margin Efficiency of Proportional Mechanisms in Online Auto-Bidding Advertising Skyline-First Traversal as a Control Mechanism for Multi-Criteria Graph Search Constant-Factor Approximation for the Uniform Decision Tree Limited Perfect Monotonical Surrogates constructed using low-cost recursive linkage discovery with guaranteed output Query Lower Bounds for Diffusion Sampling Early Pruning for Public Transport Routing Adapting Dijkstra for Buffers and Unlimited Transfers Exploiting Low-Rank Structure in Max-K-Cut Problems Partial Optimality in the Preordering Problem High-accuracy log-concave sampling with stochastic queries Learning to Approximate Uniform Facility Location via Graph Neural Networks Linear Regression with Unknown Truncation Beyond Gaussian Features Adaptive Power Iteration Method for Differentially Private PCA Finite and Corruption-Robust Regret Bounds in Online Inverse Linear Optimization under M-Convex Action Sets Learning Mixture Models via Efficient High-dimensional Sparse Fourier Transforms Variance Computation for Weighted Model Counting with Knowledge Compilation Approach Deterministic Coreset for Lp Subspace Online Algorithms for Repeated Optimal Stopping: Balancing Baseline Guarantees and Regret Learned Static Function Data Structures Optimal hypersurface decision trees A Perfectly Truthful Calibration Measure The Geometry of LLM Quantization: GPTQ as Babai's Nearest Plane Algorithm Best Agent Identification for General Game Playing A Faster Generalized Two-Stage Approximate Top-K Fast and Simple Densest Subgraph with Predictions Smoothed Analysis of Learning from Positive Samples Ineffectiveness for Search and Undecidability of PCSP Meta-Problems Sample-Efficient Optimization over Generative Priors via Coarse Learnability Efficient distributional regression trees learning algorithms for calibrated non-parametric probabilistic forecasts Testing Noise Assumptions of Learning Algorithms Testing Support Size More Efficiently Than Learning Histograms Sharper Bounds for Chebyshev Moment Matching, with Applications Expander Hierarchies for Normalized Cuts on Graphs Multilayer Correlation Clustering Efficient Parameter Estimation of Truncated Boolean Product Distributions Faster Hamiltonian Monte Carlo by Learning Leapfrog Scale: a self-calibrated randomized solution
The I/O Complexity of Attention, or How Optimal is Flash Attention?
Barna Saha, Christopher Ye · 2024-02-12 · via cs.DS updates on arXiv.org

Self-attention is at the heart of the popular Transformer architecture, yet suffers from quadratic time and memory complexity. The breakthrough FlashAttention algorithm revealed I/O complexity as the true bottleneck in scaling Transformers. Given two levels of memory hierarchy, a fast cache (e.g. GPU on-chip SRAM) and a slow memory (e.g. GPU high-bandwidth memory), the I/O complexity measures the number of accesses to memory. FlashAttention computes attention using $\frac{N^2d^2}{M}$ I/O operations where $N$ is the dimension of the attention matrix, $d$ the head-dimension and $M$ the cache size. However, is this I/O complexity optimal? The known lower bound only rules out an I/O complexity of $o(Nd)$ when $M=Θ(Nd)$, since the output that needs to be written to slow memory is $Ω(Nd)$. This leads to the main question of our work: Is FlashAttention I/O optimal for all values of $M$? We resolve the above question in its full generality by showing an I/O complexity lower bound that matches the upper bound provided by FlashAttention for any values of $M \geq d^2$ within any constant factors. Further, we give a better algorithm with lower I/O complexity for $M < d^2$, and show that it is optimal as well. Moreover, our lower bounds do not rely on using combinatorial matrix multiplication for computing the attention matrix. We show even if one uses fast matrix multiplication, the above I/O complexity bounds cannot be improved. We do so by introducing a new communication complexity protocol for matrix compression, and connecting communication complexity to I/O complexity. To the best of our knowledge, this is the first work to establish a connection between communication complexity and I/O complexity, and we believe this connection could be of independent interest and will find many more applications in proving I/O complexity lower bounds in the future.