| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
新增mod算子Ascend C实现 Co-authored-by: tieyutong<tieyutong@huawei.com> # message auto-generated for no-merge-commit merge: !3240 merge upload-mod-20260610 into master 新增mod算子Ascend C实现 Created-by: tieyutong Commit-by: tieyutong Merged-by: cann-robot Description: ## 描述 本 PR 新增 mod算子Ascend C实现,上传路径为experimental/math/mod。提供 aclnnFmodTensor、aclnnInplaceFmodTensor、aclnnFmodScalar、aclnnInplaceFmodScalar 四个接口,支持 Tensor-Tensor、Tensor-Scalar 以及 inplace 场景。 主要改动: - 新增 Mod 算子 op_host、op_kernel、op_api 实现。 - host 侧完成 dtype、shape、broadcast 校验、infershape、tiling 与 workspace 配置。 - kernel 侧支持 FLOAT32、FLOAT16、BF16、INT32 AICore 计算路径,并支持 scalar、same-shape、broadcast 输入。 - op_api 侧支持 DOUBLE、BF16、FLOAT16、FLOAT32、INT32、INT64、INT8、UINT8,非 kernel 原生 dtype 通过 cast 到可计算 dtype 后执行。 - 补充 README、aclnn 接口文档、examples 以及 UT 用例。 ## 关联的Issue https://gitcode.com/cann/ops-math/issues/1928 ## 测试 已完成以下验证: | 套件 | 用例数 | 结果 | | --- | ---: | --- | | aclnnFmodScalar Accu_Generalization | 5600 | Pass,按区间分段续跑完成 | | aclnnFmodTensor Perf_Generalization | 16 | Pass,device 性能达标 | | aclnnFmodScalar Perf_Generalization | 16 | Pass,device 性能达标 | CI/工程验证: | 项目 | 结果 | | --- | --- | | experimental package 编译 | Pass | | CI UT pipeline | Pass | | op_host UT | Pass,7 tests | | op_api UT | Pass,9 tests | | op_kernel UT | Pass,1 test | | package 出包 | Pass | ## 文档更新 - 新增 experimental/math/mod/README.md - 新增 aclnnFmodTensor & aclnnInplaceFmodTensor 接口文档 - 新增 aclnnFmodScalar & aclnnInplaceFmodScalar 接口文档 - 新增 examples 与 tests 目录 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!3240 | 2 个月前 | |
新增mod算子Ascend C实现 Co-authored-by: tieyutong<tieyutong@huawei.com> # message auto-generated for no-merge-commit merge: !3240 merge upload-mod-20260610 into master 新增mod算子Ascend C实现 Created-by: tieyutong Commit-by: tieyutong Merged-by: cann-robot Description: ## 描述 本 PR 新增 mod算子Ascend C实现,上传路径为experimental/math/mod。提供 aclnnFmodTensor、aclnnInplaceFmodTensor、aclnnFmodScalar、aclnnInplaceFmodScalar 四个接口,支持 Tensor-Tensor、Tensor-Scalar 以及 inplace 场景。 主要改动: - 新增 Mod 算子 op_host、op_kernel、op_api 实现。 - host 侧完成 dtype、shape、broadcast 校验、infershape、tiling 与 workspace 配置。 - kernel 侧支持 FLOAT32、FLOAT16、BF16、INT32 AICore 计算路径,并支持 scalar、same-shape、broadcast 输入。 - op_api 侧支持 DOUBLE、BF16、FLOAT16、FLOAT32、INT32、INT64、INT8、UINT8,非 kernel 原生 dtype 通过 cast 到可计算 dtype 后执行。 - 补充 README、aclnn 接口文档、examples 以及 UT 用例。 ## 关联的Issue https://gitcode.com/cann/ops-math/issues/1928 ## 测试 已完成以下验证: | 套件 | 用例数 | 结果 | | --- | ---: | --- | | aclnnFmodScalar Accu_Generalization | 5600 | Pass,按区间分段续跑完成 | | aclnnFmodTensor Perf_Generalization | 16 | Pass,device 性能达标 | | aclnnFmodScalar Perf_Generalization | 16 | Pass,device 性能达标 | CI/工程验证: | 项目 | 结果 | | --- | --- | | experimental package 编译 | Pass | | CI UT pipeline | Pass | | op_host UT | Pass,7 tests | | op_api UT | Pass,9 tests | | op_kernel UT | Pass,1 test | | package 出包 | Pass | ## 文档更新 - 新增 experimental/math/mod/README.md - 新增 aclnnFmodTensor & aclnnInplaceFmodTensor 接口文档 - 新增 aclnnFmodScalar & aclnnInplaceFmodScalar 接口文档 - 新增 examples 与 tests 目录 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!3240 | 2 个月前 | |
新增mod算子Ascend C实现 Co-authored-by: tieyutong<tieyutong@huawei.com> # message auto-generated for no-merge-commit merge: !3240 merge upload-mod-20260610 into master 新增mod算子Ascend C实现 Created-by: tieyutong Commit-by: tieyutong Merged-by: cann-robot Description: ## 描述 本 PR 新增 mod算子Ascend C实现,上传路径为experimental/math/mod。提供 aclnnFmodTensor、aclnnInplaceFmodTensor、aclnnFmodScalar、aclnnInplaceFmodScalar 四个接口,支持 Tensor-Tensor、Tensor-Scalar 以及 inplace 场景。 主要改动: - 新增 Mod 算子 op_host、op_kernel、op_api 实现。 - host 侧完成 dtype、shape、broadcast 校验、infershape、tiling 与 workspace 配置。 - kernel 侧支持 FLOAT32、FLOAT16、BF16、INT32 AICore 计算路径,并支持 scalar、same-shape、broadcast 输入。 - op_api 侧支持 DOUBLE、BF16、FLOAT16、FLOAT32、INT32、INT64、INT8、UINT8,非 kernel 原生 dtype 通过 cast 到可计算 dtype 后执行。 - 补充 README、aclnn 接口文档、examples 以及 UT 用例。 ## 关联的Issue https://gitcode.com/cann/ops-math/issues/1928 ## 测试 已完成以下验证: | 套件 | 用例数 | 结果 | | --- | ---: | --- | | aclnnFmodScalar Accu_Generalization | 5600 | Pass,按区间分段续跑完成 | | aclnnFmodTensor Perf_Generalization | 16 | Pass,device 性能达标 | | aclnnFmodScalar Perf_Generalization | 16 | Pass,device 性能达标 | CI/工程验证: | 项目 | 结果 | | --- | --- | | experimental package 编译 | Pass | | CI UT pipeline | Pass | | op_host UT | Pass,7 tests | | op_api UT | Pass,9 tests | | op_kernel UT | Pass,1 test | | package 出包 | Pass | ## 文档更新 - 新增 experimental/math/mod/README.md - 新增 aclnnFmodTensor & aclnnInplaceFmodTensor 接口文档 - 新增 aclnnFmodScalar & aclnnInplaceFmodScalar 接口文档 - 新增 examples 与 tests 目录 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!3240 | 2 个月前 | |
新增mod算子Ascend C实现 Co-authored-by: tieyutong<tieyutong@huawei.com> # message auto-generated for no-merge-commit merge: !3240 merge upload-mod-20260610 into master 新增mod算子Ascend C实现 Created-by: tieyutong Commit-by: tieyutong Merged-by: cann-robot Description: ## 描述 本 PR 新增 mod算子Ascend C实现,上传路径为experimental/math/mod。提供 aclnnFmodTensor、aclnnInplaceFmodTensor、aclnnFmodScalar、aclnnInplaceFmodScalar 四个接口,支持 Tensor-Tensor、Tensor-Scalar 以及 inplace 场景。 主要改动: - 新增 Mod 算子 op_host、op_kernel、op_api 实现。 - host 侧完成 dtype、shape、broadcast 校验、infershape、tiling 与 workspace 配置。 - kernel 侧支持 FLOAT32、FLOAT16、BF16、INT32 AICore 计算路径,并支持 scalar、same-shape、broadcast 输入。 - op_api 侧支持 DOUBLE、BF16、FLOAT16、FLOAT32、INT32、INT64、INT8、UINT8,非 kernel 原生 dtype 通过 cast 到可计算 dtype 后执行。 - 补充 README、aclnn 接口文档、examples 以及 UT 用例。 ## 关联的Issue https://gitcode.com/cann/ops-math/issues/1928 ## 测试 已完成以下验证: | 套件 | 用例数 | 结果 | | --- | ---: | --- | | aclnnFmodScalar Accu_Generalization | 5600 | Pass,按区间分段续跑完成 | | aclnnFmodTensor Perf_Generalization | 16 | Pass,device 性能达标 | | aclnnFmodScalar Perf_Generalization | 16 | Pass,device 性能达标 | CI/工程验证: | 项目 | 结果 | | --- | --- | | experimental package 编译 | Pass | | CI UT pipeline | Pass | | op_host UT | Pass,7 tests | | op_api UT | Pass,9 tests | | op_kernel UT | Pass,1 test | | package 出包 | Pass | ## 文档更新 - 新增 experimental/math/mod/README.md - 新增 aclnnFmodTensor & aclnnInplaceFmodTensor 接口文档 - 新增 aclnnFmodScalar & aclnnInplaceFmodScalar 接口文档 - 新增 examples 与 tests 目录 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!3240 | 2 个月前 | |
新增mod算子Ascend C实现 Co-authored-by: tieyutong<tieyutong@huawei.com> # message auto-generated for no-merge-commit merge: !3240 merge upload-mod-20260610 into master 新增mod算子Ascend C实现 Created-by: tieyutong Commit-by: tieyutong Merged-by: cann-robot Description: ## 描述 本 PR 新增 mod算子Ascend C实现,上传路径为experimental/math/mod。提供 aclnnFmodTensor、aclnnInplaceFmodTensor、aclnnFmodScalar、aclnnInplaceFmodScalar 四个接口,支持 Tensor-Tensor、Tensor-Scalar 以及 inplace 场景。 主要改动: - 新增 Mod 算子 op_host、op_kernel、op_api 实现。 - host 侧完成 dtype、shape、broadcast 校验、infershape、tiling 与 workspace 配置。 - kernel 侧支持 FLOAT32、FLOAT16、BF16、INT32 AICore 计算路径,并支持 scalar、same-shape、broadcast 输入。 - op_api 侧支持 DOUBLE、BF16、FLOAT16、FLOAT32、INT32、INT64、INT8、UINT8,非 kernel 原生 dtype 通过 cast 到可计算 dtype 后执行。 - 补充 README、aclnn 接口文档、examples 以及 UT 用例。 ## 关联的Issue https://gitcode.com/cann/ops-math/issues/1928 ## 测试 已完成以下验证: | 套件 | 用例数 | 结果 | | --- | ---: | --- | | aclnnFmodScalar Accu_Generalization | 5600 | Pass,按区间分段续跑完成 | | aclnnFmodTensor Perf_Generalization | 16 | Pass,device 性能达标 | | aclnnFmodScalar Perf_Generalization | 16 | Pass,device 性能达标 | CI/工程验证: | 项目 | 结果 | | --- | --- | | experimental package 编译 | Pass | | CI UT pipeline | Pass | | op_host UT | Pass,7 tests | | op_api UT | Pass,9 tests | | op_kernel UT | Pass,1 test | | package 出包 | Pass | ## 文档更新 - 新增 experimental/math/mod/README.md - 新增 aclnnFmodTensor & aclnnInplaceFmodTensor 接口文档 - 新增 aclnnFmodScalar & aclnnInplaceFmodScalar 接口文档 - 新增 examples 与 tests 目录 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!3240 | 2 个月前 | |
新增mod算子Ascend C实现 Co-authored-by: tieyutong<tieyutong@huawei.com> # message auto-generated for no-merge-commit merge: !3240 merge upload-mod-20260610 into master 新增mod算子Ascend C实现 Created-by: tieyutong Commit-by: tieyutong Merged-by: cann-robot Description: ## 描述 本 PR 新增 mod算子Ascend C实现,上传路径为experimental/math/mod。提供 aclnnFmodTensor、aclnnInplaceFmodTensor、aclnnFmodScalar、aclnnInplaceFmodScalar 四个接口,支持 Tensor-Tensor、Tensor-Scalar 以及 inplace 场景。 主要改动: - 新增 Mod 算子 op_host、op_kernel、op_api 实现。 - host 侧完成 dtype、shape、broadcast 校验、infershape、tiling 与 workspace 配置。 - kernel 侧支持 FLOAT32、FLOAT16、BF16、INT32 AICore 计算路径,并支持 scalar、same-shape、broadcast 输入。 - op_api 侧支持 DOUBLE、BF16、FLOAT16、FLOAT32、INT32、INT64、INT8、UINT8,非 kernel 原生 dtype 通过 cast 到可计算 dtype 后执行。 - 补充 README、aclnn 接口文档、examples 以及 UT 用例。 ## 关联的Issue https://gitcode.com/cann/ops-math/issues/1928 ## 测试 已完成以下验证: | 套件 | 用例数 | 结果 | | --- | ---: | --- | | aclnnFmodScalar Accu_Generalization | 5600 | Pass,按区间分段续跑完成 | | aclnnFmodTensor Perf_Generalization | 16 | Pass,device 性能达标 | | aclnnFmodScalar Perf_Generalization | 16 | Pass,device 性能达标 | CI/工程验证: | 项目 | 结果 | | --- | --- | | experimental package 编译 | Pass | | CI UT pipeline | Pass | | op_host UT | Pass,7 tests | | op_api UT | Pass,9 tests | | op_kernel UT | Pass,1 test | | package 出包 | Pass | ## 文档更新 - 新增 experimental/math/mod/README.md - 新增 aclnnFmodTensor & aclnnInplaceFmodTensor 接口文档 - 新增 aclnnFmodScalar & aclnnInplaceFmodScalar 接口文档 - 新增 examples 与 tests 目录 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!3240 | 2 个月前 | |
新增mod算子Ascend C实现 Co-authored-by: tieyutong<tieyutong@huawei.com> # message auto-generated for no-merge-commit merge: !3240 merge upload-mod-20260610 into master 新增mod算子Ascend C实现 Created-by: tieyutong Commit-by: tieyutong Merged-by: cann-robot Description: ## 描述 本 PR 新增 mod算子Ascend C实现,上传路径为experimental/math/mod。提供 aclnnFmodTensor、aclnnInplaceFmodTensor、aclnnFmodScalar、aclnnInplaceFmodScalar 四个接口,支持 Tensor-Tensor、Tensor-Scalar 以及 inplace 场景。 主要改动: - 新增 Mod 算子 op_host、op_kernel、op_api 实现。 - host 侧完成 dtype、shape、broadcast 校验、infershape、tiling 与 workspace 配置。 - kernel 侧支持 FLOAT32、FLOAT16、BF16、INT32 AICore 计算路径,并支持 scalar、same-shape、broadcast 输入。 - op_api 侧支持 DOUBLE、BF16、FLOAT16、FLOAT32、INT32、INT64、INT8、UINT8,非 kernel 原生 dtype 通过 cast 到可计算 dtype 后执行。 - 补充 README、aclnn 接口文档、examples 以及 UT 用例。 ## 关联的Issue https://gitcode.com/cann/ops-math/issues/1928 ## 测试 已完成以下验证: | 套件 | 用例数 | 结果 | | --- | ---: | --- | | aclnnFmodScalar Accu_Generalization | 5600 | Pass,按区间分段续跑完成 | | aclnnFmodTensor Perf_Generalization | 16 | Pass,device 性能达标 | | aclnnFmodScalar Perf_Generalization | 16 | Pass,device 性能达标 | CI/工程验证: | 项目 | 结果 | | --- | --- | | experimental package 编译 | Pass | | CI UT pipeline | Pass | | op_host UT | Pass,7 tests | | op_api UT | Pass,9 tests | | op_kernel UT | Pass,1 test | | package 出包 | Pass | ## 文档更新 - 新增 experimental/math/mod/README.md - 新增 aclnnFmodTensor & aclnnInplaceFmodTensor 接口文档 - 新增 aclnnFmodScalar & aclnnInplaceFmodScalar 接口文档 - 新增 examples 与 tests 目录 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!3240 | 2 个月前 | |
新增mod算子Ascend C实现 Co-authored-by: tieyutong<tieyutong@huawei.com> # message auto-generated for no-merge-commit merge: !3240 merge upload-mod-20260610 into master 新增mod算子Ascend C实现 Created-by: tieyutong Commit-by: tieyutong Merged-by: cann-robot Description: ## 描述 本 PR 新增 mod算子Ascend C实现,上传路径为experimental/math/mod。提供 aclnnFmodTensor、aclnnInplaceFmodTensor、aclnnFmodScalar、aclnnInplaceFmodScalar 四个接口,支持 Tensor-Tensor、Tensor-Scalar 以及 inplace 场景。 主要改动: - 新增 Mod 算子 op_host、op_kernel、op_api 实现。 - host 侧完成 dtype、shape、broadcast 校验、infershape、tiling 与 workspace 配置。 - kernel 侧支持 FLOAT32、FLOAT16、BF16、INT32 AICore 计算路径,并支持 scalar、same-shape、broadcast 输入。 - op_api 侧支持 DOUBLE、BF16、FLOAT16、FLOAT32、INT32、INT64、INT8、UINT8,非 kernel 原生 dtype 通过 cast 到可计算 dtype 后执行。 - 补充 README、aclnn 接口文档、examples 以及 UT 用例。 ## 关联的Issue https://gitcode.com/cann/ops-math/issues/1928 ## 测试 已完成以下验证: | 套件 | 用例数 | 结果 | | --- | ---: | --- | | aclnnFmodScalar Accu_Generalization | 5600 | Pass,按区间分段续跑完成 | | aclnnFmodTensor Perf_Generalization | 16 | Pass,device 性能达标 | | aclnnFmodScalar Perf_Generalization | 16 | Pass,device 性能达标 | CI/工程验证: | 项目 | 结果 | | --- | --- | | experimental package 编译 | Pass | | CI UT pipeline | Pass | | op_host UT | Pass,7 tests | | op_api UT | Pass,9 tests | | op_kernel UT | Pass,1 test | | package 出包 | Pass | ## 文档更新 - 新增 experimental/math/mod/README.md - 新增 aclnnFmodTensor & aclnnInplaceFmodTensor 接口文档 - 新增 aclnnFmodScalar & aclnnInplaceFmodScalar 接口文档 - 新增 examples 与 tests 目录 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!3240 | 2 个月前 |
Mod
产品支持情况
| 产品 | 是否支持 |
|---|---|
| Ascend 950PR/Ascend 950DT | √ |
| Atlas A3 训练系列产品/Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品/Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | × |
| Atlas 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
功能说明
-
算子功能:返回 self 除以 other 的余数。
-
计算公式:
对于入参 self 和比较标量 other,Fmod 可以用如下数学公式表示:
outi=selfi−(other×trunc(selfi/other))out_{i} = self_{i} - (other \times trunc(self_{i}/other)) outi=selfi−(other×trunc(selfi/other))
参数说明
| 参数名 | 输入/输出/属性 | 描述 | 数据类型 | 数据格式 |
|---|---|---|---|---|
| self | 输入 | 待进行mod计算的入参,公式中的self_i。 | BFLOAT16、FLOAT16、FLOAT32、INT32 | ND |
| other | 输入 | 待进行mod计算的入参,公式中的other。 | BFLOAT16、FLOAT16、FLOAT32、INT32 | ND |
| out | 输出 | 待进行mod计算的出参,公式中的out_i。 | BFLOAT16、FLOAT16、FLOAT32、INT32 | ND |
约束说明
- aclnn 层支持 DOUBLE、BFLOAT16、FLOAT16、FLOAT32、INT32、INT64、INT8、UINT8 类型推导;AICore kernel 覆盖 BFLOAT16、FLOAT16、FLOAT32、INT32,其余类型走 AICPU fallback。
- self和out的shape必须一致。
- 数据维度不支持8维以上。
调用说明
| 调用方式 | 样例代码 | 说明 |
|---|---|---|
| aclnn接口 | test_aclnn_fmod_scalar | 通过aclnnFmodScalar接口方式调用Mod算子。 |
| aclnn接口 | test_aclnn_fmod_tensor | 通过aclnnFmodTensor接口方式调用Mod算子。 |