Skip to content

Conversation

@WintersMontagne10335
Copy link
Contributor

@WintersMontagne10335 WintersMontagne10335 commented Nov 18, 2025

PR Category

Operator Mechanism

PR Types

New features

Description

paddle.nn.MaxPool2D兼容性增强

  • milestone1:python
  • milestone2:CPU
  • milestone3:GPU
  • milestone4:XPU
  • milestone5:yaml 和 shape infer
  • milestone6:跑通编译
  • milestone7:单元测试
  • milestone8:CI 通过

@paddle-bot
Copy link

paddle-bot bot commented Nov 18, 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.

@paddle-bot paddle-bot bot added the contributor External developers label Nov 18, 2025
@luotao1 luotao1 changed the title 【Hackathon 9th Sprint No.06】NO.06 paddle.nn.MaxPool2D兼容性增强 【Hackathon 9th Sprint No.06】NO.06 paddle.nn.MaxPool2D兼容性增强 -part Nov 18, 2025
@WintersMontagne10335
Copy link
Contributor Author

@zhwesky2010 老师,根据https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/kernels/xpu/pool_kernel.cc#L106,要想 XPU 支持 dilation 参数,需要底层 xpudnn::max_pool2d 支持 dilation 参数,这个是不是不属于 Paddle 仓库?xpudnn::max_pool2d 支持 dilation 参数吗?

@zhwesky2010
Copy link
Contributor

@zhwesky2010 老师,根据https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/kernels/xpu/pool_kernel.cc#L106,要想 XPU 支持 dilation 参数,需要底层 xpudnn::max_pool2d 支持 dilation 参数,这个是不是不属于 Paddle 仓库?xpudnn::max_pool2d 支持 dilation 参数吗?

这个是xpu的sdk,不是在paddle的仓库。目前xpu的sdk都不支持dilation吗

kernel_size: Size2
stride: Size2 | None
padding: _PaddingSizeMode | Size2 | Size4
dilation: Size2
Copy link
Contributor

Choose a reason for hiding this comment

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

单测没有加,API单测、OP单测需要好好测试一下前方向。

动态图、PIR、动转静CINN模式 都需要测。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的好的

const std::vector<int64_t>& ksize,
const std::vector<int64_t>& strides,
const std::vector<int64_t>& paddings,
const std::vector<int64_t>& dilations,
Copy link
Contributor

@zhwesky2010 zhwesky2010 Nov 24, 2025

Choose a reason for hiding this comment

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

infermeta、infersy_mbolic 没有添加。单测应该是过不了的。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

研发大大您好,新增的 dilations 不影响 shape,infermeta、infer_symbolic 用之前就可以了

@WintersMontagne10335
Copy link
Contributor Author

@zhwesky2010 老师,根据https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/kernels/xpu/pool_kernel.cc#L106,要想 XPU 支持 dilation 参数,需要底层 xpudnn::max_pool2d 支持 dilation 参数,这个是不是不属于 Paddle 仓库?xpudnn::max_pool2d 支持 dilation 参数吗?

这个是xpu的sdk,不是在paddle的仓库。目前xpu的sdk都不支持dilation吗

xpu那边我不太了解,但是除此之外还有很多不支持dilation,比如gpudnn

@WintersMontagne10335
Copy link
Contributor Author

WintersMontagne10335 commented Nov 28, 2025

@zhwesky2010 研发大大,我感觉在 pool_2d 上加参数,兼容性会出问题,打算换一种思路,参照 max_pool2d_with_index 的实现思路,新增一个kernel:max_pool2d_with_dilation,可以吗?
image

@zhwesky2010 zhwesky2010 changed the title 【Hackathon 9th Sprint No.06】NO.06 paddle.nn.MaxPool2D兼容性增强 -part 【Hackathon 9th Sprint No.06】NO.06 paddle.nn.MaxPool2D兼容性增强 Dec 2, 2025
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.

3 participants