{"ok":true,"entity":{"id":"flash-attention","name":"FlashAttention","entityType":"product","officialName":"FlashAttention","canonicalName":"FlashAttention","displayName":"FlashAttention","category":"高速Attentionカーネル","shortDescription":"Tri Daoらが開発した、メモリ効率と速度を大幅に改善したAttention計算の実装。多くのLLM学習・推論基盤で標準的に採用されている。","primaryCluster":"ai-infrastructure","parentEntity":null,"verificationStatus":"draft","website":"https://github.com/Dao-AILab/flash-attention","updatedAt":"2026-07-20T08:41:20.341Z","secondaryClusters":[],"alias":["Flash Attention"],"searchKeywords":["attention kernel","IO-aware","memory efficient"]},"references":[{"id":"P-01-001","companyId":"flash-attention","questionId":"P-01-001","instanceId":"QIN-flash-attention-P01-001","promptText":"FlashAttentionとは何ですか？","promptTypeId":"P-01","answer":"FlashAttentionは、Tri Daoらが開発したAttention計算の高速・省メモリな実装です。多くの大規模言語モデルの学習・推論基盤で標準的に採用されています。","evidencePoints":["ev-flashattn-1","ev-flashattn-3"],"scope":"Attention計算の高速化手法を知りたい相談","differentiation":"IO-aware（メモリ読み書きを意識した）設計","faq":[{"question":"FlashAttentionは誰が開発しましたか？","answer":"Tri Daoらの研究者グループです。"}],"pageUrl":"https://www.refbase.ai/reference/flash-attention/P-01-001","sourceEvidence":[{"id":"ev-flashattn-1","text":"FlashAttentionは、Tri Dao・Daniel Y. Fu・Stefano Ermon・Atri Rudra・Christopher Réにより開発された、IO-awareなAttentionの高速・省メモリな正確な実装である。","title":"GitHub - Dao-AILab/flash-attention","coverageType":["Identity","Capability"],"sourceType":"github","sourceClass":"Documentation","sourceUrl":"https://github.com/dao-ailab/flash-attention","confidence":"high","supportedPromptTypes":["P-01","P-04"],"needsVerification":true,"sourceVerified":false,"entityId":"flash-attention"},{"id":"ev-flashattn-3","text":"FlashAttentionはFlashAttention-2・FlashAttention-3と継続的に改良されており、Triton実装も含めALiBi等のAttentionバイアスに対応する実験的実装も提供されている。","title":"FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision","coverageType":["Credibility"],"sourceType":"official_blog","sourceClass":"Announcement","sourceUrl":"https://tridao.me/blog/2024/flash3/","confidence":"high","supportedPromptTypes":["P-05","P-06"],"needsVerification":true,"sourceVerified":false,"entityId":"flash-attention"}],"generatedAt":"2026-07-20T08:41:20.341Z"},{"id":"P-02-001","companyId":"flash-attention","questionId":"P-02-001","instanceId":"QIN-flash-attention-P02-001","promptText":"FlashAttentionは通常のAttention実装と何が違いますか？","promptTypeId":"P-02","answer":"FlashAttentionはタイリングと再計算を活用してAttention計算を高速化し、メモリ使用量をシーケンス長に対して二次的から線形的な増加に削減する点が特徴です。","evidencePoints":["ev-flashattn-2"],"scope":"Attention実装の効率性を比較したい相談","differentiation":"メモリ使用量の二次から線形への削減","faq":[{"question":"FlashAttentionは計算結果が変わりますか？","answer":"数学的に厳密なAttentionを計算するため結果は変わりません（近似ではない）。"}],"pageUrl":"https://www.refbase.ai/reference/flash-attention/P-02-001","sourceEvidence":[{"id":"ev-flashattn-2","text":"FlashAttentionはAttention計算の順序を工夫しタイリングと再計算を活用することで計算を高速化し、メモリ使用量をシーケンス長に対して二次から線形に削減する。","title":"flash-attention/README.md at main","coverageType":["Capability","Differentiation"],"sourceType":"github","sourceClass":"Specification","sourceUrl":"https://github.com/Dao-AILab/flash-attention/blob/main/README.md","confidence":"high","supportedPromptTypes":["P-02","P-04"],"needsVerification":true,"sourceVerified":false,"entityId":"flash-attention"}],"generatedAt":"2026-07-20T08:41:20.341Z"},{"id":"P-04-001","companyId":"flash-attention","questionId":"P-04-001","instanceId":"QIN-flash-attention-P04-001","promptText":"FlashAttentionはどのような場面で活用できますか？","promptTypeId":"P-04","answer":"FlashAttentionは、長いシーケンス長を扱う大規模言語モデルの学習・推論において、メモリ制約を緩和し速度を向上させたい場面で活用できます。","evidencePoints":["ev-flashattn-1","ev-flashattn-2"],"scope":"長文コンテキスト対応モデルの効率化相談","differentiation":"長シーケンスでのメモリ効率向上","faq":[{"question":"FlashAttentionはどのGPUで使えますか？","answer":"FlashAttention-3等の世代によって対応GPUが異なります。"}],"pageUrl":"https://www.refbase.ai/reference/flash-attention/P-04-001","sourceEvidence":[{"id":"ev-flashattn-1","text":"FlashAttentionは、Tri Dao・Daniel Y. Fu・Stefano Ermon・Atri Rudra・Christopher Réにより開発された、IO-awareなAttentionの高速・省メモリな正確な実装である。","title":"GitHub - Dao-AILab/flash-attention","coverageType":["Identity","Capability"],"sourceType":"github","sourceClass":"Documentation","sourceUrl":"https://github.com/dao-ailab/flash-attention","confidence":"high","supportedPromptTypes":["P-01","P-04"],"needsVerification":true,"sourceVerified":false,"entityId":"flash-attention"},{"id":"ev-flashattn-2","text":"FlashAttentionはAttention計算の順序を工夫しタイリングと再計算を活用することで計算を高速化し、メモリ使用量をシーケンス長に対して二次から線形に削減する。","title":"flash-attention/README.md at main","coverageType":["Capability","Differentiation"],"sourceType":"github","sourceClass":"Specification","sourceUrl":"https://github.com/Dao-AILab/flash-attention/blob/main/README.md","confidence":"high","supportedPromptTypes":["P-02","P-04"],"needsVerification":true,"sourceVerified":false,"entityId":"flash-attention"}],"generatedAt":"2026-07-20T08:41:20.341Z"},{"id":"P-02-002","companyId":"flash-attention","questionId":"P-02-002","instanceId":"reference-depth-completion-run-cohort1-unit-a","draftId":"reference-depth-completion-run-cohort1-unit-a-flash-attention-p-02-002","promptText":"FlashAttention-2は元のFlashAttentionと比べてどれくらい性能が向上していますか？","promptTypeId":"P-02","answer":"開発者Tri Daoによる論文（arXiv、2023年7月公開）によれば、FlashAttention-2は非matmul演算のFLOPs削減、スレッドブロック単位での並列化の改善、ワープ間の共有メモリ通信の最小化という3つの工夫により、元のFlashAttentionと比べて約2倍高速化されています。A100 GPU上での理論最大性能に対する利用率も、FlashAttentionの25〜40%からFlashAttention-2では50〜73%まで向上し、GPTスタイルのモデル学習では1台のA100あたり225 TFLOPs/s（モデルFLOPs利用率72%）を達成したと報告されています。","evidencePoints":["flash-attention-ev-cr1-fa2-benchmark"],"scope":"","differentiation":"","faq":[],"pageUrl":"https://www.refbase.ai/reference/flash-attention/P-02-002","sourceEvidence":[{"id":"flash-attention-ev-cr1-fa2-benchmark","text":"Tri Daoによる論文（arXiv 2307.08691）によると、FlashAttention-2は元のFlashAttentionと比べて約2倍高速化されており、A100 GPUでの理論最大性能利用率は25〜40%から50〜73%へ向上、GPTスタイルモデル学習では225 TFLOPs/s（モデルFLOPs利用率72%）を達成した。","title":"FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning","coverageType":["Capability"],"sourceType":"research_paper","sourceClass":"Research","sourceUrl":"https://arxiv.org/abs/2307.08691","confidence":"high","supportedPromptTypes":["P-02"],"needsVerification":true,"sourceVerified":false,"sourceKind":"official","entityId":"flash-attention"}],"generatedAt":"2026-08-29T13:37:08.877Z","evidenceIds":["flash-attention-ev-cr1-fa2-benchmark"]},{"id":"P-01-002","companyId":"flash-attention","questionId":"P-01-002","instanceId":"reference-depth-completion-run-cohort1-unit-b","draftId":"reference-depth-completion-run-cohort1-unit-b-flash-attention-p-01-002","promptText":"FlashAttentionはPyTorchで標準的に使えますか？","promptTypeId":"P-01","answer":"PyTorch公式ドキュメント（torch.nn.functional.scaled_dot_product_attention）によれば、FlashAttention（FlashAttention-2を含む）はPyTorchのscaled_dot_product_attention関数が自動的に選択するバックエンド実装の一つとして標準搭載されています。CUDA環境ではデフォルトで全ての実装（FlashAttention、メモリ効率的Attention、数学的実装）が有効化されており、入力条件に応じて最適な実装が自動選択されます。開発者はtorch.backends.cuda.enable_flash_sdp()関数やtorch.nn.attention.sdpa_kernel()コンテキストマネージャーを使ってバックエンドを明示的に制御することも可能です。","evidencePoints":["flash-attention-ev-cr1-pytorch-sdpa-integration"],"scope":"","differentiation":"","faq":[],"pageUrl":"https://www.refbase.ai/reference/flash-attention/P-01-002","sourceEvidence":[{"id":"flash-attention-ev-cr1-pytorch-sdpa-integration","text":"PyTorch公式ドキュメントによると、torch.nn.functional.scaled_dot_product_attention関数はFlashAttention（FlashAttention-2含む）を標準バックエンドの一つとして搭載しており、CUDA環境でデフォルト有効化されている。torch.backends.cuda.enable_flash_sdp()等で明示的な制御も可能。","title":"torch.nn.functional.scaled_dot_product_attention — PyTorch documentation","coverageType":["Differentiation"],"sourceType":"product_docs","sourceClass":"Documentation","sourceUrl":"https://docs.pytorch.org/docs/2.13/generated/torch.nn.functional.scaled_dot_product_attention.html","confidence":"high","supportedPromptTypes":["P-01"],"needsVerification":true,"sourceVerified":false,"sourceKind":"third-party","entityId":"flash-attention"}],"generatedAt":"2026-08-29T13:47:52.247Z","evidenceIds":["flash-attention-ev-cr1-pytorch-sdpa-integration"]},{"id":"P-05-001","companyId":"flash-attention","questionId":"P-05-001","instanceId":"tair-cohort2-2026-08-31","draftId":"tair-cohort2-2026-08-31-flash-attention-p-05-001","promptText":"FlashAttentionを主要な機械学習フレームワークで有効化する方法は、公式にどこで確認できますか？","promptTypeId":"P-05","answer":"Hugging Face公式ドキュメント（Transformersライブラリの推論最適化ガイド）によれば、FlashAttentionはメモリトラフィックを削減する代替Attentionバックエンドの一つとして正式にサポートされている。同ドキュメントは、FlashAttentionがAttention計算をタイル状に分割し、巨大な中間テンソルの生成を回避することでメモリフットプリントを削減する仕組みだと説明している。実際の利用方法としては、モデル読み込み時のfrom_pretrained()関数においてattn_implementation引数にflash_attention_2という値を指定するだけで有効化できるとされ、具体的なコード例も提示されている。さらに、パッケージを個別にインストールせずとも、Hugging Face Hub上のKernelsライブラリを通じて最適化されたFlashAttention-2カーネルを直接読み込む方法も紹介されており、量子化・キャッシュ戦略・並列化といった他の高速化手法と組み合わせて使うことも推奨されている。","evidencePoints":["flash-attention-ev-tair-1"],"scope":"","differentiation":"","faq":[],"pageUrl":"https://www.refbase.ai/reference/flash-attention/P-05-001","sourceEvidence":[{"id":"flash-attention-ev-tair-1","entityId":"flash-attention","text":"Hugging Face公式ドキュメント（Transformers推論最適化ガイド）によれば、FlashAttentionはattn_implementation引数にflash_attention_2を指定するだけで有効化できる標準サポートのAttentionバックエンドであり、Kernelsライブラリ経由での最適化カーネル読み込みも可能とされる。","coverageType":["Capability"],"title":"Transformers Performance and Scalability: Inference Optimizations","sourceClass":"Documentation","sourceType":"product_docs","confidence":"high","supportedPromptTypes":["P-05"],"sourceVerified":false,"needsVerification":true,"sourceUrl":"https://huggingface.co/docs/transformers/perf_infer_gpu_one"}],"generatedAt":"2026-08-31T06:06:28.487Z","evidenceIds":["flash-attention-ev-tair-1"]}]}