| Files | Last commit | Last update |
|---|---|---|
Ascend960DT 前置回退 Co-authored-by: Ekoxier<husizhe@huawei.com> # message auto-generated for no-merge-commit merge: !6678 merge reset_v121_modify into master Ascend960DT 前置回退 Created-by: Ekoxier Commit-by: Ekoxier Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> Ascend960DT 前置回退: asc-toolkit关联包新增桩指令需要asc-devkit镜像更新, 当前回避 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6678 | 26 days ago | |
Ascend960DT 前置回退 Co-authored-by: Ekoxier<husizhe@huawei.com> # message auto-generated for no-merge-commit merge: !6678 merge reset_v121_modify into master Ascend960DT 前置回退 Created-by: Ekoxier Commit-by: Ekoxier Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> Ascend960DT 前置回退: asc-toolkit关联包新增桩指令需要asc-devkit镜像更新, 当前回避 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6678 | 26 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
basic_api新增9201/9202文件 Co-authored-by: maohaodi<maohaodi@huawei.com> # message auto-generated for no-merge-commit merge: !6631 merge basic_api_add_920x into master basic_api新增9201/9202文件 Created-by: maohaodi Commit-by: maohaodi Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 将 impl/basic_api中的dav-9201和reg_compute/dav-9201 适配迁移至本仓,仅新增impl实现文件,暂不实际启用 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> 无 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 新增代码但不真实启用,确保不影响UT和RDV ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> 无 ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6631 | 29 days ago | |
Ascend960DT 前置回退 Co-authored-by: Ekoxier<husizhe@huawei.com> # message auto-generated for no-merge-commit merge: !6678 merge reset_v121_modify into master Ascend960DT 前置回退 Created-by: Ekoxier Commit-by: Ekoxier Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> Ascend960DT 前置回退: asc-toolkit关联包新增桩指令需要asc-devkit镜像更新, 当前回避 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6678 | 26 days ago | |
add kernel tla about icache preload flag Co-authored-by: wuyang_hw<wuyang74@hisilicon.com> # message auto-generated for no-merge-commit merge: !6525 merge icache_preload_tlv into master add kernel tla about icache preload flag Created-by: wuyang_hw Commit-by: wuyang_hw Merged-by: cann-robot Description: ## 描述 为 dav-2201 和 dav-3510 的指令缓存预加载接口增加二进制元数据标记,使编译产物能够标识 kernel 是否使用 ICache preload。 - 覆盖 basic_api 的 AscendC::ICachePreLoad 和 C API 的 asc_icache_preload。 - 在接口实现中使用 used 和 section(".ascend.meta") 属性,将 TLV 标记写入设备侧 .o。 - 新增 B_TYPE_ICACHE_PRELOAD_FLAG,类型值为 7,数据长度为 4 字节。 - 数据字段由 uint16_t preload 标记和 uint16_t reserved 组成,分别初始化为 1、0,保留后续扩展空间。 ## 关联的Issue NA ## 测试 - 使用 readelf 检查设备侧 .o:开启 preload 时存在 type=7、len=4、flag=1、reserved=0 的 TLV;关闭时不存在该标记。 ## 文档更新 NA ## 类型标签 - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6525 | 1 month ago | |
fix: integerOverflow (整数溢出(含上溢出/下溢出)) Co-authored-by: fengjian12345<fengjian38@h-partners.com> Co-authored-by: atomgit-bot<noreply@gitcode.com> # message auto-generated for no-merge-commit merge: !6665 merge master into master fix: integerOverflow (整数溢出(含上溢出/下溢出)) Created-by: fengjian12345 Commit-by: atomgit-bot;fengjian12345 Merged-by: cann-robot Description: ## 描述 在asc-devkit-master/impl/basic_api/dav_l300/kernel_operator_vec_reduce_impl.h的1365行, 将字面量 1 改为无符号类型以避免有符号移位溢出: uint32_t bit_to_check = (1u << (inRepeatIndex % 64)); ## 关联的Issue https://gitcode.com/cann/asc-devkit/issues/1861 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6665 | 25 days ago | |
Ascend960DT 前置回退 Co-authored-by: Ekoxier<husizhe@huawei.com> # message auto-generated for no-merge-commit merge: !6678 merge reset_v121_modify into master Ascend960DT 前置回退 Created-by: Ekoxier Commit-by: Ekoxier Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> Ascend960DT 前置回退: asc-toolkit关联包新增桩指令需要asc-devkit镜像更新, 当前回避 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6678 | 26 days ago | |
Ascend960DT 前置回退 Co-authored-by: Ekoxier<husizhe@huawei.com> # message auto-generated for no-merge-commit merge: !6678 merge reset_v121_modify into master Ascend960DT 前置回退 Created-by: Ekoxier Commit-by: Ekoxier Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> Ascend960DT 前置回退: asc-toolkit关联包新增桩指令需要asc-devkit镜像更新, 当前回避 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6678 | 26 days ago | |
Ascend960DT 前置回退 Co-authored-by: Ekoxier<husizhe@huawei.com> # message auto-generated for no-merge-commit merge: !6678 merge reset_v121_modify into master Ascend960DT 前置回退 Created-by: Ekoxier Commit-by: Ekoxier Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> Ascend960DT 前置回退: asc-toolkit关联包新增桩指令需要asc-devkit镜像更新, 当前回避 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6678 | 26 days ago | |
Ascend960DT 前置回退 Co-authored-by: Ekoxier<husizhe@huawei.com> # message auto-generated for no-merge-commit merge: !6678 merge reset_v121_modify into master Ascend960DT 前置回退 Created-by: Ekoxier Commit-by: Ekoxier Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> Ascend960DT 前置回退: asc-toolkit关联包新增桩指令需要asc-devkit镜像更新, 当前回避 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6678 | 26 days ago | |
Ascend960DT 前置回退 Co-authored-by: Ekoxier<husizhe@huawei.com> # message auto-generated for no-merge-commit merge: !6678 merge reset_v121_modify into master Ascend960DT 前置回退 Created-by: Ekoxier Commit-by: Ekoxier Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> Ascend960DT 前置回退: asc-toolkit关联包新增桩指令需要asc-devkit镜像更新, 当前回避 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6678 | 26 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 新增 dav_v516 架构编译构建工具与调试, ut适配等 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6514 merge master_main into master feat: 新增 dav_v516 架构编译构建工具与调试, ut适配等 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 为 asc-devkit 新增 dav_v516(NPU_ARCH == 5162)架构的构建与调试支持: 构建工具:新增 ascend5162a.py 平台配置,适配 cmake 与 compile_op/ascendc_compile_v220 等编译脚本、ccec/platform_info 等基础设施,使 5162 架构可参与编译。 调试工具:新增 impl/utils/debug/npu_arch_5162/ 下的 dump/printf/类型转换工具头文件。 运行时:适配 asc_platform、ascendc_runtime、opbuild 等。 改动原因:支持 dav_v516(5162)架构的构建与调试能力。 改动方法:新增 5162 平台配置与调试头文件,并在构建脚本中并入 5162 架构分支。 改动影响: Device 行为变更 — Reduce 系列(影响 3510、9201、5102、3003、3113) reduce_common_ar_reuse_align_3510_impl.h:38 与 ...less_than_vl3510_impl.h:64:新增无架构 guard 的 if constexpr (vlSize > ONE_BLK_SIZE) 分支,vlSize ≤ ONE_BLK_SIZE 时由 LoadAlign 改为 LoadUnAlignPre+LoadUnAlign,只影响VL_size≤32B的架构,即只影响5162 Host tiling 变更 — WelfordFinalize(影响 3510、9201、5102、3003、3113) welfordfinalize_tiling_impl.cpp:43:reduceTmpSize 由硬编码 reduceK/64、按 128 对齐 → 改为基于 GetVecRegLen() 计算。仅当这些架构 GetVecRegLen()==256B 时数值等价,否则 tmp buffer 尺寸变化 编译产物变更、数值不变 — 浮点字面量 1.0→1.0f(仅常量初始化,无风险) API 面纯新增(不改变既有行为) 各 SOC 列表追加 ascend5162a/Ascend5162A(config.cmake、op_cfg_generator.h、asc_platform.h、ascendc_runtime.cpp、const_var.py、opdesc_parser.py)及 is_516r2() 门控的编译工具链 — 均为追加式,现有 SoC 路径不变 三、净零影响的架构 1001、3002、3102、5101、5161、5163、5165:所有涉及它们的改动均为条件列表追加 5162 或等价重写(defined() 补齐、格式化),编译语义逐 arch 验证不变 2002、2201:仅受第 3 条字面量改动影响(数值等价) ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 本地执行 build.sh 完成全量编译与打包,成功生成 cann-asc-devkit_9.3.0_linux-aarch64.run, 执行ut测试。 ## 文档更新 无文档更新。 ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6514 | 29 days ago | |
feat: 新增 dav_v516 架构算子条件编译宏支持 Co-authored-by: Bartonzany<lanbin4@huawei.com> # message auto-generated for no-merge-commit merge: !5674 merge feat_dav_v516_macro into master feat: 新增 dav_v516 架构算子条件编译宏支持 Created-by: Bartonzany Commit-by: Bartonzany Merged-by: cann-robot Description: ## 描述 为 asc-devkit 补齐 dav_v516( __NPU_ARCH__ == 5162)架构的条件编译支持:在激活、数学、归一化、量化、reduce、sort/topk、pad/transpose 等高级 API 算子及其 kernel check、tiling、基础 API 接口头文件中,为既有 3510/5102 架构分支并入 __NPU_ARCH__ == 5162,并引入 dav_v516 实现头文件,使算子库在 dav_v516 架构下编译运行。 改动原因:支持 dav_v516(5162)新一代 NPU 架构。 改动方法:在 3510/5102 条件编译分支中并入 __NPU_ARCH__ == 5162,复用 3510 系列实现。 ## 关联的Issue ## 测试 本地执行 build.sh 完成全量编译与打包,成功生成 cann-asc-devkit_9.2.0_linux-aarch64.run。 ## 文档更新 无文档更新。 ## 类型标签 - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5674 | 1 month ago | |
refactor:重构impl/basic_api下的代码格式 Co-authored-by: haipingmao<maohaiping@huawei.com> # message auto-generated for no-merge-commit merge: !4273 merge pr_4260 into master refactor:重构impl/basic_api下的代码格式 Created-by: haipingmao Commit-by: haipingmao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 按照clang-format格式刷新impl/basic_api的代码格式。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> NA ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> compile ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4273 | 3 months ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
adapt fifo dump for 3002 Co-authored-by: liuliu876<liuxin429@huawei.com> # message auto-generated for no-merge-commit merge: !5902 merge adapt_dump_3002 into master adapt fifo dump for 3002 Created-by: liuliu876 Commit-by: liuliu876 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5902 | 1 month ago | |
解决include 和 impl 目录中多个同名头文件问题 Co-authored-by: jcmrn0930<2418672268@qq.com> # message auto-generated for no-merge-commit merge: !6284 merge fix/header-path-conflicts into master 解决include 和 impl 目录中多个同名头文件问题 Created-by: jcmrn0930 Commit-by: jcmrn0930 Merged-by: cann-robot Description: ## 描述 解决include 和 impl 目录中多个同名头文件问题 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6284 | 1 month ago | |
feat: show physical positions in debug errors Co-authored-by: kyzyc<zhuyuchen10@huawei.com> # message auto-generated for no-merge-commit merge: !4493 merge dfx into master feat: show physical positions in debug errors Created-by: kyzyc Commit-by: kyzyc Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 1. 整改 npu/cpu DFX 报错信息,展示物理位置(逻辑位置) 2. 修复 cpu 下部分架构逻辑位置映射物理位置问题 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4493 | 3 months ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
refactor:重构impl/basic_api下的代码格式 Co-authored-by: haipingmao<maohaiping@huawei.com> # message auto-generated for no-merge-commit merge: !4273 merge pr_4260 into master refactor:重构impl/basic_api下的代码格式 Created-by: haipingmao Commit-by: haipingmao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 按照clang-format格式刷新impl/basic_api的代码格式。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> NA ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> compile ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4273 | 3 months ago | |
refactor:重构impl/basic_api下的代码格式 Co-authored-by: haipingmao<maohaiping@huawei.com> # message auto-generated for no-merge-commit merge: !4273 merge pr_4260 into master refactor:重构impl/basic_api下的代码格式 Created-by: haipingmao Commit-by: haipingmao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 按照clang-format格式刷新impl/basic_api的代码格式。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> NA ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> compile ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4273 | 3 months ago | |
refactor:重构impl/basic_api下的代码格式 Co-authored-by: haipingmao<maohaiping@huawei.com> # message auto-generated for no-merge-commit merge: !4273 merge pr_4260 into master refactor:重构impl/basic_api下的代码格式 Created-by: haipingmao Commit-by: haipingmao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 按照clang-format格式刷新impl/basic_api的代码格式。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> NA ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> compile ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4273 | 3 months ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
add kirin v516 basic api Co-authored-by: zengjuan<zengjuan2@huawei.com> # message auto-generated for no-merge-commit merge: !4913 merge master into master add kirin v516 basic api Created-by: zengjuan Commit-by: zengjuan Merged-by: cann-robot Description: ## 描述 add kirin v516 basic api ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 1)完成算子冒烟测试:  2)完成turing黄区门禁测试: https://turing-ci.huawei.com/#/buildInfo/main_chart?change_id=I09a52f7f3b9ec35bb38dbc34d1f0749556e7be57&trigger_timestamp=20260825_101751362&branch=br_hisi_trunk_ai&task_class=release&sort_field=status_priority&sort_order=ascend ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4913 | 2 months ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
refactor:重构impl/basic_api下的代码格式 Co-authored-by: haipingmao<maohaiping@huawei.com> # message auto-generated for no-merge-commit merge: !4273 merge pr_4260 into master refactor:重构impl/basic_api下的代码格式 Created-by: haipingmao Commit-by: haipingmao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 按照clang-format格式刷新impl/basic_api的代码格式。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> NA ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> compile ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4273 | 3 months ago | |
refactor:重构impl/basic_api下的代码格式 Co-authored-by: haipingmao<maohaiping@huawei.com> # message auto-generated for no-merge-commit merge: !4273 merge pr_4260 into master refactor:重构impl/basic_api下的代码格式 Created-by: haipingmao Commit-by: haipingmao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 按照clang-format格式刷新impl/basic_api的代码格式。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> NA ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> compile ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4273 | 3 months ago | |
feat: 新增 dav_v516 架构算子条件编译宏支持 Co-authored-by: Bartonzany<lanbin4@huawei.com> # message auto-generated for no-merge-commit merge: !5674 merge feat_dav_v516_macro into master feat: 新增 dav_v516 架构算子条件编译宏支持 Created-by: Bartonzany Commit-by: Bartonzany Merged-by: cann-robot Description: ## 描述 为 asc-devkit 补齐 dav_v516( __NPU_ARCH__ == 5162)架构的条件编译支持:在激活、数学、归一化、量化、reduce、sort/topk、pad/transpose 等高级 API 算子及其 kernel check、tiling、基础 API 接口头文件中,为既有 3510/5102 架构分支并入 __NPU_ARCH__ == 5162,并引入 dav_v516 实现头文件,使算子库在 dav_v516 架构下编译运行。 改动原因:支持 dav_v516(5162)新一代 NPU 架构。 改动方法:在 3510/5102 条件编译分支中并入 __NPU_ARCH__ == 5162,复用 3510 系列实现。 ## 关联的Issue ## 测试 本地执行 build.sh 完成全量编译与打包,成功生成 cann-asc-devkit_9.2.0_linux-aarch64.run。 ## 文档更新 无文档更新。 ## 类型标签 - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5674 | 1 month ago | |
refactor:重构impl/basic_api下的代码格式 Co-authored-by: haipingmao<maohaiping@huawei.com> # message auto-generated for no-merge-commit merge: !4273 merge pr_4260 into master refactor:重构impl/basic_api下的代码格式 Created-by: haipingmao Commit-by: haipingmao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 按照clang-format格式刷新impl/basic_api的代码格式。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> NA ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> compile ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4273 | 3 months ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
add kirin v516 basic api Co-authored-by: zengjuan<zengjuan2@huawei.com> # message auto-generated for no-merge-commit merge: !4913 merge master into master add kirin v516 basic api Created-by: zengjuan Commit-by: zengjuan Merged-by: cann-robot Description: ## 描述 add kirin v516 basic api ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 1)完成算子冒烟测试:  2)完成turing黄区门禁测试: https://turing-ci.huawei.com/#/buildInfo/main_chart?change_id=I09a52f7f3b9ec35bb38dbc34d1f0749556e7be57&trigger_timestamp=20260825_101751362&branch=br_hisi_trunk_ai&task_class=release&sort_field=status_priority&sort_order=ascend ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4913 | 2 months ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 新增 dav_v516 架构算子条件编译宏支持 Co-authored-by: Bartonzany<lanbin4@huawei.com> # message auto-generated for no-merge-commit merge: !5674 merge feat_dav_v516_macro into master feat: 新增 dav_v516 架构算子条件编译宏支持 Created-by: Bartonzany Commit-by: Bartonzany Merged-by: cann-robot Description: ## 描述 为 asc-devkit 补齐 dav_v516( __NPU_ARCH__ == 5162)架构的条件编译支持:在激活、数学、归一化、量化、reduce、sort/topk、pad/transpose 等高级 API 算子及其 kernel check、tiling、基础 API 接口头文件中,为既有 3510/5102 架构分支并入 __NPU_ARCH__ == 5162,并引入 dav_v516 实现头文件,使算子库在 dav_v516 架构下编译运行。 改动原因:支持 dav_v516(5162)新一代 NPU 架构。 改动方法:在 3510/5102 条件编译分支中并入 __NPU_ARCH__ == 5162,复用 3510 系列实现。 ## 关联的Issue ## 测试 本地执行 build.sh 完成全量编译与打包,成功生成 cann-asc-devkit_9.2.0_linux-aarch64.run。 ## 文档更新 无文档更新。 ## 类型标签 - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5674 | 1 month ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 新增 dav_v516 架构算子条件编译宏支持 Co-authored-by: Bartonzany<lanbin4@huawei.com> # message auto-generated for no-merge-commit merge: !5674 merge feat_dav_v516_macro into master feat: 新增 dav_v516 架构算子条件编译宏支持 Created-by: Bartonzany Commit-by: Bartonzany Merged-by: cann-robot Description: ## 描述 为 asc-devkit 补齐 dav_v516( __NPU_ARCH__ == 5162)架构的条件编译支持:在激活、数学、归一化、量化、reduce、sort/topk、pad/transpose 等高级 API 算子及其 kernel check、tiling、基础 API 接口头文件中,为既有 3510/5102 架构分支并入 __NPU_ARCH__ == 5162,并引入 dav_v516 实现头文件,使算子库在 dav_v516 架构下编译运行。 改动原因:支持 dav_v516(5162)新一代 NPU 架构。 改动方法:在 3510/5102 条件编译分支中并入 __NPU_ARCH__ == 5162,复用 3510 系列实现。 ## 关联的Issue ## 测试 本地执行 build.sh 完成全量编译与打包,成功生成 cann-asc-devkit_9.2.0_linux-aarch64.run。 ## 文档更新 无文档更新。 ## 类型标签 - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5674 | 1 month ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
refactor:重构impl/basic_api下的代码格式 Co-authored-by: haipingmao<maohaiping@huawei.com> # message auto-generated for no-merge-commit merge: !4273 merge pr_4260 into master refactor:重构impl/basic_api下的代码格式 Created-by: haipingmao Commit-by: haipingmao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 按照clang-format格式刷新impl/basic_api的代码格式。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> NA ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> compile ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4273 | 3 months ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 新增 dav_v516 架构算子条件编译宏支持 Co-authored-by: Bartonzany<lanbin4@huawei.com> # message auto-generated for no-merge-commit merge: !5674 merge feat_dav_v516_macro into master feat: 新增 dav_v516 架构算子条件编译宏支持 Created-by: Bartonzany Commit-by: Bartonzany Merged-by: cann-robot Description: ## 描述 为 asc-devkit 补齐 dav_v516( __NPU_ARCH__ == 5162)架构的条件编译支持:在激活、数学、归一化、量化、reduce、sort/topk、pad/transpose 等高级 API 算子及其 kernel check、tiling、基础 API 接口头文件中,为既有 3510/5102 架构分支并入 __NPU_ARCH__ == 5162,并引入 dav_v516 实现头文件,使算子库在 dav_v516 架构下编译运行。 改动原因:支持 dav_v516(5162)新一代 NPU 架构。 改动方法:在 3510/5102 条件编译分支中并入 __NPU_ARCH__ == 5162,复用 3510 系列实现。 ## 关联的Issue ## 测试 本地执行 build.sh 完成全量编译与打包,成功生成 cann-asc-devkit_9.2.0_linux-aarch64.run。 ## 文档更新 无文档更新。 ## 类型标签 - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5674 | 1 month ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
refactor:重构impl/basic_api下的代码格式 Co-authored-by: haipingmao<maohaiping@huawei.com> # message auto-generated for no-merge-commit merge: !4273 merge pr_4260 into master refactor:重构impl/basic_api下的代码格式 Created-by: haipingmao Commit-by: haipingmao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 按照clang-format格式刷新impl/basic_api的代码格式。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> NA ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> compile ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4273 | 3 months ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 新增 dav_v516 架构算子条件编译宏支持 Co-authored-by: Bartonzany<lanbin4@huawei.com> # message auto-generated for no-merge-commit merge: !5674 merge feat_dav_v516_macro into master feat: 新增 dav_v516 架构算子条件编译宏支持 Created-by: Bartonzany Commit-by: Bartonzany Merged-by: cann-robot Description: ## 描述 为 asc-devkit 补齐 dav_v516( __NPU_ARCH__ == 5162)架构的条件编译支持:在激活、数学、归一化、量化、reduce、sort/topk、pad/transpose 等高级 API 算子及其 kernel check、tiling、基础 API 接口头文件中,为既有 3510/5102 架构分支并入 __NPU_ARCH__ == 5162,并引入 dav_v516 实现头文件,使算子库在 dav_v516 架构下编译运行。 改动原因:支持 dav_v516(5162)新一代 NPU 架构。 改动方法:在 3510/5102 条件编译分支中并入 __NPU_ARCH__ == 5162,复用 3510 系列实现。 ## 关联的Issue ## 测试 本地执行 build.sh 完成全量编译与打包,成功生成 cann-asc-devkit_9.2.0_linux-aarch64.run。 ## 文档更新 无文档更新。 ## 类型标签 - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5674 | 1 month ago | |
refactor:重构impl/basic_api下的代码格式 Co-authored-by: haipingmao<maohaiping@huawei.com> # message auto-generated for no-merge-commit merge: !4273 merge pr_4260 into master refactor:重构impl/basic_api下的代码格式 Created-by: haipingmao Commit-by: haipingmao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 按照clang-format格式刷新impl/basic_api的代码格式。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> NA ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> compile ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4273 | 3 months ago | |
refactor:重构impl/basic_api下的代码格式 Co-authored-by: haipingmao<maohaiping@huawei.com> # message auto-generated for no-merge-commit merge: !4273 merge pr_4260 into master refactor:重构impl/basic_api下的代码格式 Created-by: haipingmao Commit-by: haipingmao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 按照clang-format格式刷新impl/basic_api的代码格式。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> NA ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> compile ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4273 | 3 months ago | |
refactor:重构impl/basic_api下的代码格式 Co-authored-by: haipingmao<maohaiping@huawei.com> # message auto-generated for no-merge-commit merge: !4273 merge pr_4260 into master refactor:重构impl/basic_api下的代码格式 Created-by: haipingmao Commit-by: haipingmao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 按照clang-format格式刷新impl/basic_api的代码格式。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> NA ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> compile ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4273 | 3 months ago | |
for kirin 5161 api Co-authored-by: zengjuan<zengjuan2@huawei.com> # message auto-generated for no-merge-commit merge: !5764 merge master into master for kirin 5161 api Created-by: zengjuan Commit-by: zengjuan Merged-by: cann-robot Description: ## 描述 1)5101不支持mx buffer 2)适配DataCopy L1->GM 3)适配5161 aicache ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 1)算子obp冒烟 2)黄区门禁 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5764 | 1 month ago | |
feat: 新增 dav_v516 架构算子条件编译宏支持 Co-authored-by: Bartonzany<lanbin4@huawei.com> # message auto-generated for no-merge-commit merge: !5674 merge feat_dav_v516_macro into master feat: 新增 dav_v516 架构算子条件编译宏支持 Created-by: Bartonzany Commit-by: Bartonzany Merged-by: cann-robot Description: ## 描述 为 asc-devkit 补齐 dav_v516( __NPU_ARCH__ == 5162)架构的条件编译支持:在激活、数学、归一化、量化、reduce、sort/topk、pad/transpose 等高级 API 算子及其 kernel check、tiling、基础 API 接口头文件中,为既有 3510/5102 架构分支并入 __NPU_ARCH__ == 5162,并引入 dav_v516 实现头文件,使算子库在 dav_v516 架构下编译运行。 改动原因:支持 dav_v516(5162)新一代 NPU 架构。 改动方法:在 3510/5102 条件编译分支中并入 __NPU_ARCH__ == 5162,复用 3510 系列实现。 ## 关联的Issue ## 测试 本地执行 build.sh 完成全量编译与打包,成功生成 cann-asc-devkit_9.2.0_linux-aarch64.run。 ## 文档更新 无文档更新。 ## 类型标签 - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5674 | 1 month ago | |
feat: 新增 dav_v516 架构算子条件编译宏支持 Co-authored-by: Bartonzany<lanbin4@huawei.com> # message auto-generated for no-merge-commit merge: !5674 merge feat_dav_v516_macro into master feat: 新增 dav_v516 架构算子条件编译宏支持 Created-by: Bartonzany Commit-by: Bartonzany Merged-by: cann-robot Description: ## 描述 为 asc-devkit 补齐 dav_v516( __NPU_ARCH__ == 5162)架构的条件编译支持:在激活、数学、归一化、量化、reduce、sort/topk、pad/transpose 等高级 API 算子及其 kernel check、tiling、基础 API 接口头文件中,为既有 3510/5102 架构分支并入 __NPU_ARCH__ == 5162,并引入 dav_v516 实现头文件,使算子库在 dav_v516 架构下编译运行。 改动原因:支持 dav_v516(5162)新一代 NPU 架构。 改动方法:在 3510/5102 条件编译分支中并入 __NPU_ARCH__ == 5162,复用 3510 系列实现。 ## 关联的Issue ## 测试 本地执行 build.sh 完成全量编译与打包,成功生成 cann-asc-devkit_9.2.0_linux-aarch64.run。 ## 文档更新 无文档更新。 ## 类型标签 - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5674 | 1 month ago | |
Modify the processing logic of int4b_t Co-authored-by: chupeng1996<chupeng5@huawei.com> # message auto-generated for no-merge-commit merge: !6129 merge master into master Modify the processing logic of int4b_t Created-by: chupeng1996 Commit-by: chupeng1996 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> Modify the processing logic of int4b_t ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> NA ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 编包装包正常 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6129 | 1 month ago | |
feat: show physical positions in debug errors Co-authored-by: kyzyc<zhuyuchen10@huawei.com> # message auto-generated for no-merge-commit merge: !4493 merge dfx into master feat: show physical positions in debug errors Created-by: kyzyc Commit-by: kyzyc Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 1. 整改 npu/cpu DFX 报错信息,展示物理位置(逻辑位置) 2. 修复 cpu 下部分架构逻辑位置映射物理位置问题 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4493 | 3 months ago | |
feat: 新增 dav_v516 架构算子条件编译宏支持 Co-authored-by: Bartonzany<lanbin4@huawei.com> # message auto-generated for no-merge-commit merge: !5674 merge feat_dav_v516_macro into master feat: 新增 dav_v516 架构算子条件编译宏支持 Created-by: Bartonzany Commit-by: Bartonzany Merged-by: cann-robot Description: ## 描述 为 asc-devkit 补齐 dav_v516( __NPU_ARCH__ == 5162)架构的条件编译支持:在激活、数学、归一化、量化、reduce、sort/topk、pad/transpose 等高级 API 算子及其 kernel check、tiling、基础 API 接口头文件中,为既有 3510/5102 架构分支并入 __NPU_ARCH__ == 5162,并引入 dav_v516 实现头文件,使算子库在 dav_v516 架构下编译运行。 改动原因:支持 dav_v516(5162)新一代 NPU 架构。 改动方法:在 3510/5102 条件编译分支中并入 __NPU_ARCH__ == 5162,复用 3510 系列实现。 ## 关联的Issue ## 测试 本地执行 build.sh 完成全量编译与打包,成功生成 cann-asc-devkit_9.2.0_linux-aarch64.run。 ## 文档更新 无文档更新。 ## 类型标签 - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5674 | 1 month ago | |
feat: 新增 dav_v516 架构编译构建工具与调试, ut适配等 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6514 merge master_main into master feat: 新增 dav_v516 架构编译构建工具与调试, ut适配等 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 为 asc-devkit 新增 dav_v516(NPU_ARCH == 5162)架构的构建与调试支持: 构建工具:新增 ascend5162a.py 平台配置,适配 cmake 与 compile_op/ascendc_compile_v220 等编译脚本、ccec/platform_info 等基础设施,使 5162 架构可参与编译。 调试工具:新增 impl/utils/debug/npu_arch_5162/ 下的 dump/printf/类型转换工具头文件。 运行时:适配 asc_platform、ascendc_runtime、opbuild 等。 改动原因:支持 dav_v516(5162)架构的构建与调试能力。 改动方法:新增 5162 平台配置与调试头文件,并在构建脚本中并入 5162 架构分支。 改动影响: Device 行为变更 — Reduce 系列(影响 3510、9201、5102、3003、3113) reduce_common_ar_reuse_align_3510_impl.h:38 与 ...less_than_vl3510_impl.h:64:新增无架构 guard 的 if constexpr (vlSize > ONE_BLK_SIZE) 分支,vlSize ≤ ONE_BLK_SIZE 时由 LoadAlign 改为 LoadUnAlignPre+LoadUnAlign,只影响VL_size≤32B的架构,即只影响5162 Host tiling 变更 — WelfordFinalize(影响 3510、9201、5102、3003、3113) welfordfinalize_tiling_impl.cpp:43:reduceTmpSize 由硬编码 reduceK/64、按 128 对齐 → 改为基于 GetVecRegLen() 计算。仅当这些架构 GetVecRegLen()==256B 时数值等价,否则 tmp buffer 尺寸变化 编译产物变更、数值不变 — 浮点字面量 1.0→1.0f(仅常量初始化,无风险) API 面纯新增(不改变既有行为) 各 SOC 列表追加 ascend5162a/Ascend5162A(config.cmake、op_cfg_generator.h、asc_platform.h、ascendc_runtime.cpp、const_var.py、opdesc_parser.py)及 is_516r2() 门控的编译工具链 — 均为追加式,现有 SoC 路径不变 三、净零影响的架构 1001、3002、3102、5101、5161、5163、5165:所有涉及它们的改动均为条件列表追加 5162 或等价重写(defined() 补齐、格式化),编译语义逐 arch 验证不变 2002、2201:仅受第 3 条字面量改动影响(数值等价) ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 本地执行 build.sh 完成全量编译与打包,成功生成 cann-asc-devkit_9.3.0_linux-aarch64.run, 执行ut测试。 ## 文档更新 无文档更新。 ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6514 | 29 days ago | |
feat: 新增 dav_v516 架构算子条件编译宏支持 Co-authored-by: Bartonzany<lanbin4@huawei.com> # message auto-generated for no-merge-commit merge: !5674 merge feat_dav_v516_macro into master feat: 新增 dav_v516 架构算子条件编译宏支持 Created-by: Bartonzany Commit-by: Bartonzany Merged-by: cann-robot Description: ## 描述 为 asc-devkit 补齐 dav_v516( __NPU_ARCH__ == 5162)架构的条件编译支持:在激活、数学、归一化、量化、reduce、sort/topk、pad/transpose 等高级 API 算子及其 kernel check、tiling、基础 API 接口头文件中,为既有 3510/5102 架构分支并入 __NPU_ARCH__ == 5162,并引入 dav_v516 实现头文件,使算子库在 dav_v516 架构下编译运行。 改动原因:支持 dav_v516(5162)新一代 NPU 架构。 改动方法:在 3510/5102 条件编译分支中并入 __NPU_ARCH__ == 5162,复用 3510 系列实现。 ## 关联的Issue ## 测试 本地执行 build.sh 完成全量编译与打包,成功生成 cann-asc-devkit_9.2.0_linux-aarch64.run。 ## 文档更新 无文档更新。 ## 类型标签 - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5674 | 1 month ago | |
feat: 新增 dav_v516 架构编译构建工具与调试, ut适配等 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6514 merge master_main into master feat: 新增 dav_v516 架构编译构建工具与调试, ut适配等 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 为 asc-devkit 新增 dav_v516(NPU_ARCH == 5162)架构的构建与调试支持: 构建工具:新增 ascend5162a.py 平台配置,适配 cmake 与 compile_op/ascendc_compile_v220 等编译脚本、ccec/platform_info 等基础设施,使 5162 架构可参与编译。 调试工具:新增 impl/utils/debug/npu_arch_5162/ 下的 dump/printf/类型转换工具头文件。 运行时:适配 asc_platform、ascendc_runtime、opbuild 等。 改动原因:支持 dav_v516(5162)架构的构建与调试能力。 改动方法:新增 5162 平台配置与调试头文件,并在构建脚本中并入 5162 架构分支。 改动影响: Device 行为变更 — Reduce 系列(影响 3510、9201、5102、3003、3113) reduce_common_ar_reuse_align_3510_impl.h:38 与 ...less_than_vl3510_impl.h:64:新增无架构 guard 的 if constexpr (vlSize > ONE_BLK_SIZE) 分支,vlSize ≤ ONE_BLK_SIZE 时由 LoadAlign 改为 LoadUnAlignPre+LoadUnAlign,只影响VL_size≤32B的架构,即只影响5162 Host tiling 变更 — WelfordFinalize(影响 3510、9201、5102、3003、3113) welfordfinalize_tiling_impl.cpp:43:reduceTmpSize 由硬编码 reduceK/64、按 128 对齐 → 改为基于 GetVecRegLen() 计算。仅当这些架构 GetVecRegLen()==256B 时数值等价,否则 tmp buffer 尺寸变化 编译产物变更、数值不变 — 浮点字面量 1.0→1.0f(仅常量初始化,无风险) API 面纯新增(不改变既有行为) 各 SOC 列表追加 ascend5162a/Ascend5162A(config.cmake、op_cfg_generator.h、asc_platform.h、ascendc_runtime.cpp、const_var.py、opdesc_parser.py)及 is_516r2() 门控的编译工具链 — 均为追加式,现有 SoC 路径不变 三、净零影响的架构 1001、3002、3102、5101、5161、5163、5165:所有涉及它们的改动均为条件列表追加 5162 或等价重写(defined() 补齐、格式化),编译语义逐 arch 验证不变 2002、2201:仅受第 3 条字面量改动影响(数值等价) ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 本地执行 build.sh 完成全量编译与打包,成功生成 cann-asc-devkit_9.3.0_linux-aarch64.run, 执行ut测试。 ## 文档更新 无文档更新。 ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6514 | 29 days ago | |
feat: 新增 dav_v516 架构编译构建工具与调试, ut适配等 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6514 merge master_main into master feat: 新增 dav_v516 架构编译构建工具与调试, ut适配等 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 为 asc-devkit 新增 dav_v516(NPU_ARCH == 5162)架构的构建与调试支持: 构建工具:新增 ascend5162a.py 平台配置,适配 cmake 与 compile_op/ascendc_compile_v220 等编译脚本、ccec/platform_info 等基础设施,使 5162 架构可参与编译。 调试工具:新增 impl/utils/debug/npu_arch_5162/ 下的 dump/printf/类型转换工具头文件。 运行时:适配 asc_platform、ascendc_runtime、opbuild 等。 改动原因:支持 dav_v516(5162)架构的构建与调试能力。 改动方法:新增 5162 平台配置与调试头文件,并在构建脚本中并入 5162 架构分支。 改动影响: Device 行为变更 — Reduce 系列(影响 3510、9201、5102、3003、3113) reduce_common_ar_reuse_align_3510_impl.h:38 与 ...less_than_vl3510_impl.h:64:新增无架构 guard 的 if constexpr (vlSize > ONE_BLK_SIZE) 分支,vlSize ≤ ONE_BLK_SIZE 时由 LoadAlign 改为 LoadUnAlignPre+LoadUnAlign,只影响VL_size≤32B的架构,即只影响5162 Host tiling 变更 — WelfordFinalize(影响 3510、9201、5102、3003、3113) welfordfinalize_tiling_impl.cpp:43:reduceTmpSize 由硬编码 reduceK/64、按 128 对齐 → 改为基于 GetVecRegLen() 计算。仅当这些架构 GetVecRegLen()==256B 时数值等价,否则 tmp buffer 尺寸变化 编译产物变更、数值不变 — 浮点字面量 1.0→1.0f(仅常量初始化,无风险) API 面纯新增(不改变既有行为) 各 SOC 列表追加 ascend5162a/Ascend5162A(config.cmake、op_cfg_generator.h、asc_platform.h、ascendc_runtime.cpp、const_var.py、opdesc_parser.py)及 is_516r2() 门控的编译工具链 — 均为追加式,现有 SoC 路径不变 三、净零影响的架构 1001、3002、3102、5101、5161、5163、5165:所有涉及它们的改动均为条件列表追加 5162 或等价重写(defined() 补齐、格式化),编译语义逐 arch 验证不变 2002、2201:仅受第 3 条字面量改动影响(数值等价) ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 本地执行 build.sh 完成全量编译与打包,成功生成 cann-asc-devkit_9.3.0_linux-aarch64.run, 执行ut测试。 ## 文档更新 无文档更新。 ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6514 | 29 days ago | |
refactor:重构impl/basic_api下的代码格式 Co-authored-by: haipingmao<maohaiping@huawei.com> # message auto-generated for no-merge-commit merge: !4273 merge pr_4260 into master refactor:重构impl/basic_api下的代码格式 Created-by: haipingmao Commit-by: haipingmao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 按照clang-format格式刷新impl/basic_api的代码格式。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> NA ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> compile ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!4273 | 3 months ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
feat: 新增 dav_v516 架构算子条件编译宏支持 Co-authored-by: Bartonzany<lanbin4@huawei.com> # message auto-generated for no-merge-commit merge: !5674 merge feat_dav_v516_macro into master feat: 新增 dav_v516 架构算子条件编译宏支持 Created-by: Bartonzany Commit-by: Bartonzany Merged-by: cann-robot Description: ## 描述 为 asc-devkit 补齐 dav_v516( __NPU_ARCH__ == 5162)架构的条件编译支持:在激活、数学、归一化、量化、reduce、sort/topk、pad/transpose 等高级 API 算子及其 kernel check、tiling、基础 API 接口头文件中,为既有 3510/5102 架构分支并入 __NPU_ARCH__ == 5162,并引入 dav_v516 实现头文件,使算子库在 dav_v516 架构下编译运行。 改动原因:支持 dav_v516(5162)新一代 NPU 架构。 改动方法:在 3510/5102 条件编译分支中并入 __NPU_ARCH__ == 5162,复用 3510 系列实现。 ## 关联的Issue ## 测试 本地执行 build.sh 完成全量编译与打包,成功生成 cann-asc-devkit_9.2.0_linux-aarch64.run。 ## 文档更新 无文档更新。 ## 类型标签 - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5674 | 1 month ago | |
feat: 5162新增Conv/MatMul算子相关基础API支持 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6635 merge feat_conv_api into master feat: 5162新增Conv/MatMul算子相关基础API支持 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 1、根据评审要求,dav_v516修改为dav_5162 目录规整(114 文件,+121/-120) 按评审要求把 dav_v516 目录整体重命名为 dav_5162,并同步三处工程配置: - classify_rule.yaml:新增 impl/**/dav_5162/*.h 归属规则; - impl/basic_api/CMakeLists.txt:170:安装软链路径改名; - 114 个 impl/include 头文件的 include 路径。 纯机械变更,不涉及语义。 2、修复上个提交遗留问题 - dav_5162/kernel_operator_common_impl.h:删除 GetStoreAtomicConfigImpl() 中 ASCENDC_ASSERT(false) 之后残留的不支持指令 get_st_atomic_cfg()(该 arch 无此指令); - 两份 516r2 编译命令生成器(tools/build/.../adapter/、asc_op_compiler/ascendc_compile_v220.py):5162只支持 -mllvm -cce-aicore-function-stack-size=0x4000;修正 "cce-simd-vf-fusion=true" → "--cce-simd-vf-fusion=true",删除无效的vl大小配置选项,修复选项名称before拼写错误befor。 3、feat: 5162新增Conv/MatMul算子相关基础API支持 (a)Conv/Mmad 宏指令 —— 新增能力(1396 行新文件) - 新增 dav_5162/kernel_operator_macro_impl.h(774) 与 kernel_operator_macro_bitmode_impl.h(622):SetConvKernel/SetConvFMatrix(+StepPos/Dual0/Dual1)/SetConvPadding/SetConvStride/SetMatrixPara/SetFixPipeConfig/SetFixPipeReluAlpha/SetFixPipeAddr/SetItaMaxAddr/SetMxBufAddr,以及 Convolution/ConvFix/MmadFix/MmadMxFix 执行体;相较 5161 版本增加字段掩码(& 0x1ff/& 0xff/& 0xfff)与 paddingValue 按 b16/b8/b4 打包。 - 指令名切到 5162 的 set_m_* 系列(如 set_m_fmatrix、set_m_padding、set_m_clip_relu、set_m_quant_pre、set_m_elt_src_para、set_m_fpc)。 - ConvFixCal/MmadFixCal/MmadMxFixCal 由显式模板实参改为参数推导;ConvFix 增加 bias tensor 位置校验(L0C/BIAS)。 - 架构白名单扩展到 5162:kernel_operator_macro_intf.h、kernel_operator_macro_bitmode_intf.h、kernel_operator_macro_base_impl.h、kernel_operator_macro_bitmode_struct.h、kernel_struct_macro.h,并按 arch 分派到 dav_5162/ 实现。 (b)Fixpipe —— 由"L0C 基"重写为"L1 基" - dav_5162/kernel_operator_fixpipe_impl.h:删除 808 行 Arch3510 风格 L0C 实现(FixpipeL0C2L1/2UB/2GM、FixpipeTiling、CopyReluTensorToFbuf、IsVector/ScalarQuantMode 等),新增 FixpipeL1ToL1/ToUb/ToOut + FixpipeL12L1Impl/L12UbImpl/L12GmImpl + CheckFixpipeParams(仅允许 b8/b16,src/dst 同类型),底层用 fix_cbuf_to_cbuf/ubuf/gm,支持 ROW_MAJOR(NZ2ND)/COLUMN_MAJOR(NZ2DN)/NORMAL_DMA 三种搬运模式。 - 公共结构:kernel_struct_fixpipe.h 新增 FixpipeParamsV516(nSize/mSize/srcStride/dstStride + nz2nd 用 ndNum/srcNdStride/dstNdStride),FixpipeConfig 对 5162 开放 isToUB、enableFixVal(含 CFG_NZ_FIX)。 - 配置类 API(5162 专属,kernel_operator_fixpipe_intf.h + fixpipe_intf_impl.h):SetFixPipeClipRelu(FixpipeClipReluParams<T1,T2>)、SetFixPipeConfig(uint64_t)、SetFixpipePreQuantFlag(FixPipePreQuantParams<T>)、SetFixpipePostQuant(FixPipePostQuantParams)、SetFixpipeEltAntiq(FixPipeEltAntiqParams<T>)、SetFixpipeEltwiseAddr(uint64_t / FixpipeEltwiseAddrParams);SetFixpipeNz2ndFlag 对 5162 采用 uint32_t dstNdStride 形态。 - 参数结构体与 eltwise_antiq_t(8 种 int8/int4/uint8/int16 标量/向量反量化 + S32 预量化 + NO_ANTIQ)落在 impl/basic_api/utils/kernel_utils_struct_dma_params.h(+141)。 - Nz2NdParams、CANN_ASC_ENABLE_POST_PROC_BUF/SID 等宏对 5162 打开。 (c)MatMul / LoadData —— 5162 通路补齐 - dav_5162/kernel_operator_mm_impl.h(205/296):新增 LoadData2DGM2L0BCal、LoadData2DL12L1Cal、L1→L0A/L0B 转置载入;删除不适用的 LoadData2DL12L0BTransposeCal 旧重载;Load3DSetFMatrixCal/BCal 由直传寄存器改为位域组装。 - 共享层为 5162 开放:LoadData(GM→L1/L0B + Nd2Nz)、LoadData 2D/3D BitMode(Load2D/Load3DBitModeParam)、MX 载入(LoadData2DMxParams)、LoadDataWithStride、SetFmatrix(SetFMatrixBitModeParams, FmatrixMode)、SetLoadDataRepeatWithStride;LoadData 中 5162 新增 L0B 分支。 - GatherMask(reg_compute)增加 5162 分支并接入 reg_compute/dav_5162 实现。 (d)DataCopy —— 5162 适配与清理 - dav_5162/kernel_operator_data_copy_impl.h(46/54):L1→FB 走 uint64_t 物理地址形态;sizeof(T)==8/4/2/1 改为 B64/B32/B16/B8_BYTE_SIZE 常量;srcStride310/dstStride310 → actSrcStride/actDstStride;删除未使用的 ValidateUbL1Address;新增 FIX_VAL 默认值常量。 - kernel_struct_data_copy.h、kernel_operator_data_copy_intf_impl.h 对 5162 打开 POST_PROC_BUF/SID 与 L12FB 分支。 ## 关联的Issue NA ## 测试 ut测试 ,本地打包测试,5162 Conv算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6635 | 24 days ago | |
add MstxDataCopyPadV2Desc struct Co-authored-by: yhkz9211<huyulin4@huawei.com> # message auto-generated for no-merge-commit merge: !5619 merge mstx into master add MstxDataCopyPadV2Desc struct Created-by: yhkz9211 Commit-by: yhkz9211 Merged-by: cann-robot Description: ## Description <!--Describe your changes in detail, including the reason for the changes and the methods used.--> 原有MstxDataCopyPadDesc结构体没有padding mode的入参,导致COMPACT模式下仍然按照NORMAL模式处理,从而内存检测误报。 ## Related Issue <!--If this PR resolves a specific issue, provide the issue link here. For example: Related Issue #xxx--> Related Issue [#1636](https://gitcode.com/cann/asc-devkit/issues/1636) ## Testing <!--Describe the tests performed to verify your changes, including but not limited to level-2 smoke tests and operator generalization.--> 联合验证 ## Documentation Updates <!--If this PR includes documentation updates, indicate them here. For example: Updated README.md file.--> ## Type Labels <!-- [x] indicates selected --> - [x] 🐛 fix: Bug fix - [ ] ✨ feat: New feature - [ ] ⚡ perf: Performance optimization - [ ] ♻️ refactor: Code refactoring - [ ] 🧪 test: Add or modify tests - [ ] 📝 docs: Documentation update - [ ] 🔧 ci: CI/CD configuration change - [ ] ↩️ revert: Revert changes - [ ] 🧹 chore: Other, please describe See merge request: cann/asc-devkit!5619 | 2 months ago |
| Files | Last commit | Last update |
|---|---|---|
| 26 days ago | ||
| 26 days ago | ||
| 24 days ago | ||
| 29 days ago | ||
| 26 days ago | ||
| 1 month ago | ||
| 25 days ago | ||
| 26 days ago | ||
| 26 days ago | ||
| 26 days ago | ||
| 26 days ago | ||
| 26 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 29 days ago | ||
| 1 month ago | ||
| 3 months ago | ||
| 24 days ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 3 months ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 24 days ago | ||
| 2 months ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 1 month ago | ||
| 3 months ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 2 months ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 1 month ago | ||
| 24 days ago | ||
| 1 month ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 3 months ago | ||
| 24 days ago | ||
| 1 month ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 3 months ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 24 days ago | ||
| 1 month ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 3 months ago | ||
| 1 month ago | ||
| 29 days ago | ||
| 1 month ago | ||
| 29 days ago | ||
| 29 days ago | ||
| 3 months ago | ||
| 24 days ago | ||
| 1 month ago | ||
| 24 days ago | ||
| 2 months ago |