How does FlashAttention reduce memory overhead during LLM training and inference on AMD GPUs, and what is the underlying hardware-level mechanism?