Open
Conversation
|
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-6748.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
Comment on lines
27
to
38
| - **startend_row_indices** (Tensor) | ||
| - 稀疏掩码索引,shape 为 [batch_size, num_heads, seq_len, {1, 2, 4}],数据类型为 int32。 | ||
| num_heads 为 1 或与 k 的 num_heads 相同,num_heads 取 1 时将被广播到与 k 的 num_heads 相同。 | ||
| 根据 causal 参数的取值不同,startend_row_indices 可取不同形状并具有不同含义。 | ||
| - 当 `causal=True` 且 shape 取 [batch_size, num_heads, seq_len, 1] 时, | ||
| startend_row_indices 的值 r 表示 Score 矩阵中左下三角从第 r 行下方(包括)的元素将被 mask | ||
| - 当 `causal=True` 且 shape 取 [batch_size, num_heads, seq_len, 2] 时, | ||
| startend_row_indices 的值 r1,r2 表示 Score 矩阵中左下三角从第 r1 行下方(包括)但在第 r2 行上方(不包括)的元素将被 mask | ||
| - 当 `causal=False` 且 shape 取 [batch_size, num_heads, seq_len, 2] 时, | ||
| startend_row_indices 的值 r1,r2 表示 Score 矩阵中左下三角从第 r1 行下方(包括)的元素将被 mask,右上三角从第 r2 行上方(不包括)的元素将被 mask | ||
| - 当 `causal=False` 且 shape 取 [batch_size, num_heads, seq_len, 4] 时 (尚未支持), | ||
| startend_row_indices 的值 r1,r2,r3,r4 表示 Score 矩阵中左下三角从第 r1 行下方(包括)但在第 r2 行上方(不包括)的元素将被 mask,右上三角从第 r3 行下方(包括)但在第 r4 行上方(不包括)的元素将被 mask |
Collaborator
There was a problem hiding this comment.
Suggested change
| - **startend_row_indices** (Tensor) | |
| - 稀疏掩码索引,shape 为 [batch_size, num_heads, seq_len, {1, 2, 4}],数据类型为 int32。 | |
| num_heads 为 1 或与 k 的 num_heads 相同,num_heads 取 1 时将被广播到与 k 的 num_heads 相同。 | |
| 根据 causal 参数的取值不同,startend_row_indices 可取不同形状并具有不同含义。 | |
| - 当 `causal=True` 且 shape 取 [batch_size, num_heads, seq_len, 1] 时, | |
| startend_row_indices 的值 r 表示 Score 矩阵中左下三角从第 r 行下方(包括)的元素将被 mask | |
| - 当 `causal=True` 且 shape 取 [batch_size, num_heads, seq_len, 2] 时, | |
| startend_row_indices 的值 r1,r2 表示 Score 矩阵中左下三角从第 r1 行下方(包括)但在第 r2 行上方(不包括)的元素将被 mask | |
| - 当 `causal=False` 且 shape 取 [batch_size, num_heads, seq_len, 2] 时, | |
| startend_row_indices 的值 r1,r2 表示 Score 矩阵中左下三角从第 r1 行下方(包括)的元素将被 mask,右上三角从第 r2 行上方(不包括)的元素将被 mask | |
| - 当 `causal=False` 且 shape 取 [batch_size, num_heads, seq_len, 4] 时 (尚未支持), | |
| startend_row_indices 的值 r1,r2,r3,r4 表示 Score 矩阵中左下三角从第 r1 行下方(包括)但在第 r2 行上方(不包括)的元素将被 mask,右上三角从第 r3 行下方(包括)但在第 r4 行上方(不包括)的元素将被 mask | |
| - **startend_row_indices** (Tensor) | |
| - 稀疏掩码索引,shape 为 [batch_size, num_heads, seq_len, {1, 2, 4}],数据类型为 int32。 | |
| num_heads 为 1 或与 k 的 num_heads 相同,num_heads 取 1 时将被广播到与 k 的 num_heads 相同。 | |
| 根据 causal 参数的取值不同,startend_row_indices 可取不同形状并具有不同含义。 | |
| - 当 `causal=True` 且 shape 取 [batch_size, num_heads, seq_len, 1] 时, | |
| startend_row_indices 的值 r 表示 Score 矩阵中左下三角从第 r 行下方(包括)的元素将被 mask | |
| - 当 `causal=True` 且 shape 取 [batch_size, num_heads, seq_len, 2] 时, | |
| startend_row_indices 的值 r1,r2 表示 Score 矩阵中左下三角从第 r1 行下方(包括)但在第 r2 行上方(不包括)的元素将被 mask | |
| - 当 `causal=False` 且 shape 取 [batch_size, num_heads, seq_len, 2] 时, | |
| startend_row_indices 的值 r1,r2 表示 Score 矩阵中左下三角从第 r1 行下方(包括)的元素将被 mask,右上三角从第 r2 行上方(不包括)的元素将被 mask | |
| - 当 `causal=False` 且 shape 取 [batch_size, num_heads, seq_len, 4] 时 (尚未支持), | |
| startend_row_indices 的值 r1,r2,r3,r4 表示 Score 矩阵中左下三角从第 r1 行下方(包括)但在第 r2 行上方(不包括)的元素将被 mask,右上三角从第 r3 行下方(包括)但在第 r4 行上方(不包括)的元素将被 mask。 | |
Comment on lines
12
to
15
| .. image:: ../../../../images/flashmask.jpeg | ||
| :width: 1000px | ||
| :height: 2000px | ||
| :align: center |
Collaborator
There was a problem hiding this comment.
可以参考
docs/docs/guides/06_distributed_training/pipeline_parallel_cn.rst
Lines 11 to 14 in c2c24b8
| - **return_softmax_lse** (bool,可选) - 是否返回 softmax_lse 的结果。默认值为 False。 | ||
| - **return_seed_offset** (bool,可选) - 是否返回 seed_offset 的结果。默认值为 False。 | ||
| - **fixed_seed_offset** (Tensor,可选) - 固定 Dropout 的 offset seed. | ||
| - **rng_name** (str,可选) - 随机数生成器名称 |
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.