| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix: 移除 BatchNorm3DGrad/BatchNormGradExt2 的 BFLOAT16 支持,BatchNorm 系列新增 Atlas 200I/500 A2 支持 Co-authored-by: tianqiguang<tianqiguang@huawei.com> # message auto-generated for no-merge-commit merge: !9459 merge master into master fix: 移除 BatchNorm3DGrad/BatchNormGradExt2 的 BFLOAT16 支持,BatchNorm 系列新增 Atlas 200I/500 A2 支持 Created-by: tianqiguang Commit-by: tianqiguang Merged-by: cann-robot Description: ## 描述 更新 BatchNorm 系列算子,主要包含: - 移除 BatchNorm3DGrad / BatchNormGradExt2 的 BFLOAT16(bfloat16)数据类型支持:def.cpp 中 y_backprop/x/x_backprop 仅保留 FLOAT16/FLOAT32,proto.h 同步更新,并删除含 bfloat16 的预编译 binary 配置(batch_norm3_d_grad_binary.json / batch_norm_grad_ext2_binary.json)。 - 三个 BatchNorm 算子(BatchNorm3D/BatchNorm3DGrad/BatchNormGradExt2)新增 Atlas 200I/500 A2 推理产品支持(README 产品支持表由 × 改为 √)。 - 新增图模式调用样例:test_geir_batch_norm3d_grad.cpp、test_geir_batch_norm_grad_ext2.cpp。 - BNTrainingReduceGrad 新增 TensorFlow framework 插件(framework/bn_training_reduce_grad_tf_plugin.cpp)。 - 同步更新 tiling、infershape、golden.py 及相应单测。 ## 关联的Issue - #5355 ## 测试 - 更新 infershape 单测:test_batch_norm3d_infershape.cpp、test_batch_norm3_d_grad_infershape.cpp、test_batch_norm_grad_ext2_infershape.cpp - 更新 tiling 单测:test_bn_training_reduce_grad_tiling.cpp - 更新 golden 数据:golden.py ## 文档更新 - 更新 batch_norm3_d/batch_norm3_d_grad/batch_norm_grad_ext2 的 README(Atlas 200I/500 A2 支持、调用样例链接) ## 类型标签 - [x] Bug修复 - [x] 新特性 ## AI/Agent生成声明 - [ ] AI辅助编写 See merge request: cann/ops-nn!9459 | 7 天前 | |
feat: 新增 BatchNorm3D、BatchNorm3DGrad、BatchNormGradExt2 算子 Co-authored-by: tianqiguang<tianqiguang@huawei.com> # message auto-generated for no-merge-commit merge: !8976 merge deliver/batchnorm3d-rebased into master feat: 新增 BatchNorm3D、BatchNorm3DGrad、BatchNormGradExt2 算子 Created-by: tianqiguang Commit-by: tianqiguang Merged-by: cann-robot Description: ## 描述 新增 BatchNorm3D 系列算子,共 3 个,均支持 Ascend 950PR/Ascend 950DT 平台: - BatchNorm3D(batch_norm3d):对 5D 输入张量做批归一化,支持训练与推理模式。输入 x 支持 FLOAT16/FLOAT32、NCDHW/NDHWC 格式;输出 y、batch_mean、batch_variance 及辅助输出 reserve_space_1/reserve_space_2。 - BatchNorm3DGrad(batch_norm3d_grad):计算 BatchNorm3D 的反向梯度,输出输入梯度 x_backprop、scale 梯度、offset 梯度及辅助输出。输入支持 4D/5D,数据类型 FLOAT16/FLOAT32/BFLOAT16,格式 NCDHW/NCHW/NHWC/NDHWC。 - BatchNormGradExt2(batch_norm_grad_ext2):计算 BatchNorm 的反向梯度,接口与 BatchNorm3DGrad 类似,默认 data_format 为 NHWC。 ## 关联的Issue - #4966 ## 测试 - 新增 infershape 单测:test_batch_norm3d_infershape.cpp、test_batch_norm3d_grad_infershape.cpp、test_batch_norm_grad_ext2_infershape.cpp - 新增 kernel 单测:test_batch_norm3_d.cpp、test_batch_norm3_d_grad.cpp、test_batch_norm_grad_ext2.cpp - 新增 golden 数据:golden.py ## 文档更新 - 新增算子 README:norm/batch_norm3_d/README.md、norm/batch_norm3_d_grad/README.md、norm/batch_norm_grad_ext2/README.md - 更新算子清单:docs/zh/op_list.md ## 类型标签 - [x] 新特性 ## AI/Agent生成声明 - [ ] AI辅助编写 See merge request: cann/ops-nn!8976 | 14 天前 | |
fix: 移除 BatchNorm3DGrad/BatchNormGradExt2 的 BFLOAT16 支持,BatchNorm 系列新增 Atlas 200I/500 A2 支持 Co-authored-by: tianqiguang<tianqiguang@huawei.com> # message auto-generated for no-merge-commit merge: !9459 merge master into master fix: 移除 BatchNorm3DGrad/BatchNormGradExt2 的 BFLOAT16 支持,BatchNorm 系列新增 Atlas 200I/500 A2 支持 Created-by: tianqiguang Commit-by: tianqiguang Merged-by: cann-robot Description: ## 描述 更新 BatchNorm 系列算子,主要包含: - 移除 BatchNorm3DGrad / BatchNormGradExt2 的 BFLOAT16(bfloat16)数据类型支持:def.cpp 中 y_backprop/x/x_backprop 仅保留 FLOAT16/FLOAT32,proto.h 同步更新,并删除含 bfloat16 的预编译 binary 配置(batch_norm3_d_grad_binary.json / batch_norm_grad_ext2_binary.json)。 - 三个 BatchNorm 算子(BatchNorm3D/BatchNorm3DGrad/BatchNormGradExt2)新增 Atlas 200I/500 A2 推理产品支持(README 产品支持表由 × 改为 √)。 - 新增图模式调用样例:test_geir_batch_norm3d_grad.cpp、test_geir_batch_norm_grad_ext2.cpp。 - BNTrainingReduceGrad 新增 TensorFlow framework 插件(framework/bn_training_reduce_grad_tf_plugin.cpp)。 - 同步更新 tiling、infershape、golden.py 及相应单测。 ## 关联的Issue - #5355 ## 测试 - 更新 infershape 单测:test_batch_norm3d_infershape.cpp、test_batch_norm3_d_grad_infershape.cpp、test_batch_norm_grad_ext2_infershape.cpp - 更新 tiling 单测:test_bn_training_reduce_grad_tiling.cpp - 更新 golden 数据:golden.py ## 文档更新 - 更新 batch_norm3_d/batch_norm3_d_grad/batch_norm_grad_ext2 的 README(Atlas 200I/500 A2 支持、调用样例链接) ## 类型标签 - [x] Bug修复 - [x] 新特性 ## AI/Agent生成声明 - [ ] AI辅助编写 See merge request: cann/ops-nn!9459 | 7 天前 | |
fix: 移除 BatchNorm3DGrad/BatchNormGradExt2 的 BFLOAT16 支持,BatchNorm 系列新增 Atlas 200I/500 A2 支持 Co-authored-by: tianqiguang<tianqiguang@huawei.com> # message auto-generated for no-merge-commit merge: !9459 merge master into master fix: 移除 BatchNorm3DGrad/BatchNormGradExt2 的 BFLOAT16 支持,BatchNorm 系列新增 Atlas 200I/500 A2 支持 Created-by: tianqiguang Commit-by: tianqiguang Merged-by: cann-robot Description: ## 描述 更新 BatchNorm 系列算子,主要包含: - 移除 BatchNorm3DGrad / BatchNormGradExt2 的 BFLOAT16(bfloat16)数据类型支持:def.cpp 中 y_backprop/x/x_backprop 仅保留 FLOAT16/FLOAT32,proto.h 同步更新,并删除含 bfloat16 的预编译 binary 配置(batch_norm3_d_grad_binary.json / batch_norm_grad_ext2_binary.json)。 - 三个 BatchNorm 算子(BatchNorm3D/BatchNorm3DGrad/BatchNormGradExt2)新增 Atlas 200I/500 A2 推理产品支持(README 产品支持表由 × 改为 √)。 - 新增图模式调用样例:test_geir_batch_norm3d_grad.cpp、test_geir_batch_norm_grad_ext2.cpp。 - BNTrainingReduceGrad 新增 TensorFlow framework 插件(framework/bn_training_reduce_grad_tf_plugin.cpp)。 - 同步更新 tiling、infershape、golden.py 及相应单测。 ## 关联的Issue - #5355 ## 测试 - 更新 infershape 单测:test_batch_norm3d_infershape.cpp、test_batch_norm3_d_grad_infershape.cpp、test_batch_norm_grad_ext2_infershape.cpp - 更新 tiling 单测:test_bn_training_reduce_grad_tiling.cpp - 更新 golden 数据:golden.py ## 文档更新 - 更新 batch_norm3_d/batch_norm3_d_grad/batch_norm_grad_ext2 的 README(Atlas 200I/500 A2 支持、调用样例链接) ## 类型标签 - [x] Bug修复 - [x] 新特性 ## AI/Agent生成声明 - [ ] AI辅助编写 See merge request: cann/ops-nn!9459 | 7 天前 | |
fix: 移除 BatchNorm3DGrad/BatchNormGradExt2 的 BFLOAT16 支持,BatchNorm 系列新增 Atlas 200I/500 A2 支持 Co-authored-by: tianqiguang<tianqiguang@huawei.com> # message auto-generated for no-merge-commit merge: !9459 merge master into master fix: 移除 BatchNorm3DGrad/BatchNormGradExt2 的 BFLOAT16 支持,BatchNorm 系列新增 Atlas 200I/500 A2 支持 Created-by: tianqiguang Commit-by: tianqiguang Merged-by: cann-robot Description: ## 描述 更新 BatchNorm 系列算子,主要包含: - 移除 BatchNorm3DGrad / BatchNormGradExt2 的 BFLOAT16(bfloat16)数据类型支持:def.cpp 中 y_backprop/x/x_backprop 仅保留 FLOAT16/FLOAT32,proto.h 同步更新,并删除含 bfloat16 的预编译 binary 配置(batch_norm3_d_grad_binary.json / batch_norm_grad_ext2_binary.json)。 - 三个 BatchNorm 算子(BatchNorm3D/BatchNorm3DGrad/BatchNormGradExt2)新增 Atlas 200I/500 A2 推理产品支持(README 产品支持表由 × 改为 √)。 - 新增图模式调用样例:test_geir_batch_norm3d_grad.cpp、test_geir_batch_norm_grad_ext2.cpp。 - BNTrainingReduceGrad 新增 TensorFlow framework 插件(framework/bn_training_reduce_grad_tf_plugin.cpp)。 - 同步更新 tiling、infershape、golden.py 及相应单测。 ## 关联的Issue - #5355 ## 测试 - 更新 infershape 单测:test_batch_norm3d_infershape.cpp、test_batch_norm3_d_grad_infershape.cpp、test_batch_norm_grad_ext2_infershape.cpp - 更新 tiling 单测:test_bn_training_reduce_grad_tiling.cpp - 更新 golden 数据:golden.py ## 文档更新 - 更新 batch_norm3_d/batch_norm3_d_grad/batch_norm_grad_ext2 的 README(Atlas 200I/500 A2 支持、调用样例链接) ## 类型标签 - [x] Bug修复 - [x] 新特性 ## AI/Agent生成声明 - [ ] AI辅助编写 See merge request: cann/ops-nn!9459 | 7 天前 | |
fix: 重命名 batch_norm3d 文件以对齐算子类型命名,并删除 op_kernel 单测 Co-authored-by: tianqiguang<tianqiguang@huawei.com> # message auto-generated for no-merge-commit merge: !9081 merge deliver/batchnorm3d-rebased into master fix: 重命名 batch_norm3d 文件以对齐算子类型命名,并删除 op_kernel 单测 Created-by: tianqiguang Commit-by: tianqiguang Merged-by: cann-robot Description: ## 描述 修复 batch_norm3d 系列算子文件命名与算子类型名不一致的问题,将 batch_norm3d_* 文件重命名为 batch_norm3_d_*,使其与算子类型名(batch_norm3_d / batch_norm3_d_grad)保持一致;同时删除 op_kernel 单测。 具体改动: - 重命名文件(6 个): - batch_norm3d_def.cpp → batch_norm3_d_def.cpp - batch_norm3d_infershape.cpp → batch_norm3_d_infershape.cpp - batch_norm3d_grad_proto.h → batch_norm3_d_grad_proto.h - batch_norm3d_grad_def.cpp → batch_norm3_d_grad_def.cpp - batch_norm3d_grad_infershape.cpp → batch_norm3_d_grad_infershape.cpp - test_batch_norm3d_grad_infershape.cpp → test_batch_norm3_d_grad_infershape.cpp - 同步更新引用:CMakeLists.txt(OPTYPE 改为 batch_norm3_d / batch_norm3_d_grad)、README.md、golden.py(spec/golden 名称) - 删除 op_kernel 单测(6 个):batch_norm3_d 与 batch_norm3_d_grad 的 tests/ut/op_kernel 目录(CMakeLists.txt、*_tiling_def.h、test_*.cpp) ## 关联的Issue - #5074 ## 测试 - op_host infershape 单测随文件重命名保留(test_batch_norm3_d_grad_infershape.cpp) - 删除 op_kernel 单测 ## 文档更新 - 更新 batch_norm3_d_grad/README.md 中 proto.h 引用路径 ## 类型标签 - [x] 其他,请描述:文件重命名与单测清理 ## AI/Agent生成声明 - [ ] AI辅助编写 See merge request: cann/ops-nn!9081 | 13 天前 | |
fix: 移除 BatchNorm3DGrad/BatchNormGradExt2 的 BFLOAT16 支持,BatchNorm 系列新增 Atlas 200I/500 A2 支持 Co-authored-by: tianqiguang<tianqiguang@huawei.com> # message auto-generated for no-merge-commit merge: !9459 merge master into master fix: 移除 BatchNorm3DGrad/BatchNormGradExt2 的 BFLOAT16 支持,BatchNorm 系列新增 Atlas 200I/500 A2 支持 Created-by: tianqiguang Commit-by: tianqiguang Merged-by: cann-robot Description: ## 描述 更新 BatchNorm 系列算子,主要包含: - 移除 BatchNorm3DGrad / BatchNormGradExt2 的 BFLOAT16(bfloat16)数据类型支持:def.cpp 中 y_backprop/x/x_backprop 仅保留 FLOAT16/FLOAT32,proto.h 同步更新,并删除含 bfloat16 的预编译 binary 配置(batch_norm3_d_grad_binary.json / batch_norm_grad_ext2_binary.json)。 - 三个 BatchNorm 算子(BatchNorm3D/BatchNorm3DGrad/BatchNormGradExt2)新增 Atlas 200I/500 A2 推理产品支持(README 产品支持表由 × 改为 √)。 - 新增图模式调用样例:test_geir_batch_norm3d_grad.cpp、test_geir_batch_norm_grad_ext2.cpp。 - BNTrainingReduceGrad 新增 TensorFlow framework 插件(framework/bn_training_reduce_grad_tf_plugin.cpp)。 - 同步更新 tiling、infershape、golden.py 及相应单测。 ## 关联的Issue - #5355 ## 测试 - 更新 infershape 单测:test_batch_norm3d_infershape.cpp、test_batch_norm3_d_grad_infershape.cpp、test_batch_norm_grad_ext2_infershape.cpp - 更新 tiling 单测:test_bn_training_reduce_grad_tiling.cpp - 更新 golden 数据:golden.py ## 文档更新 - 更新 batch_norm3_d/batch_norm3_d_grad/batch_norm_grad_ext2 的 README(Atlas 200I/500 A2 支持、调用样例链接) ## 类型标签 - [x] Bug修复 - [x] 新特性 ## AI/Agent生成声明 - [ ] AI辅助编写 See merge request: cann/ops-nn!9459 | 7 天前 |
BatchNorm3D
产品支持情况
| 产品 | 是否支持 |
|---|---|
| Ascend 950PR/Ascend 950DT | √ |
| Atlas A3 训练系列产品/Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品/Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
功能说明
BatchNorm3D对5D输入张量做批归一化,支持训练和推理模式。
计算公式:
y = (x - mean) / sqrt(variance + epsilon) * scale + offset
训练模式下,mean和variance由输入批次按通道归约得到;推理模式下使用输入mean和variance。
参数说明
| 参数名 | 输入/输出 | 数据类型 | 格式 | 说明 |
|---|---|---|---|---|
| x | 输入 | FLOAT16、FLOAT32 | NCDHW、NDHWC | 5D输入,shape的通道维与scale一致。 |
| scale | 输入 | FLOAT32 | ND | 缩放系数,长度等于通道数。 |
| offset | 输入 | FLOAT32 | ND | 偏置,长度等于通道数。 |
| mean | 输入 | FLOAT32 | ND | 推理模式使用,训练模式可为空。 |
| variance | 输入 | FLOAT32 | ND | 推理模式使用,训练模式可为空。 |
| y | 输出 | FLOAT16、FLOAT32 | NCDHW、NDHWC | 输出,shape与x一致。 |
| batch_mean | 输出 | FLOAT32 | ND | 均值输出,长度等于通道数。 |
| batch_variance | 输出 | FLOAT32 | ND | 方差输出,长度等于通道数。 |
| reserve_space_1 | 输出 | FLOAT32 | ND | 辅助输出,长度等于通道数。 |
| reserve_space_2 | 输出 | FLOAT32 | ND | 辅助输出,长度等于通道数。 |
| epsilon | 属性 | FLOAT32 | - | 防止除零的小数,默认值为0.0001。 |
| data_format | 属性 | STRING | - | 支持NCDHW、NDHWC,默认值为NCDHW。 |
| is_training | 属性 | BOOL | - | 是否为训练模式,默认值为true。 |
约束说明
- 当前实现支持
NCDHW、NDHWC逻辑格式。 scale、offset、mean、variance均为一维张量,长度需等于通道数。
调用说明
| 调用方式 | 样例代码 | 说明 |
|---|---|---|
| 图模式调用 | test_geir_batch_norm3d | 通过算子IR构图方式调用BatchNorm3D算子(含两组手工可算用例)。 |