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

[Prim][PIR] Support dynamic shape for concat_grad #65148

Merged
merged 3 commits into from
Jun 18, 2024

Conversation

zeroRains
Copy link
Contributor

@zeroRains zeroRains commented Jun 13, 2024

PR Category

Operator Mechanism

PR Types

New features

Description

为concat_grad添加动态shape支持,添加split_grad动态shape的单测

Copy link

paddle-bot bot commented Jun 13, 2024

你的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 Jun 13, 2024
Copy link
Contributor

@cyber-pioneer cyber-pioneer left a comment

Choose a reason for hiding this comment

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

LGTM

for (int i = 0; i < x_num; ++i) {
sections.push_back(x[i].dims()[axis_value]);
std::vector<Tensor> x_grad_tmp;
if (has_dynamic_shape(x[0].shape())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

这个地方逻辑不够完善,下一个pr完善一下,并补充相关单侧。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. 拆解逻辑这块是指对vector x中的每个tensor都要进行动态shape的判断么?
  2. 补充单侧的输入一部分tensor是静态shape,一部分tensor是动态shape这样子么?

Copy link
Contributor

Choose a reason for hiding this comment

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

是的,可能存在这样的情况

if (has_dynamic_shape(x[0].shape())) {
std::vector<Tensor> sections;
for (int i = 0; i < x_num; i++) {
sections.push_back(slice<T>(shape<T>(x[i]),
Copy link
Contributor

Choose a reason for hiding this comment

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

前向拆解里封装了get_slice接口,建议这里复用

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK,下个PR一起修改

Copy link
Contributor

@Aurelius84 Aurelius84 left a comment

Choose a reason for hiding this comment

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

LGTM

@cyber-pioneer cyber-pioneer merged commit 53c78b1 into PaddlePaddle:develop Jun 18, 2024
32 of 33 checks passed
@zeroRains zeroRains deleted the concat_split branch June 18, 2024 02:56
@zeroRains zeroRains restored the concat_split branch June 18, 2024 02:56
@zeroRains zeroRains deleted the concat_split branch June 18, 2024 02:56
co63oc pushed a commit to co63oc/Paddle that referenced this pull request Jun 25, 2024
* support dynamic shape for cocnat_grad and add the dynamic shape test for split_grad

* fix the bug in detail.h and the test case

* add the allow_dynamic_shape
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants