Skip to content

Conversation

@HydrogenSulfate
Copy link
Contributor

@HydrogenSulfate HydrogenSulfate commented Feb 11, 2025

PR Category

Operator Mechanism

PR Types

New features

Description

Pcard-75624

  1. 在动态图前向微分中(q #71075),make_dualunpack_dual需要使用view算子保持梯度并避免不必要的拷贝,因此将view运算的反向算子改为复用前向算子,从而支持科学计算场景下高阶微分的需求
  2. 在invoke情况下,跳过不必要的attr代码生成,否则在CI编译时会因为 unused variable 警告而直接停止编译

@paddle-bot
Copy link

paddle-bot bot commented Feb 11, 2025

你的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.

@HydrogenSulfate HydrogenSulfate changed the title [View] Change view_reshape_grad to use invoke view_reshape for high-order de… [View] Change view_reshape_grad to use invoke view_reshape for high-order de… Feb 11, 2025
@HydrogenSulfate HydrogenSulfate changed the title [View] Change view_reshape_grad to use invoke view_reshape for high-order de… [View] Change view_reshape_grad to use invoke view_reshape Feb 11, 2025
@HydrogenSulfate HydrogenSulfate changed the title [View] Change view_reshape_grad to use invoke view_reshape [View] Change view_shape_grad to use invoke view_shape Feb 11, 2025
wanghuancoder
wanghuancoder previously approved these changes Feb 12, 2025
Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

LGTM

kernel :
func : view_shape
backward : view_shape_grad
interfaces : paddle::dialect::InferSymbolicShapeInterface
Copy link
Contributor

Choose a reason for hiding this comment

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

动态图算子不需要配置 interfaces

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已删除

Remove `paddle::dialect::InferSymbolicShapeInterface` for view_shape
@HydrogenSulfate HydrogenSulfate merged commit c4c05c4 into PaddlePaddle:develop Feb 13, 2025
31 checks passed
@HydrogenSulfate HydrogenSulfate deleted the support_view_invoke_eager branch February 13, 2025 05:35
fangfangssj pushed a commit to fangfangssj/Paddle that referenced this pull request Feb 18, 2025
…dle#71086)

* change view_reshape_grad to use invoke view_reshape for high-order derivative

* remove unecessary attrs when generating nodes.cc

* Update dygraph_ops.yaml

Remove `paddle::dialect::InferSymbolicShapeInterface` for view_shape
YqGe585 pushed a commit to YqGe585/Paddle that referenced this pull request May 7, 2025
…dle#71086)

* change view_reshape_grad to use invoke view_reshape for high-order derivative

* remove unecessary attrs when generating nodes.cc

* Update dygraph_ops.yaml

Remove `paddle::dialect::InferSymbolicShapeInterface` for view_shape
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants