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

[xdoctest] reformat example code with google style in No.366 #57786

Closed
wants to merge 7 commits into from

Conversation

yuchen202
Copy link
Contributor

@yuchen202 yuchen202 commented Sep 26, 2023

PR types

Others

PR changes

Others

Description

修改如下文件的示例代码,使其通过 xdoctest 检查:

python/paddle/incubate/nn/functional/fused_rms_norm.py

Related links

@paddle-bot
Copy link

paddle-bot bot commented Sep 26, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Sep 26, 2023
@yuchen202
Copy link
Contributor Author

@sunzhongkai588

@yuchen202
Copy link
Contributor Author

import math
import paddle
from paddle.incubate.nn.functional import variable_length_memory_efficient_attention

这个地方报错了

RuntimeError: (NotFound) The kernel with key (CPU, Undefined(AnyLayout), float16) of kernel gaussian is not registered. Selected wrong DataType float16. Paddle support following DataTypes: float64, float32.
[Hint: Expected kernel_iter == iter->second.end() && kernel_key.backend() == Backend::CPU != true, but received kernel_iter == iter->second.end() && kernel_key.backend() == Backend::CPU:1 == true:1.] (at /paddle/paddle/phi/core/kernel_factory.cc:262)

@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Sep 27, 2023
@paddle-ci-bot
Copy link

paddle-ci-bot bot commented Oct 4, 2023

Sorry to inform you that 2234c06's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

@luotao1
Copy link
Contributor

luotao1 commented Oct 17, 2023

from paddle.incubate.nn.functional import variable_length_memory_efficient_attention

这个地方报错了

可以先去掉这个文件的修改,把其他文件改完提上来。这个文件单独提一个PR修

Copy link
Contributor

@megemini megemini left a comment

Choose a reason for hiding this comment

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

另外,跟这个 PR : #58213 什么关系?

如果文件分开提交的话,至少把标题改一下吧 ~ 😅

Comment on lines +61 to +63
>>> paddle_x = paddle.cast(paddle.randn(shape=[32, 256]), dtype=paddle.float16)
>>> paddle_weight = paddle.cast(paddle.randn(shape=[256]), dtype=paddle.float16)
>>> paddle_bias = paddle.cast(paddle.randn(shape=[256]), dtype=paddle.float16)
Copy link
Contributor

Choose a reason for hiding this comment

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

这里这样写本身没什么问题,只是不明白为什么要 cast?直接在 paddle.randn 里面设置 dtype 不行吗?

            >>> # doctest: +REQUIRES(env:GPU)
            >>> import paddle
            >>> paddle.device.set_device('gpu')
            >>> paddle_x = paddle.randn(shape=[32, 256], dtype=paddle.float16)
            >>> paddle_weight = paddle.randn(shape=[256], dtype=paddle.float16)
            >>> paddle_bias = paddle.randn(shape=[256], dtype=paddle.float16)
            >>> epsilon = 1e-6
            >>> paddle_rmsnorm = paddle.incubate.nn.functional.fused_rms_norm(paddle_x, paddle_weight, paddle_bias, epsilon, 1)

@yuchen202 yuchen202 changed the title [xdoctest] reformat example code with google style in No.365~370 [xdoctest] reformat example code with google style in No.366 Oct 25, 2023
Copy link
Contributor

@megemini megemini left a comment

Choose a reason for hiding this comment

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

示例本身没什么问题,是不是要处理一下 conflict ~

但是解决冲突就是paddle.cast(paddle.randn加上cast了
@megemini
Copy link
Contributor

megemini commented Oct 27, 2023

#58168 已经把这个文件改好了,是带有 cast 的版本 ~

你那边应该是在这个 PR 之前 pull 的代码,所以现在提交冲突了 ~

有两个办法:

  • 把这个 PR 直接 close 掉 ~
  • 或者,你那边在本地 pull 重新更新一下版本,然后改为不需要 cast 的版本,再 commit and push ~

你可以先试试第二个办法,有问题咱们再看看 ~


  1. git fetch upstream
  2. git pull upstream develop
  3. git push origin 0926xdoc -> 这个时候本地与远端代码统一了
  4. 修改文件,commit / push

@yuchen202
Copy link
Contributor Author

#58168 已经把这个文件改好了,是带有 cast 的版本 ~

你那边应该是在这个 PR 之前 pull 的代码,所以现在提交冲突了 ~

有两个办法:

  • 把这个 PR 直接 close 掉 ~
  • 或者,你那边在本地 pull 重新更新一下版本,然后改为不需要 cast 的版本,再 commit and push ~

你可以先试试第二个办法,有问题咱们再看看 ~

  1. git fetch upstream
  2. git pull upstream develop
  3. git push origin 0926xdoc -> 这个时候本地与远端代码统一了
  4. 修改文件,commit / push

干脆关了吧

@megemini
Copy link
Contributor

megemini commented Nov 2, 2023

@SigureMo 帮忙关了吧 ~

@SigureMo SigureMo closed this Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants