Closed
[Requirement|需求建议]: circular_pad 质量加固 #4402
wuyanAdd on  14 days agoClosed at  13 days ago
wuyan
wuyanCollaborators
14 days ago Create

Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.

一、背景信息 (必填)

circular_pad 算子存在若干质量隐患,需系统性加固:

  1. 2d/3d 原为两个独立接口,需统一为单一 GEIR 算子(通过 paddings 长度区分模式)。
  2. 负 padding 裁剪语义与 int64 溢出未充分防护。
  3. SIMT 索引位宽(uint32/uint64)切换路径存在缺陷。
  4. golden 浮点精度判据与 spec 不一致(cross_check vs bitwise_equal)。
  5. 示例代码 executor 重复释放导致 double free。

二、价值/作用 (必填)

统一接口降低维护成本;加固负 padding 与索引位宽提升健壮性;修正精度判据保证位级精确比对,避免越界/溢出/内存错误。

三、设计方案 (必填)

3.1 使能方式(涉及哪些框架:如Aclnn直调、Pytorch训练等)

GEIR 算子(aclnn 直调 + 图模式)。

3.2 总体设计
3.2.1 算子支持的数据类型

FLOAT16、BFLOAT16、FLOAT32、INT8、INT32。

3.2.2 host侧设计

tiling/infer shape 增加 int64 溢出防护、跨实例 dtype 一致性校验、负 padding 裁剪有效性校验。

3.2.3 kernel侧设计

SIMT 核按元素总数选择 uint32/uint64 索引位宽;负 padding 裁剪 + 正值循环填充。

3.3 支持硬件

Ascend 950/960/350 等。

3.4 算子约束限制

数据格式 ND;x shape 3-5 维;paddings 长度 4(2d)/6(3d)。

关联 PR:https://gitcode.com/cann/ops-math/pull/6780

likedislike
wuyanwuyanCollaborators
14 days ago Added label: requirement
陈思
陈思Collaborators
14 days ago Comments:

/assign @rrely11

likedislike
CANN-robotCANN-robotCollaborators
14 days ago Assign rrely11 as responsible person
CANN-robotCANN-robotCollaborators
13 days ago Close issue
CANN-robotCANN-robotCollaborators
13 days ago Added label: resolved