影片高階EN11.3 萬 次觀看
Flash Attention derived and coded from first principles with Triton (Python)
來源 Umar Jamil
看影片(在新分頁開啟原站)連到 YouTube・Umar Jamil
摘要
從零開始,僅用紙筆推導 Flash Attention 的數學原理,並結合 Triton 與 CUDA 從頭實作前後向傳。內容涵蓋多頭注意力機制、Online Softmax 證明、矩陣分塊乘法、Tensor 佈局、自動微分原理,以及 Triton 的自調優與軟體排程技巧,讓讀者深入理解其核心運作。
This video derives Flash Attention from first principles using pen and paper, then implements both forward and backward passes in Python with Triton and CUDA, covering Online Softmax proofs, block matrix multiplication, and GPU optimization techniques.
摘要、重點與章節標題由語言模型整理,細節(誰說的、數字、先後)可能有誤;要引用請以原始內容為準。
重點
- 從頭推導 Flash Attention 數學公式並手寫程式碼實作。
- 詳細解說 Online Softmax 演算法及其數學證明過程。
- 介紹 Triton 自調優與軟體排程等 GPU 最佳化技術。
章節
依話題轉折切分,標題由 AI 產生
- 00:00Introduction
- 03:10Multi-Head Attention
- 09:06Why Flash Attention
- 12:50Safe Softmax
- 27:03Online Softmax
- 39:44Online Softmax (Proof)
- 47:26Block Matrix Multiplication
- 1:28:38Flash Attention forward (by hand)
- 1:44:01Flash Attention forward (paper)
- 1:50:53Intro to CUDA with examples
- 2:26:28Tensor Layouts
- 2:40:48Intro to Triton with examples
- 2:54:26Flash Attention forward (coding)
- 4:22:11LogSumExp trick in Flash Attention 2
- 4:32:53Derivatives, gradients, Jacobians
- 4:45:54Autograd
- 5:00:00Jacobian of the MatMul operation
- 5:16:14Jacobian through the Softmax
- 5:47:33Flash Attention backwards (paper)
- 6:13:11Flash Attention backwards (coding)
- 7:21:10Triton Autotuning
- 7:23:29Triton tricks: software pipelining
- 7:33:38Running the code
提到的工具與公司
適合誰看
適合希望深入理解 Flash Attention 原理、熟悉 PyTorch 並想學習使用 Triton 或 CUDA 進行 GPU 程式設計的開發者。
摘要依據
- 依據
- 自動字幕
為什麼排在這裡
- 人氣
- 0.46
- 新鮮
- 0.06
在主題頁與搜尋結果裡,名次由相關、人氣、新鮮三個分數決定;這一頁沒有搜尋的關鍵字,所以沒有相關分數。排序怎麼算
相關內容
- 打破长上下文内存瓶颈!深入拆解 Flash Attention 如何降维平方复杂度影片 ・ EZ.Encoder Academy ・ 1 小時 10 分 ・
- 加快語言模型生成速度 (1/2):Flash Attention影片 ・ Hung-yi Lee ・ 50 分鐘 ・
- 连续化 Softmax Attention文章 ・ 科学空间(苏剑林) ・
- Build an LLM from Scratch 3: Coding attention mechanisms影片 ・ Sebastian Raschka ・ 2 小時 16 分 ・
- The matrix math behind transformer neural networks, one step at a time!!!影片 ・ StatQuest with Josh Starmer ・ 24 分鐘 ・
- Coding a Transformer from scratch on PyTorch, with full explanation, training and inference.影片 ・ Umar Jamil ・ 2 小時 59 分 ・
這個來源最近的內容
摘要由 AI 根據原文產生,可能有誤;完整內容請看原站。看影片(在新分頁開啟原站)
