| Files | Last commit | Last update |
|---|---|---|
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 | 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 | 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 | 1 month ago | |
修复5162相关arch实现 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !7388 merge fix_api_arch_impl into master 修复5162相关arch实现 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure 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!7388 | 14 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 | 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 | 1 month ago | |
fix: 修复5162算子编译c++20告警 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !7282 merge fix_compile_warn into master fix: 修复5162算子编译c++20告警 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 修复5162算子编译c++20告警 ## 关联的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!7282 | 21 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 | 1 month ago | |
fix: 5162 魔鬼数字整改 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !7065 merge fix_5162_magic_number into master fix: 5162 魔鬼数字整改 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的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!7065 | 29 days ago | |
修复5162相关arch实现 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !7388 merge fix_api_arch_impl into master 修复5162相关arch实现 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure 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!7388 | 14 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 | 1 month ago | |
修改5162访问gm默认sid值 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !7269 merge fix_5162_default_sid into master 修改5162访问gm默认sid值 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 修改5162访问gm默认sid值(系统层面评审确认) ## 关联的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!7269 | 21 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 | 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 | 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 | 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 | 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 | 1 month ago | |
修复5162相关arch实现 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !7388 merge fix_api_arch_impl into master 修复5162相关arch实现 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure 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!7388 | 14 days ago | |
modify 5162 reserved_workspace to 1024B, same as 5102 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6936 merge modify_5162_reserved_workspace into master modify 5162 reserved_workspace to 1024B, same as 5102 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 修改5162的默认保留WORKSPACE大小为1024B,保持和5102一致 ## 关联的Issue NA ## 测试 5162全量算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [x] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6936 | 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 | 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 | 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 | 1 month ago | |
feat:5162不支持vmull/vaddc/vaddcs/vsubc/vsubcs等指令,不支持整数除法,不支持b64类型转换,使用软实现代替 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !6782 merge adapt_5162_Mull_api into master feat:5162不支持vmull/vaddc/vaddcs/vsubc/vsubcs等指令,不支持整数除法,不支持b64类型转换,使用软实现代替 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 feat:5162不支持vmull/vaddc/vaddcs/vsubc/vsubcs等指令,不支持整数除法,不支持b64类型转换,使用软实现代替 ## 关联的Issue NA ## 测试 ut测试,编译测试,相关算子测试 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6782 | 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 | 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 | 1 month ago | |
feat(basic_api): dav_5162 补充 double 向量比较实现 Co-authored-by: pcmbyn<liuhaiyang42@huawei.com> # message auto-generated for no-merge-commit merge: !7347 merge adapt-5162-double-compare into master feat(basic_api): dav_5162 补充 double 向量比较实现 Created-by: pcmbyn Commit-by: pcmbyn Merged-by: cann-robot Description: ## 描述 本 PR 为 dav_5162 补齐 double 向量比较实现,解决 double 比较在 ascend5162 下编译触发 static_assert 的问题。共 1 个文件(impl/basic_api/dav_5162/kernel_operator_vec_compare_continuous_impl.h)。 - **补齐 double 比较**:参照 dav_3510,新增 CompareEqualDoubleImpl / CompareEqualDouble / IsNanFull / IsZero / CompareLessDouble / CompareDouble。 - EQ:拆分指数/尾数,处理 NaN 与 ±0; - LT/LE/GT/GE:按 IEEE 符号-幅值语义比较; - NE:EQ 取反。 - **接入调用链**:CompareLevel2 的 8 字节分支对 double 走上述实现,其余类型保持 Reg::Compare;VcmpvImpl 类型白名单加入 double。 - **复用原语**:仅使用 Reg 层已有的整型/掩码原语,不改变其他架构行为,不新增算子信息库约束。 ## 关联的Issue 关联 Issue #xxxx(请填写实际编号)。 ## 测试 - 5162 定向编译(bisheng,--npu-arch=dav-5162): - VcmpvImpl<double, uint8_t/int8_t> 六种 CMPMODE 编译通过; - AscendC::Compare(LocalTensor<uint8_t>, LocalTensor<double>, LocalTensor<double>, CMPMODE, count) 编译通过。 - 改动前可复现 static_assert,改动后 0 error。 ## 文档更新 无。 ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!7347 | 17 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 | 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 | 1 month ago | |
adapt_5162_GatherDataCopy_ScatterDataCopy Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !7211 merge adapt_5162_GatherDataCopy_ScatterDataCopy into master adapt_5162_GatherDataCopy_ScatterDataCopy Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 适配5162支持GatherDataCopy/ScatterDataCopy接口 修复pad配置相关指令配置异常问题 1、gather_gm_to_ubuf的pad要用set_pad_val_outtoub或set_mov_pad_val(set_pad_val_outtoub的alias指令) 2、GatherFromGlobalImpl配置pad要根据数据配型配置pad_val,原实现截断到只有一个Byte导致异常 3、Scalar不能使用f8特殊数据类型,配置pad存为uint8类型配置 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!7211 | 21 days ago | |
DES: fix repeat code 3 Co-authored-by: p30079636<panjiacheng1@h-partners.com> # message auto-generated for no-merge-commit merge: !6983 merge r_co_3 into master DES: fix repeat code 3 Created-by: pan-jiacheng1 Commit-by: p30079636 Merged-by: cann-robot Description: ## 描述 把多处重复实现抽成公共函数、模板基类或参数化入口来消除重复代码 ## 关联的Issue NONE ## 测试 COMPILE ## 文档更新 不涉及 ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6983 | 25 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 | 1 month ago | |
修复5162相关arch实现 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !7388 merge fix_api_arch_impl into master 修复5162相关arch实现 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure 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!7388 | 14 days ago | |
adapt_5162_GatherDataCopy_ScatterDataCopy Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !7211 merge adapt_5162_GatherDataCopy_ScatterDataCopy into master adapt_5162_GatherDataCopy_ScatterDataCopy Created-by: yanjiang-treasure Commit-by: yanjiang-treasure Merged-by: cann-robot Description: ## 描述 适配5162支持GatherDataCopy/ScatterDataCopy接口 修复pad配置相关指令配置异常问题 1、gather_gm_to_ubuf的pad要用set_pad_val_outtoub或set_mov_pad_val(set_pad_val_outtoub的alias指令) 2、GatherFromGlobalImpl配置pad要根据数据配型配置pad_val,原实现截断到只有一个Byte导致异常 3、Scalar不能使用f8特殊数据类型,配置pad存为uint8类型配置 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [x] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!7211 | 21 days ago | |
DES: fix repeat code 3 Co-authored-by: p30079636<panjiacheng1@h-partners.com> # message auto-generated for no-merge-commit merge: !6983 merge r_co_3 into master DES: fix repeat code 3 Created-by: pan-jiacheng1 Commit-by: p30079636 Merged-by: cann-robot Description: ## 描述 把多处重复实现抽成公共函数、模板基类或参数化入口来消除重复代码 ## 关联的Issue NONE ## 测试 COMPILE ## 文档更新 不涉及 ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6983 | 25 days ago | |
DES: fix repeat code 3 Co-authored-by: p30079636<panjiacheng1@h-partners.com> # message auto-generated for no-merge-commit merge: !6983 merge r_co_3 into master DES: fix repeat code 3 Created-by: pan-jiacheng1 Commit-by: p30079636 Merged-by: cann-robot Description: ## 描述 把多处重复实现抽成公共函数、模板基类或参数化入口来消除重复代码 ## 关联的Issue NONE ## 测试 COMPILE ## 文档更新 不涉及 ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!6983 | 25 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 | 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 | 1 month ago | |
修复5162相关arch实现 Co-authored-by: yanjiang-treasure<yanjiangbao@hisilicon.com> # message auto-generated for no-merge-commit merge: !7388 merge fix_api_arch_impl into master 修复5162相关arch实现 Created-by: yanjiang-treasure Commit-by: yanjiang-treasure 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!7388 | 14 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 | 1 month ago |
| Files | Last commit | Last update |
|---|---|---|
| 1 month ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 14 days ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 21 days ago | ||
| 1 month ago | ||
| 29 days ago | ||
| 14 days ago | ||
| 1 month ago | ||
| 21 days ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 14 days ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 17 days ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 21 days ago | ||
| 25 days ago | ||
| 1 month ago | ||
| 14 days ago | ||
| 21 days ago | ||
| 25 days ago | ||
| 25 days ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 14 days ago | ||
| 1 month ago |