| Files | Last commit | Last update |
|---|---|---|
fix(adjacent_difference): 移除示例多余的内置头文件include,修复AdjacentDifference类重定义导致example编译失败 Co-authored-by: caorenlei<caorenlei@huawei.com> # message auto-generated for no-merge-commit merge: !6964 merge adj into master fix(adjacent_difference): 移除示例多余的内置头文件include,修复AdjacentDifference类重定义导致example编译失败 Created-by: caorenlei Commit-by: caorenlei Merged-by: cann-robot Description: ## 描述 **改动原因**:adjacent_difference 算子 graph 模式 example( math/adjacent_difference/examples/test_geir_adjacent_difference.cpp)在 CANN 9.3.0 环境下编译失败。AdjacentDifference 算子 proto 已上库到 CANN 内置头文件 experiment_ops.h(REG_OP(AdjacentDifference)),而 example 同时 include 了内置 experiment_ops.h 与仓库自有 op_graph/adjacent_difference_proto.h,两处 REG_OP 宏均展开为同名类 ge::op::AdjacentDifference,产生类重定义编译错误: error: redefinition of 'class ge::op::AdjacentDifference' adjacent_difference_proto.h:39 REG_OP(AdjacentDifference) experiment_ops.h:5550 REG_OP(AdjacentDifference) (previous definition) **改动方法**: - 删除 example 中多余的 #include "experiment_ops.h" 与 #include "nn_other.h"(example 实际仅依赖 array_ops.h 提供 op::Data、仓库 proto 提供 op::AdjacentDifference,被删头文件无任何实际符号依赖) - 附带 clang-format 对该文件的格式化(宏续行对齐、CreateOppInGraph 函数签名换行),无功能变更 ## 关联的Issue - #4384 ## 测试 - 环境:CANN 9.3.0,soc=ascend950 - 命令:bash build.sh --run_example adjacent_difference graph --example_name=adjacent_difference --soc=ascend950 - 结果:编译通过,example 执行成功(run test_geir_adjacent_difference, execute samples success) - 精度验证:输入 [1.0, 1.0, 2.0, 3.0, 3.0, 4.0, 6.0, 6.0, 6.0, 8.0],输出 [0, 0, 1, 1, 0, 1, 1, 0, 0, 1],与算子语义(y[0]=0, y[i]=x[i]==x[i-1]?0:1)期望逐元素一致 ## 文档更新 无 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6964 | 9 days ago | |
add range mod adj pow one_hot Co-authored-by: Nicooo-Wang<wangtianle3@huawei.com> # message auto-generated for no-merge-commit merge: !541 merge move-ops into master add range mod adj pow one_hot Created-by: Nicooo-Wang Commit-by: Nicooo-Wang;王天乐 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!541 | 10 months ago | |
range等算子资料更新 Co-authored-by: suxiaolan2000<jiangyulong10@huawei.com> # message auto-generated for no-merge-commit merge: !697 merge math同步 into master range等算子资料更新 Created-by: suxiaolan2000 Commit-by: suxiaolan2000 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!697 | 9 months ago | |
feat: bincount/adjacent_difference 新增 ascend960dt/ascend960pr 注册级支持 Co-authored-by: caorenlei<caorenlei@huawei.com> # message auto-generated for no-merge-commit merge: !6388 merge 1010 into master feat: bincount/adjacent_difference 新增 ascend960dt/ascend960pr 注册级支持 Created-by: caorenlei Commit-by: caorenlei Merged-by: cann-robot Description: ## 描述 bincount、adjacent_difference 两算子新增 ascend960dt/ascend960pr 平台注册级支持(v121 适配)。 ### 改动原因 Ascend960 系列平台上线,算子需同步支持 ascend960dt/ascend960pr 计算单元;适配增量同步自内部仓 cann_out 分支,在 OSS master 基线上叠加。 ### 改动方法(注册级适配,kernel/tiling/aclnn 零改动) 1. **def.cpp 注册**(2 文件):bincount_def.cpp、adjacent_difference_def.cpp 在既有 AddConfig("ascend950"/"ascend350") 后追加 AddConfig("ascend960dt", aicoreConfig) 与 AddConfig("ascend960pr", aicoreConfig),复用同一 aicoreConfig,保留 ascend350 注册不删 2. **config 配置**(8 个新增文件):新增 op_host/config/ascend960dt/、op_host/config/ascend960pr/(2 算子 × 2 芯片 × binary.json + simplified_key.ini),内容与既有 ascend950 配置逐字节一致 3. **CMakeLists**(2 文件):SUPPORT_COMPUTE_UNIT 追加 "ascend960dt" "ascend960pr",SUPPORT_TILING_DIR 等量追加 "arch35"(tiling 复用 arch35) 4. **ascendc_config.json**:Bincount、AdjacentDifference 条目 compute_units 追加 "ascend960dt",compile_options 镜像 ascend950(-mllvm -cce-aicore-dcci-before-kernel-end=false) 5. **.pre-commit-config.yaml**:codespell 忽略列表追加 build-in(config 镜像中 ascend950 既有注释拼写,内容须与 950 逐字节一致不可修改) ## 关联的Issue - #3598 ## 测试 1. **ascend950 编译出包**:bash build.sh --pkg --soc=ascend950 --ops=bincount,adjacent_difference -j8 通过;包内 950 内核齐全(23 个 .o),aic-ascend960dt-ops-info.json 含 Bincount、AdjacentDifference 注册(960 注册生效核验) 2. **950 kernel 零影响硬证据**:适配前后两次编译,23 个 ascend950 kernel .o SHA256 逐字节一致(bit 级不变) 3. **ttk 精度回归 386/386 全 PASS**(Ascend950PR_9579,release 模式,seed=123): - bincount(kernel 级)192/192、adjacent_difference(kernel 级)81/81、aclnnBincount(API 级)113/113 - 正控 PASS / 负控 FAIL,判定链路自证有效 ## 文档更新 无 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6388 | 26 days ago | |
refactor: arch35算子Reg级API重命名迁移 Co-authored-by: hahaha22<wangrunze20@h-partners.com> # message auto-generated for no-merge-commit merge: !4468 merge work_8 into master refactor: arch35算子Reg级API重命名迁移 Created-by: hahaha22 Commit-by: hahaha22 Merged-by: cann-robot Description: ## 描述 将 arch35 架构下 40 个算子 kernel 文件中的 Reg 级 API 名称从旧命名迁移到新命名,与已迁移的算子(xlogy、dawsn、rint、cdist、reduce_all、power 等)保持一致。 涉及的 API 重命名映射: - __local_mem__ → __ubuf__(地址空间限定符统一) - Reg::DataCopy (LoadDist) → Reg::LoadAlign(UB 到寄存器的对齐加载) - Reg::DataCopy (StoreDist) → Reg::StoreAlign(寄存器到 UB 的对齐存储) - Reg::DataCopyUnAlignPre → Reg::LoadUnAlignPre - Reg::DataCopyUnAlign → Reg::LoadUnAlign - Reg::MaskPack → Reg::Pack - Reg::MaskUnPack → Reg::UnPack - Reg::MaskAnd → Reg::And(与已有 Reg::And 通过重载统一) - Reg::CompareScalar → Reg::Compares - Reg::UnalignReg → Reg::UnalignRegForLoad 涉及的算子包括:clip_by_value、clip_by_value_v2、adjacent_difference、bitwise_xor、div、floor_div、floor_mod、lerp、logical_or、mod、pow、signbit、tanh_grad。 此外,adjacent_difference 算子中存在原有的 __local_mem__/__ubuf__ 地址空间限定符不一致问题(左侧声明与右侧转换不匹配),本次重命名一并修复。 ### 改动原因 AscendC SDK 更新了 Reg 级 API 命名规范,将原有的 DataCopy 拆分为语义更明确的 LoadAlign/StoreAlign,并移除了 Mask 系列 API 的 "Mask" 前缀(通过重载统一)。本 PR 将相关算子迁移至新命名。 ### 改动方法 纯机械重命名,无逻辑变更。所有改动均为 1:1 的 API 名称替换,增删行数完全对称(+417 -417)。Load/Store 语义区分基于原有模板参数(LoadDist → LoadAlign, StoreDist → StoreAlign)和参数顺序(寄存器在前为 Load,地址在前为 Store)。 ## 关联的Issue - #2529 ## 测试 待补充:二级冒烟测试、算子泛化测试。 ## 文档更新 无 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:API 重命名重构 See merge request: cann/ops-math!4468 | 3 months ago | |
docs: add English translations for markdown files Co-authored-by: jenny_xiang<jenny.xiang@huawei.com> # message auto-generated for no-merge-commit merge: !7113 merge docs/add-english-translations into master docs: add English translations for markdown files Created-by: jenny_xiang Commit-by: jenny_xiang Merged-by: cann-robot Description: ## 描述 新增仓库Markdown文档英文译稿(第二批,共409个文件):第一批(已合入)之外的其余全部译稿,覆盖conversion、examples、ge、math、random各类算子README译稿,以及CHANGELOG_en.md、.gitcode PR模板英文版等。 本批内全部仓内链接均指向master已有文件(含第一批已合入的21+2篇译稿),合入后本仓432篇英文文档全部就位,链接完整生效。 本批同时包含4篇基于最新源文档的增量更新(math/ada_cast、math/prod_force_se_a、math/sinkhorn、math/xlogy,对应上游近期文档变更)。 ## 关联的Issue 无 ## 测试 文档类变更,无需算子测试;已通过链接有效性校验(本批全部相对链接仅指向master已有文件,无指向本PR外未提交文件的链接),并完成逐篇翻译规范自查与语义校对(含支持状态表、限定词、术语、数值符号核对)。 ## 文档更新 新增409个英文译稿文件(*_en.md / .en-US.md),不修改任何现有文件。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!7113 | 6 days ago | |
feat: bincount/adjacent_difference 新增 ascend960dt/ascend960pr 注册级支持 Co-authored-by: caorenlei<caorenlei@huawei.com> # message auto-generated for no-merge-commit merge: !6388 merge 1010 into master feat: bincount/adjacent_difference 新增 ascend960dt/ascend960pr 注册级支持 Created-by: caorenlei Commit-by: caorenlei Merged-by: cann-robot Description: ## 描述 bincount、adjacent_difference 两算子新增 ascend960dt/ascend960pr 平台注册级支持(v121 适配)。 ### 改动原因 Ascend960 系列平台上线,算子需同步支持 ascend960dt/ascend960pr 计算单元;适配增量同步自内部仓 cann_out 分支,在 OSS master 基线上叠加。 ### 改动方法(注册级适配,kernel/tiling/aclnn 零改动) 1. **def.cpp 注册**(2 文件):bincount_def.cpp、adjacent_difference_def.cpp 在既有 AddConfig("ascend950"/"ascend350") 后追加 AddConfig("ascend960dt", aicoreConfig) 与 AddConfig("ascend960pr", aicoreConfig),复用同一 aicoreConfig,保留 ascend350 注册不删 2. **config 配置**(8 个新增文件):新增 op_host/config/ascend960dt/、op_host/config/ascend960pr/(2 算子 × 2 芯片 × binary.json + simplified_key.ini),内容与既有 ascend950 配置逐字节一致 3. **CMakeLists**(2 文件):SUPPORT_COMPUTE_UNIT 追加 "ascend960dt" "ascend960pr",SUPPORT_TILING_DIR 等量追加 "arch35"(tiling 复用 arch35) 4. **ascendc_config.json**:Bincount、AdjacentDifference 条目 compute_units 追加 "ascend960dt",compile_options 镜像 ascend950(-mllvm -cce-aicore-dcci-before-kernel-end=false) 5. **.pre-commit-config.yaml**:codespell 忽略列表追加 build-in(config 镜像中 ascend950 既有注释拼写,内容须与 950 逐字节一致不可修改) ## 关联的Issue - #3598 ## 测试 1. **ascend950 编译出包**:bash build.sh --pkg --soc=ascend950 --ops=bincount,adjacent_difference -j8 通过;包内 950 内核齐全(23 个 .o),aic-ascend960dt-ops-info.json 含 Bincount、AdjacentDifference 注册(960 注册生效核验) 2. **950 kernel 零影响硬证据**:适配前后两次编译,23 个 ascend950 kernel .o SHA256 逐字节一致(bit 级不变) 3. **ttk 精度回归 386/386 全 PASS**(Ascend950PR_9579,release 模式,seed=123): - bincount(kernel 级)192/192、adjacent_difference(kernel 级)81/81、aclnnBincount(API 级)113/113 - 正控 PASS / 负控 FAIL,判定链路自证有效 ## 文档更新 无 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6388 | 26 days ago | |
产品名变更 Co-authored-by: gitcode-chenjiao<chenjiao31@huawei.com> # message auto-generated for no-merge-commit merge: !5912 merge master into master 产品名变更 Created-by: gitcode-chenjiao Commit-by: gitcode-chenjiao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> AI处理器对应的产品型号名称更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> [#3258](https://gitcode.com/cann/ops-math/issues/3258) ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ok ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> *.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!5912 | 1 month ago | |
docs: add English translations for markdown files Co-authored-by: jenny_xiang<jenny.xiang@huawei.com> # message auto-generated for no-merge-commit merge: !7113 merge docs/add-english-translations into master docs: add English translations for markdown files Created-by: jenny_xiang Commit-by: jenny_xiang Merged-by: cann-robot Description: ## 描述 新增仓库Markdown文档英文译稿(第二批,共409个文件):第一批(已合入)之外的其余全部译稿,覆盖conversion、examples、ge、math、random各类算子README译稿,以及CHANGELOG_en.md、.gitcode PR模板英文版等。 本批内全部仓内链接均指向master已有文件(含第一批已合入的21+2篇译稿),合入后本仓432篇英文文档全部就位,链接完整生效。 本批同时包含4篇基于最新源文档的增量更新(math/ada_cast、math/prod_force_se_a、math/sinkhorn、math/xlogy,对应上游近期文档变更)。 ## 关联的Issue 无 ## 测试 文档类变更,无需算子测试;已通过链接有效性校验(本批全部相对链接仅指向master已有文件,无指向本PR外未提交文件的链接),并完成逐篇翻译规范自查与语义校对(含支持状态表、限定词、术语、数值符号核对)。 ## 文档更新 新增409个英文译稿文件(*_en.md / .en-US.md),不修改任何现有文件。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!7113 | 6 days ago |
AdjacentDifference
English | 简体中文
Product Support Status
| Product | Supported |
|---|---|
| Ascend 950PR&950DT products | √ |
| Atlas A3 products | × |
| Atlas A2 products | × |
| Atlas 200I/500 A2 inference products | × |
| Atlas inference products | × |
| Atlas training products | × |
Function Description
-
Operator function: compares the differences between adjacent elements of the input tensor. If two adjacent elements are the same, 0 is returned; otherwise, 1 is returned.
-
Computation formula:
outi=(xi==xj? 0:1).to(ydtype) j=i−1out_i = {(x_i == x_j ?\ 0 : 1)}.to(y_dtype) \ j = i - 1 outi=(xi==xj? 0:1).to(ydtype) j=i−1
Parameter Description
| Parameter Name | Input/Output/Attribute | Description | Data Type | Data Format |
|---|---|---|---|---|
| x | Input | Input parameter for the AdjacentDifference computation, which is x in the formula. | FLOAT, FLOAT16, BFLOAT16, INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64 | ND |
| y_dtype | Input | An attribute that specifies the output type, which is y_dtype in the formula. | INT32 | ND |
| y | Output | Output parameter for the AdjacentDifference computation, which is out in the formula. | INT32, INT64 | ND |
- Atlas training products and Atlas inference products: BFLOAT16 is not supported.
Constraint Description
- None.
Invocation Description
| Invocation Method | Sample Code | Description |
|---|---|---|
| Graph mode | test_geir_adjacent_difference | Invokes the AdjacentDifference operator by building a graph through the operator IR. |