Skip to content

Commit 34ad505

Browse files
[Docathon] Add No.60~No.61 API CN Doc (#6211)
* fix zh_doc_6061 * Update fused_rms_norm_cn.rst * Update fused_layer_norm_cn.rst * Update docs/api/paddle/incubate/nn/functional/fused_rms_norm_cn.rst Co-authored-by: zachary sun <[email protected]> * Update docs/api/paddle/incubate/nn/functional/fused_layer_norm_cn.rst Co-authored-by: zachary sun <[email protected]> * Update docs/api/paddle/incubate/nn/functional/fused_layer_norm_cn.rst Co-authored-by: zachary sun <[email protected]> * Update docs/api/paddle/incubate/nn/functional/fused_rms_norm_cn.rst Co-authored-by: zachary sun <[email protected]> * Update fused_rms_norm_cn.rst fix Symbol_Error --------- Co-authored-by: zachary sun <[email protected]>
1 parent 5918011 commit 34ad505

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.. _cn_api_paddle_incubate_nn_functional_fused_layer_norm:
2+
3+
fused_layer_norm
4+
-------------------------------
5+
6+
.. py:function:: paddle.incubate.nn.functional.fused_layer_norm(x, norm_weight, norm_bias, epsilon, residual_alpha=1.0, begin_norm_axis=1, bias=None, residual=None, quant_scale=- 1, quant_round_type=0, quant_max_bound=0, quant_min_bound=0)
7+
8+
应用 Fused LayerNorm 内核,提供了更高的 GPU 利用率。同时,支持模式融合 LayerNorm(bias + residual_alpha * residual + x)。
9+
10+
当 norm_weight 和 norm_bias 为 None 时,返回融合的 (bias + residual_alpha * residual + x)。
11+
12+
fused_layer_norm 算子目前只支持在 GPU 下运行。
13+
14+
参数
15+
::::::::::::
16+
- **x** (Tensor) - 输入 ``Tensor``。
17+
- **norm_weight** (Tensor) - 用于仿射输出的权重张量。
18+
- **norm_bias** (Tensor) - 用于仿射输出的偏置张量。
19+
- **epsilon** (float) - 一个小的浮点数,用于避免除以零。
20+
- **residual_alpha** (float) - 用于残差的缩放因子,默认为 1。
21+
- **begin_norm_axis** (int) - 归一化的起始轴,默认为 1。
22+
- **bias** (Tensor,可选) - 前一层的偏置。
23+
- **residual** (Tensor,可选) - 输入的残差。
24+
- **quant_scale** (float) - 量化缩放因子。
25+
- **quant_round_type** (float) - 量化四舍五入类型。
26+
- **quant_max_bound** (float) - 量化裁剪的最大边界值。
27+
- **quant_min_bound** (float) - 量化裁剪的最小边界值。
28+
29+
30+
返回
31+
::::::::::::
32+
输出 ``Tensor``
33+
34+
形状
35+
::::::::::::
36+
``Tensor``,形状同 ``x`` 一致。
37+
38+
代码示例
39+
::::::::::::
40+
41+
COPY-FROM: paddle.incubate.nn.functional.fused_layer_norm
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.. _cn_api_paddle_incubate_nn_functional_fused_rms_norm:
2+
3+
fused_rms_norm
4+
-------------------------------
5+
6+
.. py:function:: paddle.incubate.nn.functional.fused_rms_norm(x, norm_weight, norm_bias, epsilon, begin_norm_axis, bias=None, residual=None, quant_scale=- 1, quant_round_type=0, quant_max_bound=0, quant_min_bound=0)
7+
8+
应用 Fused RMSNorm 内核,提供了更高的 GPU 利用率。同时,支持模式融合 RMSNorm(bias + residual + x)。
9+
10+
细节可参考论文 `Root Mean Square Layer Normalization <https://arxiv.org/abs/1910.07467>`_ 。
11+
12+
fused_rms_norm 算子目前只支持在 GPU 下运行。
13+
14+
参数
15+
::::::::::::
16+
- **x** (Tensor) - 输入 ``Tensor``。
17+
- **norm_weight** (Tensor) - 用于仿射输出的权重张量。
18+
- **norm_bias** (Tensor) - 用于仿射输出的偏置张量。
19+
- **epsilon** (float) - 一个小的浮点数,用于避免除以零。
20+
- **begin_norm_axis** (int) - 归一化的起始轴,默认为 1。
21+
- **bias** (Tensor,可选) - 前一层的偏置。
22+
- **residual** (Tensor,可选) - 输入的残差。
23+
- **quant_scale** (float) - 量化缩放因子。
24+
- **quant_round_type** (float) - 量化四舍五入类型。
25+
- **quant_max_bound** (float) - 量化裁剪的最大边界值。
26+
- **quant_min_bound** (float) - 量化裁剪的最小边界值。
27+
28+
29+
返回
30+
::::::::::::
31+
输出 ``Tensor``
32+
33+
形状
34+
::::::::::::
35+
``Tensor``,形状同 ``x`` 一致。
36+
37+
代码示例
38+
::::::::::::
39+
40+
COPY-FROM: paddle.incubate.nn.functional.fused_rms_norm

0 commit comments

Comments
 (0)