Merged
[CANNBot]ExpandIntoJaggedPermute算子支持Ascend950 #8583
[CANNBot]ExpandIntoJaggedPermute算子支持Ascend950 #8583
Merged
陈展熹Add on Aug 12
陈展熹
陈展熹Collaborators
Aug 12

描述

ExpandIntoJaggedPermute算子新增Ascend950(arch35)SIMT实现,同时保留既有Ascend910B(arch22)实现和现有ACLNN/ST/示例交付件。

  • 新增arch35 Kernel、Host tiling、binary配置与双架构CMake路由。
  • InferShape支持UnknownRank、UnknownDim及混合已知/未知shape,输出固定推导为[output_size];InferShapeRange同步输出确定的min/max range。
  • Tiling侧按仓库报错规范做根因级拦截,覆盖dtype、format、rank、shape关系、offset/P关系、output_size、view边界、物理字节溢出、平台资源等异常,避免重复包装错误信息。
  • 保持40B TilingData ABI、TilingKey与SIMT算法等价,既有910B实现及交付件不回归。

关联的issue

Close #6134

测试

  • pre-commit clean PASS:19个变更文件,clang-format、codespell、OAT等适用hook全部通过。
  • Host UT Ascend910B:13/13 PASS。
  • Host UT Ascend950:23/23 PASS,覆盖known/unknown shape、unknown range及tiling异常边界。
  • Kernel UT Ascend910B:1/1 PASS,48个模拟核均正常退出。
  • 本地增量编译:single package与Ascend950 package PASS;两个.run包独立安装成功,4次共享库ldd均无not found。
  • TTK使用Bash定向执行:v12 6/6 PASS;Host修复后v13调整用例3/3 PASS,int32 binary_equal均为100%,OOB均为OK/OK,未发现精度问题。v13 driver日志仍显示vendors/custom_math,因此built-in Host实际加载归因记为NOT_PROVEN;本PR通过正式仓Ascend950 Host UT 23/23闭环Host逻辑。
  • ST设计生成与QA:PASS 21、FAIL 0、SKIP 7;按要求未执行ST全量。
  • 按要求未执行ACLNN测试;远端CI的ARM/独立镜像/硬件smoke等仍以PR门禁为准。

文档更新

  • README与接口文档支持矩阵更新为Ascend950支持。
  • 补充UnknownShape/UnknownRange能力与本次平台适配说明。

类型标签

AI/Agent 生成声明

代码来源:

人工审查:已完成
测试验证:已通过
合规检查:已完成

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for 陈展熹's contribution.)
陈展熹陈展熹Collaborators
Aug 12 Created pull request, commit 887d9a7f
atomgit-bot
atomgit-bot
Aug 12 Comments:

变更摘要

此 PR 为 ExpandIntoJaggedPermute 算子新增 Ascend950(arch35)SIMT 实现,同时保留既有 Ascend910B(arch22)实现。核心变更包括:将原有 Host tiling 按架构拆分为 arch22/ 和 arch35/ 两个独立目录;新增 arch35 的 Kernel 入口、SIMT 算法头文件、40 字节 TilingData 结构体及 TilingKey 定义;新增 InferShape/InferShapeRange/InferDataType 实现,支持 UnknownRank、UnknownDim 及混合已知/未知 shape;更新算子定义注册,为 Ascend950 开启动态 shape、动态 rank 等编译特性;补充对应的 binary 配置、Host UT 和 Kernel UT。

主要改动

  • 架构拆分与 arch35 Host Tiling 新增:原有 expand_into_jagged_permute_tiling.cpp/.h 移动至 arch22/ 子目录;新增 arch35/expand_into_jagged_permute_tiling.cpp,实现 ExpandIntoJaggedPermuteTilingFunc 完整 tiling 流程,包含对 dtype、format、rank、shape 关系、offset/P 关系、output_size、view 边界、物理字节溢出及平台资源的根因级校验。

  • arch35 SIMT Kernel 实现:新增 op_kernel/arch35/expand_into_jagged_permute_simt.h,实现双路径 SIMT 算法——基于 ShouldUseOutputCentric 的启发式选择,在 ExpandIntoJaggedPermuteSimt(段驱动,支持 strided output)和 ExpandIntoJaggedPermuteOutputCentricSimt(输出驱动)之间动态切换,入口文件 expand_into_jagged_permute.cpp 通过 EXPAND_JAGGED_MODE_OUTPUT_BLOCK 模式调度。

  • TilingData 与 TilingKey 定义:新增 expand_into_jagged_permute_tiling_data.h,定义 40 字节 ExpandIntoJaggedPermuteTilingData 结构体(含 segmentCount、outputSize、perCoreOutput、outputStride、needCoreNum、reserved 字段,附 static_assert 保障 ABI 布局);新增 expand_into_jagged_permute_tiling_key.h,声明 EXPAND_JAGGED_MODE_OUTPUT_BLOCK 调度模式及模板参数选择。

  • InferShape 能力补齐:新增 expand_into_jagged_permute_infershape.cpp,实现 InferShapeExpandIntoJaggedPermute(支持 UnknownRank/UnknownDim 及混合场景,输出固定推导为 [output_size])、InferShapeRangeExpandIntoJaggedPermute(同步输出确定 min/max range)和 InferDataTypeExpandIntoJaggedPermute(校验输入为 DT_INT32 或 DT_UNDEFINED,输出固定为 DT_INT32)。

  • 算子定义更新与 Ascend950 编译配置:expand_into_jagged_permute_def.cpp 新增 ascend950 的 OpAICoreConfig,启用 DynamicCompileStaticFlag、DynamicRankSupportFlag、DynamicShapeSupportFlag 和 PrecisionReduceFlag;新增 ascend950/expand_into_jagged_permute_binary.json binary 配置。

likedislike
Incorrect?
atomgit-bot
atomgit-bot
Aug 12 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Aug 12 Added label: cann-cla/no
CANN-robot
CANN-robotCollaborators
Aug 12 Comments:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
*/*/README.md ✅ 汤平川, 陈娇, 钱泽洪, 上官秦南 (4/2) ✅ 陈娇 (1/1)
*/*/docs/acl*.md ✅ 陈娇, 上官秦南, 汤平川, 钱泽洪 (4/2) ✅ 陈娇 (1/1)
*/*/op_host/*_def.cpp ✅ 汤磊, 钱泽洪, 上官秦南, 汤平川 (4/2) ✅ 汤磊 (1/1)
docs ✅ 陈娇, 汤平川 (2/2) ✅ 陈娇 (1/1)
index ✅ 汤平川, 钱泽洪, 上官秦南 (3/2) ✅ 汤平川, 钱泽洪, 上官秦南 (3/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

yourealize, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
204 messages are collapsed here。 See more
CANN-robot
CANN-robotCollaborators
Sep 28 Comments:

The MR can not be merged, because of CodeReview discussion not resolved

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike
陈展熹陈展熹Collaborators
Sep 28 Resolved final issue
CANN-robotCANN-robotCollaborators
Sep 28 Closed associated issue
CANN-robotCANN-robotCollaborators
Sep 28 Merged pull request
CANN-robot
CANN-robotCollaborators
Sep 28 Comments:

Pull Request 已合并或已关闭。

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike