Paddle
Paddle copied to clipboard
【Hackathon 6th No.5】Add chi2/LKJCholesky API to Paddle
PR Category
Others
PR Types
Others
Description
需要为飞桨扩充 API paddle.distribution.chi2 和 paddle.distribution.LKJCholesky 1.实现分布chi2 2.实现分布LKJCholesky,支持sample_method参数,onion/cvine可选
你的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.
Sorry to inform you that 1269701's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.
@lxd-cumt 这里还有一些静态check需要approve,麻烦看下
这里还有一些静态check需要approve,麻烦看下
这个最后我们会统一处理
https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/dev_guides/code_contributing_path_cn.html#span-id-codereview-code-review-span
@cmcamdy 评审人的每条意见都需要回复
https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/dev_guides/code_contributing_path_cn.html#span-id-codereview-code-review-span
@cmcamdy 评审人的每条意见都需要回复
好的好的,感谢提醒
这里还有一些静态check需要approve,麻烦看下
这个最后我们会统一处理
好的
不好意思,不知道为啥没有显示
我应该有回答这两个问题,我粘过来: Q1: 这部分测试是和gamma一致的(指gamma这里的测试设置的也是0.1),chi2就是gamma的变种,我理解和gamma保持一致即可 https://github.com/PaddlePaddle/Paddle/blob/62bbc39e9ab70ed97ef53413f29a97b2982550c5/test/deprecated/distribution/test_distribution_gamma_static.py#L292 Q2:有的,本地可以过的,但是CI超时了(指超过15s)。如果有需要我可以加回去,就是不保证在15s内完成
不好意思,不知道为啥没有显示
我应该有回答这两个问题,我粘过来: Q1: 这部分测试是和gamma一致的(指gamma这里的测试设置的也是0.1),chi2就是gamma的变种,我理解和gamma保持一致即可
https://github.com/PaddlePaddle/Paddle/blob/62bbc39e9ab70ed97ef53413f29a97b2982550c5/test/deprecated/distribution/test_distribution_gamma_static.py#L292
Q2:有的,本地可以过的,但是CI超时了(指超过15s)。如果有需要我可以加回去,就是不保证在15s内完成
1.rtol和gamma保持一致,在对应地方补上注释。 2.单测应该加上,设置下单测时间,并在PR的 Description 中说明下运行时间较长的原因。
Description
那请问CI中超过15s失败了这个怎么解决?有什么特殊设置可以暂时通过吗?
Description
那请问CI中超过15s失败了这个怎么解决?有什么特殊设置可以暂时通过吗?
在对应的camke中为特定单测设置,语法: set_tests_properties(单测名 PROPERTIES TIMEOUT 时间) ,
Sorry to inform you that 65f6cdb's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.
Description
那请问CI中超过15s失败了这个怎么解决?有什么特殊设置可以暂时通过吗?
在对应的camke中为特定单测设置,语法: set_tests_properties(单测名 PROPERTIES TIMEOUT 时间) ,
谢谢,已修改,pr的Description中加上了相应的说明
时
感谢您的指出,这个确实是个问题,目前chi2这边参照gamma中的示例加上了相应的类型检查
参考下这个PR,补充下单测,比如一些不合理的输入。https://github.com/PaddlePaddle/Paddle/pull/64294/files#diff-624ec68adbd3ef1f861ad55720efde0303a044025b1229d7ec712af2574f081e
参考下这个PR,补充下单测,比如一些不合理的输入。https://github.com/PaddlePaddle/Paddle/pull/64294/files#diff-624ec68adbd3ef1f861ad55720efde0303a044025b1229d7ec712af2574f081e
已经为chi2和lkj两个分布新增负样本测试
已经为chi2和lkj两个分布新增负样本测试
需要通过流水线
LGTM
已经为chi2和lkj两个分布新增负样本测试
需要通过流水线
嗯嗯目前还剩下俩,看起来需要同学手动通过
please add link of rfc in description above.
except
__init__
, shall we need method ofexpand
?
sry, I'm not quite sure about the role/function of the expand method. Can you describe it to me? I haven't found a specifically implemented expand method among the distribution.
please add link of rfc in description above.
done.
@cmcamdy 关于expand的问题,comment by @jeff41404
pytorch 中有expand方法,我们是否需要,设计文档中也没有说明,如果不需要,代码转换时如何替代
@cmcamdy 关于expand的问题,comment by @jeff41404
pytorch 中有expand方法,我们是否需要,设计文档中也没有说明,如果不需要,代码转换时如何替代
我明白了,实际上pytorch中的extend是对batch维度的扩展,如gamma中的实现:https://github.com/pytorch/pytorch/blob/e3ac61587aa368c613ef01df1f328a396b64cd5d/torch/distributions/gamma.py#L60 这部分逻辑paddle中并没有专门实现(因此在设计的时候并没有计划实现expand类的方法),但在如果想要等价实现,只需要在初始化的时候传入带batch的参数即可,我们在sample中会考虑多维shape的情况
I see, in PyTorch, the expand functionality is actually used to extend the batch dimension, as exemplified in the Gamma distribution implementation: https://github.com/pytorch/pytorch/blob/e3ac61587aa368c613ef01df1f328a396b64cd5d/torch/distributions/gamma.py#L60 PaddlePaddle doesn't have a dedicated implementation for this specific logic (indicating that it wasn't planned as part of the original design to include an expand-like method). However, to achieve an equivalent functionality in PaddlePaddle, one can simply pass batch-aware parameters during initialization. When sampling, we will take into account multi-dimensional shapes.
@cmcamdy 关于expand的问题,comment by @jeff41404 pytorch 中有expand方法,我们是否需要,设计文档中也没有说明,如果不需要,代码转换时如何替代
我明白了,实际上pytorch中的extend是对batch维度的扩展,如gamma中的实现:https://github.com/pytorch/pytorch/blob/e3ac61587aa368c613ef01df1f328a396b64cd5d/torch/distributions/gamma.py#L60 这部分逻辑paddle中并没有专门实现(因此在设计的时候并没有计划实现expand类的方法),但在如果想要等价实现,只需要在初始化的时候传入带batch的参数即可,我们在sample中会考虑多维shape的情况
I see, in PyTorch, the expand functionality is actually used to extend the batch dimension, as exemplified in the Gamma distribution implementation: https://github.com/pytorch/pytorch/blob/e3ac61587aa368c613ef01df1f328a396b64cd5d/torch/distributions/gamma.py#L60 PaddlePaddle doesn't have a dedicated implementation for this specific logic (indicating that it wasn't planned as part of the original design to include an expand-like method). However, to achieve an equivalent functionality in PaddlePaddle, one can simply pass batch-aware parameters during initialization. When sampling, we will take into account multi-dimensional shapes.
ok, thanks
@luotao1 , 我重启了下APPROVAL的CI,似乎还需要下面几位同学的approve,这个CI里面的报错提示如下: 2024-06-05 11:28:16 0. You must have raindrops2sea or XiaoguangHu01 approval for change 20+ files or add than 1000+ lines of content. 2024-06-05 11:28:16 1. You must have one QA (XieYunshen(Recommend) or chalsliu) approval for setting parameter RUN_TYPE as EXCLUSIVE, DIST, HYBRID, NIGHTLY, EXCLUSIVE:NIGHTLY or DISTNIGHTLY, or setting parameter SERIAL, or setting TIMEOUT properties.
Approval 流水线我们会来操作,请耐心等待 review 即可
Sorry to inform you that fe3edf2's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.
已修改