<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>附录 on Inference Cookbook</title>
    <link>https://inference.lei6393.com/flashattention/08-appendix/</link>
    <description>Recent content in 附录 on Inference Cookbook</description>
    <generator>Hugo</generator>
    <language>zh</language>
    <copyright>Copyright (c) 2024-2025 Inference Cookbook</copyright>
    <atom:link href="https://inference.lei6393.com/flashattention/08-appendix/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>术语表</title>
      <link>https://inference.lei6393.com/flashattention/08-appendix/01-glossary/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://inference.lei6393.com/flashattention/08-appendix/01-glossary/</guid>
      <description>&lt;h2 id=&#34;目录&#34;&gt;目录&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#a-d&#34;&gt;A-D&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#e-h&#34;&gt;E-H&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#i-n&#34;&gt;I-N&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#o-s&#34;&gt;O-S&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#t-z&#34;&gt;T-Z&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;a-d&#34;&gt;A-D&lt;/h2&gt;&#xA;&lt;h3 id=&#34;attention-sink&#34;&gt;Attention Sink&lt;/h3&gt;&#xA;&lt;p&gt;注意力沉积。指在滑动窗口注意力中，保留序列开头若干 token 的注意力连接，即使它们不在窗口范围内。&lt;code&gt;sink_token_length&lt;/code&gt; 在所读版本中是 Hopper 内部 mask 结构的字段，FA2 的公开 &lt;code&gt;flash_attn_func&lt;/code&gt; 没有这一参数。FA4 的 &lt;code&gt;learnable_sink&lt;/code&gt; 则是参与归一化的每头 sink logit，与保留开头若干真实 token 的窗口语义不同。&lt;a href=&#34;https://github.com/Dao-AILab/flash-attention/blob/fa4-v4.0.0.beta39/hopper/mask.h&#34;&gt;Hopper mask&lt;/a&gt; · &lt;a href=&#34;https://github.com/Dao-AILab/flash-attention/blob/fa4-v4.0.0.beta39/flash_attn/cute/interface.py&#34;&gt;FA4 接口&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>论文阅读指南</title>
      <link>https://inference.lei6393.com/flashattention/08-appendix/02-paper-reading-guide/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://inference.lei6393.com/flashattention/08-appendix/02-paper-reading-guide/</guid>
      <description>&lt;h2 id=&#34;目录&#34;&gt;目录&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#1-%e6%a0%b8%e5%bf%83%e8%ae%ba%e6%96%87&#34;&gt;1. 核心论文&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#2-%e5%89%8d%e7%bd%ae%e7%9f%a5%e8%af%86%e8%ae%ba%e6%96%87&#34;&gt;2. 前置知识论文&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#3-%e7%9b%b8%e5%85%b3%e4%bc%98%e5%8c%96%e8%ae%ba%e6%96%87&#34;&gt;3. 相关优化论文&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#4-%e5%ba%94%e7%94%a8%e8%ae%ba%e6%96%87&#34;&gt;4. 应用论文&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#5-%e6%8e%a8%e8%8d%90%e9%98%85%e8%af%bb%e8%b7%af%e7%ba%bf&#34;&gt;5. 推荐阅读路线&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;1-核心论文&#34;&gt;&#xA;    &lt;span id=&#34;toc-h-1-核心论文&#34;&gt;1. 核心论文&lt;/span&gt;&lt;/h2&gt;&#xA;&lt;h3 id=&#34;11-flashattention-fast-and-memory-efficient-exact-attention-with-io-awareness&#34;&gt;&#xA;    &lt;span id=&#34;toc-h-11-flashattention-fast-and-memory-efficient-exact-attention-with-io-awareness&#34;&gt;1.1 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness&lt;/span&gt;&lt;/h3&gt;&#xA;&lt;p&gt;&lt;strong&gt;作者&lt;/strong&gt;：Tri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra, Christopher Ré&#xA;&lt;strong&gt;会议&lt;/strong&gt;：NeurIPS 2022&#xA;&lt;strong&gt;链接&lt;/strong&gt;：https://arxiv.org/abs/2205.14135&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;核心贡献&lt;/strong&gt;：&lt;/p&gt;</description>
    </item>
    <item>
      <title>常见问题</title>
      <link>https://inference.lei6393.com/flashattention/08-appendix/03-faq/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://inference.lei6393.com/flashattention/08-appendix/03-faq/</guid>
      <description>&lt;h2 id=&#34;目录&#34;&gt;目录&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#%e5%ae%89%e8%a3%85%e4%b8%8e%e7%8e%af%e5%a2%83&#34;&gt;安装与环境&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#api-%e4%bd%bf%e7%94%a8&#34;&gt;API 使用&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#%e6%95%b0%e5%80%bc%e4%b8%8e%e6%ad%a3%e7%a1%ae%e6%80%a7&#34;&gt;数值与正确性&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#%e6%80%a7%e8%83%bd%e9%97%ae%e9%a2%98&#34;&gt;性能问题&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#%e6%8e%a8%e7%90%86%e4%b8%8e%e9%83%a8%e7%bd%b2&#34;&gt;推理与部署&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#%e9%ab%98%e7%ba%a7%e5%8a%9f%e8%83%bd&#34;&gt;高级功能&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;安装与环境&#34;&gt;安装与环境&lt;/h2&gt;&#xA;&lt;h3 id=&#34;如何判断安装问题发生在哪一层&#34;&gt;如何判断安装问题发生在哪一层？&lt;/h3&gt;&#xA;&lt;p&gt;先运行 &lt;code&gt;python -m pip show flash-attn flash-attn-3 flash-attn-4&lt;/code&gt;。包名、导入路径和设备能力是三个不同的问题。FA2 的编译进程被系统终止时，调低 &lt;code&gt;MAX_JOBS&lt;/code&gt; 并检查机器剩余内存。导入成功后用&lt;a href=&#34;https://inference.lei6393.com/flashattention/00-overview/03-quick-start/&#34;&gt;已知输入的最小例子&lt;/a&gt;执行 GPU 内核并比较数值。&lt;/p&gt;&#xA;&lt;h3 id=&#34;h100-上应该导入哪个包&#34;&gt;H100 上应该导入哪个包？&lt;/h3&gt;&#xA;&lt;p&gt;FA2 稳定包、FA3 Hopper 实现和 FA4 CuTeDSL 预览包都提供稠密 attention 路径，但函数签名、返回值和支持的 dtype 有差异。对已有模型，先追踪它实际导入的函数；自行选择时，按需要的输入形状、特性和工具链筛选，然后在同一硬件比较结果和延迟。&lt;a href=&#34;https://inference.lei6393.com/flashattention/00-overview/02-architecture-overview/&#34;&gt;分代架构&lt;/a&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
