Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(): add IPU dy2static related docs. #4932

Merged

Conversation

czr-gc
Copy link
Contributor

@czr-gc czr-gc commented Jun 16, 2022

增加ipu动态图转静态图新增接口的相关文档。

related pr: PaddlePaddle/Paddle#42952

文档预览链接:http://10.136.157.23:8090/documentation/docs/zh/faq/index_cn.html?reviewVersion=jenkins-doc-review-2374

@CLAassistant
Copy link

CLAassistant commented Jun 16, 2022

CLA assistant check
All committers have signed the CLA.

@paddle-bot-old
Copy link

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-4932.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:[Beta]飞桨文档预览工具

@gglin001
Copy link
Contributor

gglin001 commented Jun 17, 2022

IpuStrategy 的API 新增部分的预览

zh
FireShot Capture 014 -  -

en
FireShot Capture 016 -  -

@gglin001
Copy link
Contributor

@qili93
Copy link
Contributor

qili93 commented Jun 21, 2022

Identity Loss 中文

image

英文

image

Copy link
Contributor

@qili93 qili93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

identity_loss
-------------------------------

.. py:function:: paddle.fluid.layers.identity_loss(loss, reduction='none')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loss -> x

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已更改

.. py:function:: paddle.fluid.layers.identity_loss(loss, reduction='none')


该OP用于在IPU动态图转静态图功能中标记网络的损失值,从而能够在IPU上为网络添加反向计算过程。该OP以网络的损失值作为输入,并对输入做reduction:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

该OP

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已更改

参数
::::::::::::

- **reduction** (str,可选) - 指定应用于输出结果的计算方式,可选值有: ``'none'``, ``'mean'``, ``'sum'`` 。默认为 ``'none'``,直接返回输入loss的值;设置为 ``'sum'`` 时,计算输入loss的总和;设置为 ``'mean'`` 时,返回输入loss的均值。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

少了 x

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已添加

::::::::::::
根据 `reduction` 返回网络损失值的计算结果。

返回类型
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

返回类型和 返回写在一起

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已更改

代码示例
::::::::::::

.. code-block:: python
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用 COPY FROM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已更改

@gglin001
Copy link
Contributor

预览的html文件(本地构建的数学公式渲染有问题)
预览.zip

::::::::::::

- **x** (Variable) - 输入张量。维度为[N, \*]的多维Tensor,其中N是批大小,\*表示任何数量的附加维度。数据类型在CPU上为float32或float64,在IPU上为float16或float32。
- **reduction** (str|int,可选) - 指定应用于输出结果的计算方式,可选的string值有: ``'mean'``, ``'sum'``, ``'none'`` ,对应的int值分别为0,1,2 。默认为 ``'none'``,直接返回输入loss的值;设置为 ``'mean'`` 时,返回输入loss的均值;设置为 ``'sum'`` 时,计算输入loss的总和。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

默认为 'none'。即可,后面的删除吧。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已删除

.. py:function:: paddle.fluid.layers.identity_loss(x, reduction='none')


用于在IPU动态图转静态图功能中标记网络的损失值,从而能够在IPU上为网络添加反向计算过程。该OP以网络的损失值作为输入,并对输入做reduction:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请删除 “该OP”,文档里不这么描述。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已改为算子以网络的损失值作为输入.

@gglin001
Copy link
Contributor

gglin001 commented Jul 4, 2022

预览的html文件(本地构建的数学公式渲染有问题)
最新预览.zip

@qili93 qili93 merged commit 40b4960 into PaddlePaddle:develop Jul 7, 2022
@gglin001 gglin001 deleted the ipu_commit/dy2static_ipu_update branch July 7, 2022 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants