已关闭
trans_data算子新增ascend350平台支持 #5489
马琦钧创建于 22 天前关闭于 16 天前
trans_data算子新增ascend350平台支持 #5489
已关闭
马琦钧创建于 22 天前关闭于 16 天前
马琦钧
马琦钧成员
22 天前

描述

trans_data 算子新增 ascend350 平台支持,参考 cann/ops-nn!5116(matmul support ascend350)及本仓 masked_fill 等算子(!5387)的适配方式:

  1. conversion/trans_data/CMakeLists.txt:SUPPORT_COMPUTE_UNIT / SUPPORT_TILING_DIR 增加 ascend350(tiling 复用 arch35 目录)
  2. conversion/trans_data/op_host/trans_data_def.cpp:AICore 增加 ascend350 配置,复用 ascend950 的 aicore_config
  3. 新增 op_host/config/ascend350/trans_data_binary.json、trans_data_simplified_key.ini(与 ascend950 保持一致)
  4. scripts/kernel/binary_config/ascendc_config.json:TransData 增加 ascend350 编译单元及编译选项(与 ascend950 保持一致)

关联的Issue

#3166

测试

bash build.sh --opkernel --soc=ascend350 --ops=trans_data -j16 编译通过,生成 23 个 ascend350(Ascend350_355e)kernel 二进制及 binary_info_config.json,生成的编译脚本中 ascend350 已携带与 ascend950 相同的 -mllvm -cce-aicore-dcci-before-kernel-end=false 编译选项

文档更新

无

类型标签

likedislike
当前Pull Request已关闭, 关闭人@CANN-robot
马琦钧马琦钧成员
22 天前 创建了 pull request,commit 63c55e6f
atomgit-bot
atomgit-bot
22 天前 评论:

变更摘要

本 PR 为 trans_data 算子新增 ascend350 平台支持,参照 cann/ops-nn!5116(matmul 支持 ascend350)及本仓 masked_fill 等算子的适配方式。改动集中在三处:conversion/trans_data/CMakeLists.txt 的 SUPPORT_COMPUTE_UNIT / SUPPORT_TILING_DIR 增加 ascend350(tiling 复用 arch35 目录);conversion/trans_data/op_host/trans_data_def.cpp 的 AICore 注册中为 ascend350 复用 ascend950 的 aicore_config;新增 conversion/trans_data/op_host/config/ascend350/ 下的 trans_data_binary.json 与 trans_data_simplified_key.ini(与 ascend950 保持一致)。验证结果为 build.sh --opkernel --soc=ascend350 --ops=trans_data 编译通过并生成 23 个 Ascend350_355e kernel 二进制。

主要改动

  • AICore 配置注册: conversion/trans_data/op_host/trans_data_def.cpp 中新增 this->AICore().AddConfig("ascend350", aicore_config);,使 ascend350 复用 ascend950 的 aicore 配置。
  • 新增二进制配置: 新增 conversion/trans_data/op_host/config/ascend350/trans_data_binary.json,注册 TransData 各 kernel 二进制,覆盖 int8/uint8/int4/float16/float32/float4_e2m1/float4_e1m2/hifloat8 等数据类型以及 ND 与 FRACTAL_NZ、FRACTAL_NZ_C0_16、FRACTAL_NZ_C0_32 等格式之间的相互转换。
  • 新增 simplified key 配置: 新增 conversion/trans_data/op_host/config/ascend350/trans_data_simplified_key.ini,内容为 [TransData] default=0,与 ascend950 保持一致。
  • 构建配置支持: conversion/trans_data/CMakeLists.txt 的 SUPPORT_COMPUTE_UNIT / SUPPORT_TILING_DIR 增加 ascend350 支持,tiling 复用 arch35 目录。
likedislike
不准确?
atomgit-bot
atomgit-bot
22 天前 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
22 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
22 天前 评论:

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

⚠️ This PR does not yet meet the following requirements:approve (requires ≥ 1 person(s) per module)

Module Approval Details

module lgtm status approve status
*/*/op_host/*_def.cpp ✅ 汤平川, 张磊 (2/2) ❌ (0/1)(You can also ask: 王永光, 汤磊)
conversion/trans_data ✅ 汤平川, 张磊 (2/2) ✅ 汤平川, 张磊 (2/1)
repo-cann/ops-math ✅ 汤平川, 张磊 (2/2) ✅ 汤平川, 张磊 (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
此处折叠了41条消息 查看更多
sunchun成员
16 天前 评论:

您好,PR已满足合入指标,请尽快联系Committer进行合入。如暂时不需要合入,请在PR标题前加[WIP]

likedislike
马琦钧
马琦钧成员16 天前进行代码检视1
conversion/trans_data/CMakeLists.txt
@@ -11,3 +11,3 @@
1111 
1212# 设置算子定义时支持的芯片类型
13-set(SUPPORT_COMPUTE_UNIT "ascend950")
13+set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350")
马琦钧
马琦钧16 天前评论:

1

likedislike
马琦钧
马琦钧成员
16 天前 评论:

https://gitcode.com/cann/ops-math/pull/5560/ 这个 pr 已上库trans_data适配ascend350,本pr关闭

likedislike
马琦钧
马琦钧成员
16 天前 评论:

/close

likedislike
CANN-robotCANN-robot成员
16 天前 关闭了 pull request