Skip to content

Commit 3261457

Browse files
committed
Site updated: 2025-11-26 10:10:47
1 parent 8073b9e commit 3261457

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

2025/07/13/A4-attention-module/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<meta property="og:image" content="https://njudeepengine.github.io/2025/07/13/A4-attention-module/window.svg">
3232
<meta property="og:image" content="https://njudeepengine.github.io/2025/07/13/A4-attention-module/bottom-right.svg">
3333
<meta property="article:published_time" content="2025-07-13T03:01:59.000Z">
34-
<meta property="article:modified_time" content="2025-08-26T09:15:22.376Z">
34+
<meta property="article:modified_time" content="2025-11-26T02:09:41.967Z">
3535
<meta property="article:author" content="DeepEngine">
3636
<meta property="article:tag" content="Attention">
3737
<meta property="article:tag" content="Mask">
@@ -192,7 +192,7 @@ <h1 class="post-title" itemprop="name headline">
192192
<i class="far fa-calendar-check"></i>
193193
</span>
194194
<span class="post-meta-item-text">更新于</span>
195-
<time title="修改时间:2025-08-26 17:15:22" itemprop="dateModified" datetime="2025-08-26T17:15:22+08:00">2025-08-26</time>
195+
<time title="修改时间:2025-11-26 10:09:41" itemprop="dateModified" datetime="2025-11-26T10:09:41+08:00">2025-11-26</time>
196196
</span>
197197
<span class="post-meta-item">
198198
<span class="post-meta-item-icon">
@@ -290,7 +290,7 @@ <h1 id="Task-1-Offline-Sliding-Window-Attention"><a href="#Task-1-Offline-Slidin
290290
<li><strong>AttnQKVLayout.SBHD</strong>:更适用于<strong>分布式环境(distributed environment)</strong> 的布局,满足 $\mathbf{Q},\mathbf{K},\mathbf{V} \in \mathbb{R}^{\text{seq_len_kv} \times \text{batch_size} \times \text{num_head} \times \text{head_dim}}$ ,记为 <code>sbhd</code></li>
291291
<li><strong>AttnQKVLayout.THD</strong>:最通用的布局格式,也称为 <code>varlen layout</code>(变长布局),满足 $\mathbf{Q},\mathbf{K},\mathbf{V} \in \mathbb{R}^{\text{total_seq_len} \times \text{num_head} \times \text{head_dim}}$,在这种布局中,不存在显式的 <code>batch</code> 维度,所有长度不一的序列会沿着 <code>sequence</code> 维度拼接在一起,在这种情况下需要额外提供两个辅助输入,用于标识每条序列在拼接后的张量中的位置:<ul>
292292
<li><code>cu_seqlens_q</code></li>
293-
<li><code>cu_seqlens_kv</code><br>这两个张量都是 <code>int32</code> 类型,形状为 <code>[batch_size + 1]</code>,其中每一段 <code>[[cu_seqlens&#125;[i], cu_seqlens[i+1]]</code> 表示第 i 个样本在 $\mathbf{Q}$ 或 $\mathbf{K}$、$\mathbf{V}$ 中的 起止区间(start-end),在 <code>varlen layout</code> 场景的掩码模式可参考下图。(更多示例请参考 Flash Attention 接口中的相关内容。)</li>
293+
<li><code>cu_seqlens_kv</code><br>这两个张量都是 <code>int32</code> 类型,形状为 <code>[batch_size + 1]</code>,其中每一段 <code>[[cu_seqlens[i], cu_seqlens[i+1])</code> 表示第 i 个样本在 $\mathbf{Q}$ 或 $\mathbf{K}$、$\mathbf{V}$ 中的 起止区间(start-end),在 <code>varlen layout</code> 场景的掩码模式可参考下图。(更多示例请参考 Flash Attention 接口中的相关内容。)</li>
294294
</ul>
295295
</li>
296296
</ul>

css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ pre .javascript .function {
11681168
}
11691169
.links-of-author a::before,
11701170
.links-of-author span.exturl::before {
1171-
background: #f1dfe5;
1171+
background: #bd2f83;
11721172
border-radius: 50%;
11731173
content: ' ';
11741174
display: inline-block;

default-index/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ <h2 class="post-title" itemprop="name headline">
829829
<i class="far fa-calendar-check"></i>
830830
</span>
831831
<span class="post-meta-item-text">更新于</span>
832-
<time title="修改时间:2025-08-26 17:15:22" itemprop="dateModified" datetime="2025-08-26T17:15:22+08:00">2025-08-26</time>
832+
<time title="修改时间:2025-11-26 10:09:41" itemprop="dateModified" datetime="2025-11-26T10:09:41+08:00">2025-11-26</time>
833833
</span>
834834
<span class="post-meta-item">
835835
<span class="post-meta-item-icon">
@@ -927,7 +927,7 @@ <h1 id="Task-1-Offline-Sliding-Window-Attention"><a href="#Task-1-Offline-Slidin
927927
<li><strong>AttnQKVLayout.SBHD</strong>:更适用于<strong>分布式环境(distributed environment)</strong> 的布局,满足 $\mathbf{Q},\mathbf{K},\mathbf{V} \in \mathbb{R}^{\text{seq_len_kv} \times \text{batch_size} \times \text{num_head} \times \text{head_dim}}$ ,记为 <code>sbhd</code></li>
928928
<li><strong>AttnQKVLayout.THD</strong>:最通用的布局格式,也称为 <code>varlen layout</code>(变长布局),满足 $\mathbf{Q},\mathbf{K},\mathbf{V} \in \mathbb{R}^{\text{total_seq_len} \times \text{num_head} \times \text{head_dim}}$,在这种布局中,不存在显式的 <code>batch</code> 维度,所有长度不一的序列会沿着 <code>sequence</code> 维度拼接在一起,在这种情况下需要额外提供两个辅助输入,用于标识每条序列在拼接后的张量中的位置:<ul>
929929
<li><code>cu_seqlens_q</code></li>
930-
<li><code>cu_seqlens_kv</code><br>这两个张量都是 <code>int32</code> 类型,形状为 <code>[batch_size + 1]</code>,其中每一段 <code>[[cu_seqlens&#125;[i], cu_seqlens[i+1]]</code> 表示第 i 个样本在 $\mathbf{Q}$ 或 $\mathbf{K}$、$\mathbf{V}$ 中的 起止区间(start-end),在 <code>varlen layout</code> 场景的掩码模式可参考下图。(更多示例请参考 Flash Attention 接口中的相关内容。)</li>
930+
<li><code>cu_seqlens_kv</code><br>这两个张量都是 <code>int32</code> 类型,形状为 <code>[batch_size + 1]</code>,其中每一段 <code>[[cu_seqlens[i], cu_seqlens[i+1])</code> 表示第 i 个样本在 $\mathbf{Q}$ 或 $\mathbf{K}$、$\mathbf{V}$ 中的 起止区间(start-end),在 <code>varlen layout</code> 场景的掩码模式可参考下图。(更多示例请参考 Flash Attention 接口中的相关内容。)</li>
931931
</ul>
932932
</li>
933933
</ul>

0 commit comments

Comments
 (0)