Made with ScholarlyMake flashcards like these from your own notes
Question:What is incoherent processing in FlashAttention-3?
Answer:Multiplying Q and K with a random orthogonal matrix M before FP8 quantization to even out outliers.
Question:Why multiply Q and K with matrix M in incoherent processing?
Answer:To spread out outliers, reducing quantization error in FP8.
Question:What property ensures multiplying Q and K with M doesn't change attention output?
Answer:M is orthogonal, so M M^T = I, thus (Q M)(K M)^T = Q K^T.
Question:How does incoherent processing reduce quantization error?
Answer:Each entry in Q M or K M is a random sum of original entries, spreading outlier impact.
Question:What is the choice of M in incoherent processing?
Answer:Product of random diagonal matrices of ±1 and a Hadamard matrix.
Question:What is the time complexity of multiplying with the chosen M?
Answer:O(d log d), faster than O(d^2).
Question:Can M multiplication fuse with rotary embedding?
Answer:Yes, at no extra computation cost.
Question:By how much do the techniques reduce numerical error?
Answer:Up to 2.6x, validated in section 4.3.
Question:What primitives from CUTLASS are used in FlashAttention-3?
Answer:WGMMA and TMA abstractions for implementation.
Question:What is FlashAttention-3 compared to in benchmarking?
Answer:PyTorch standard, FlashAttention-2, Triton FA-2, cuDNN FA-2 on H100.
Question:How much faster is FlashAttention-3 than FlashAttention-2?
Answer:Up to 2.0x faster.
Question:How does FlashAttention-3 compare to Triton FA-2?
Answer:1.5x faster.
Question:What peak performance does FlashAttention-3 achieve?
Answer:Up to 740 TFLOPs/s, 75% of H100 theoretical max.
Question:What contributes to FlashAttention-3 speedup in ablation?
Answer:Warp-specialization and GEMM-softmax pipelining.
Question:How much error reduction from FP8 techniques?
Answer:2.6x reduction in numerical error.
Question:What GPU is used for benchmarking?
Answer:H100 80GB SXM5.
Question:What input precision for main benchmarks?
Answer:FP16 inputs, with/without causal mask, head dims 64 or 128.
Question:How much faster is FA-3 forward pass than FA-2?
Answer:1.5-2.0x faster.
Question:Backward pass speedup of FA-3 over FA-2?
Answer:1.5-1.75x faster.
Question:Compared to standard PyTorch attention, FA-3 speedup?
Answer:Up to 3-16x faster.
Question:When does FA-3 surpass cuDNN FA-2?
Answer:For medium and long sequences (1k and above).
Question:Benchmark sequence lengths varied?
Answer:512, 1k, ..., 16k.
Question:How is batch size set in benchmarks?
Answer:So total tokens = 16k.
Question:Hidden dimension in benchmarks?
Answer:2048.
Question:Head dimensions tested?
Answer:64, 128, 256 (32, 16, 8 heads).
Question:Forward pass FLOPs formula?
Answer:4 * seqlen^2 * head_dim * num_heads.
Question:Adjustment for causal masking in FLOPs?
Answer:Divide by 2, as half the entries are computed.
Question:Backward pass FLOPs relative to forward?
Answer:2.5x forward FLOPs.
Question:FP8 benchmarks focus on?
Answer:Forward pass, head dim 256, results in Fig. 7 and Appendix C.2.
Question:Ablation parameters fixed?
Answer:batch=4, seqlen=8448, nheads=16, hdimg=128.
Question:TFLOPs improvement in ablation?
Answer:From 570 to 661 TFLOPs with pipelining and specialization.
Question:What does Figure 5a show?
Answer:Forward speed without causal mask, head dim 64 on H100.
Question:Trend in Figure 5b for causal mask head 64?
Answer:FA-3 up to 473 TFLOPs at 16k, outperforms others.
Question:Peak in Figure 5c non-causal head 128?
Answer:FA-3 at 648 TFLOPs for 16k seq.
Question:Figure 5d causal head 128 performance?
Answer:FA-3 reaches 616 TFLOPs at 16k.
Question:For head 256 non-causal in Fig 5e?
Answer:FA-3 up to 756 TFLOPs, highest.
Question:Causal head 256 in Fig 5f?
Answer:FA-3 at 642 TFLOPs for 16k.
Question:Numerical error comparison against?
Answer:FP64 reference implementation.
Question:How are outliers simulated in error validation?
Answer:Generate Q, K, V entries to mimic LLM features and activations.
Question:Interest in FlashAttention numerical error from?
Answer:Paper [21].
Question:What validates FP8 attention accuracy?
Answer:Block quantization and incoherent processing reduce error 2.6x.
Question:Why use WGMMA in FA-3?
Answer:For efficient GEMM on Hopper tensor cores.
Question:Role of TMA in FA-3?
Answer:Tensor memory access for fast data loading to SRAM.
Question:What is the theoretical max TFLOPs on H100 for attention?
Answer:Implied ~987 TFLOPs, since 75% is 740.
Question:OOM in benchmarks means?
Answer:Out of memory, e.g., standard attention at long seq.
Question:Why 2.5x FLOPs for backward?
Answer:2 matmuls forward, 5 in backward due to gradient recompute.
Question:Follows which papers for M choice?
Answer:Chee et al. [9] and Tseng et al. [58].
Question:What is 2-stage pipelining in ablation?
Answer:WGMMA-softmax pipelining for overlapping compute.
Question:Warp-specialization benefit?
Answer:Allows asynchrony, improving throughput.