CANN/asc-devkit 随路Relu功能说明

CANN/asc-devkit 随路Relu功能说明 随路Relu【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit随路Relu是矩阵计算结果从L0C Buffer搬出到Global Memory或Unified Buffer过程中的随路激活能力。Tensor API通过CopyL0C2GMTrait::enableRelu或CopyL0C2UBTrait::enableRelu控制是否使能该能力。功能说明enableRelu默认值为false表示不使能随路Relu。设置为true时搬出过程中对输出数据执行Normal Relu激活。constexpr CopyL0C2GMTrait l0c2gmTrait { RoundMode::DEFAULT, true, false }; struct CopyL0C2GMTraitCustom { using TraitType CopyL0C2GMTrait; static constexpr const TraitType value l0c2gmTrait; }; FixpipeParams params; auto atom MakeCopy(CopyL0C2GM{}, CopyL0C2GMTraitCustom{}).with(params); Copy(atom, gm, l0c);L0C Buffer到Unified Buffer搬运同样通过CopyL0C2UBTrait::enableRelu控制constexpr CopyL0C2UBTrait l0c2ubTrait { RoundMode::DEFAULT, true, false, DUAL_DST_DISABLE }; struct CopyL0C2UBTraitCustom { using TraitType CopyL0C2UBTrait; static constexpr const TraitType value l0c2ubTrait; }; FixpipeParams params; auto atom MakeCopy(CopyL0C2UB{}, CopyL0C2UBTraitCustom{}).with(params); Copy(atom, ub, l0c);支持范围根据底层Fixpipe的能力随路Relu包含Normal Relu、Leaky Relu和PRelu等模式。当前Tensor API的L0C Buffer到Global Memory/Unified Buffer搬运通过enableRelu暴露Normal Relu能力当前不支持随路PRelu。约束说明enableRelu为编译期trait配置默认不使能。量化和Relu参数不能为inf、nan或非规格化数。当前Tensor API不支持随路PRelu。【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考