| Files | Last commit | Last update |
|---|---|---|
【PR】: feat:remove all exclude Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !4195 merge master_precommit into master 【PR】: feat:remove all exclude Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 pre-commit example scripts docs,并把这些目录pre-commit排除项给去掉 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 pre-commit readme docs无新增文件 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!4195 | 3 months ago | |
fix: Synchronize memory example handoffs Co-authored-by: aodebiao<18003961989@163.com> # message auto-generated for no-merge-commit merge: !5987 merge fix/synchronize-memory-example-reads-20261030 into master fix: Synchronize memory example handoffs Created-by: gxhgxh2475698 Commit-by: aodebiao Merged-by: cann-robot Description: # Pull Request ## Description Synchronize asynchronous device reads and writes before handing off or releasing memory in five examples. ## Motivation The memory-copy examples enqueue a read and immediately force-destroy the stream, which does not wait for pending tasks. In the IPC examples, the producer publishes the memory identifier before its write completes and the consumer sends the completion flag before its read completes. File handoffs do not synchronize device streams. The consumer also signals before closing its import, although the API requires importers to close before the exporter. ## Changes - Check aclrtSynchronizeStream after the read in three memory-copy examples. - Wait for the producer write before publishing the identifier, and for the consumer read before closing its import and sending the completion flag in both IPC examples. ## Change Type - [x] Bug Fix - [ ] New Feature - [ ] Code Style Update - [ ] Refactoring - [ ] Build Process or Auxiliary Tool Changes - [ ] Documentation Content Update ## Associated Issues Fixes #1290 ## How to Test - Checked source order before and after in all seven files against the kernel helpers and documented force-destroy and IPC close ordering. - git diff --check passed. CANN/NPU execution and compilation were not available. ## Checklist - [x] My code follows the project's code style - [x] I have self-tested the code - [ ] I have updated related documentation - [x] I used appropriate type labels in the title - [x] I have read the Contributing Guide and followed its regulations ## Additional Information The change is limited to examples; no Runtime implementation is changed. See merge request: cann/runtime!5987 | 22 days ago | |
fix: Synchronize memory example handoffs Co-authored-by: aodebiao<18003961989@163.com> # message auto-generated for no-merge-commit merge: !5987 merge fix/synchronize-memory-example-reads-20261030 into master fix: Synchronize memory example handoffs Created-by: gxhgxh2475698 Commit-by: aodebiao Merged-by: cann-robot Description: # Pull Request ## Description Synchronize asynchronous device reads and writes before handing off or releasing memory in five examples. ## Motivation The memory-copy examples enqueue a read and immediately force-destroy the stream, which does not wait for pending tasks. In the IPC examples, the producer publishes the memory identifier before its write completes and the consumer sends the completion flag before its read completes. File handoffs do not synchronize device streams. The consumer also signals before closing its import, although the API requires importers to close before the exporter. ## Changes - Check aclrtSynchronizeStream after the read in three memory-copy examples. - Wait for the producer write before publishing the identifier, and for the consumer read before closing its import and sending the completion flag in both IPC examples. ## Change Type - [x] Bug Fix - [ ] New Feature - [ ] Code Style Update - [ ] Refactoring - [ ] Build Process or Auxiliary Tool Changes - [ ] Documentation Content Update ## Associated Issues Fixes #1290 ## How to Test - Checked source order before and after in all seven files against the kernel helpers and documented force-destroy and IPC close ordering. - git diff --check passed. CANN/NPU execution and compilation were not available. ## Checklist - [x] My code follows the project's code style - [x] I have self-tested the code - [ ] I have updated related documentation - [x] I used appropriate type labels in the title - [x] I have read the Contributing Guide and followed its regulations ## Additional Information The change is limited to examples; no Runtime implementation is changed. See merge request: cann/runtime!5987 | 22 days ago | |
fix: 迁移 Ascend C 样例至 ASC 前端 Co-authored-by: xiao_hhh<guohui37@huawei.com> # message auto-generated for no-merge-commit merge: !5323 merge fix_ascendc_cmake into master fix: 迁移 Ascend C 样例至 ASC 前端 Created-by: xiao_hhh Commit-by: xiao_hhh Merged-by: cann-robot Description: # Pull Request ## 描述 将 40 个实际编译 Ascend C Kernel 的 Runtime example 从 legacy --cce-aicore-lang 构建链迁移到 ASC CMake 前端,统一使用 find_package(ASC)、ASC language 和显式 NPU 架构映射。 同时保留样例原有执行行为,复用公共 Kernel 源文件,补齐 FatBin 安装规则,并保留 D2D 同步拷贝场景所需的显式流同步。 ## 变更类型 - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 1. CANN 9.1.0、Ascend 910B3、Driver 25.5.0:40/40 Kernel target 编译通过,59/59 Device ELF 包含 ParamSummary,35/35 可执行单机样例通过。 2. CANN 9.2.0-beta.2、Ascend 910B3、Driver 25.5.0:40/40 Kernel target 编译通过,59/59 Device ELF 包含 ParamSummary;安装版可构建的 34 个单机样例全部通过,0_launch_kernel 的 simple/placeholder 模式均通过。 3. 使用当前源码 Runtime 补测 9.2-beta.2 安装包尚未提供的接口:binary_enumerate_functions、binary_get_function_count、launch_blocking 均编译并真机运行通过,ldd -r 无未定义符号。 4. pre-commit run --files <本次74个文件>、clang-format、OAT 和 git diff --check 均通过。 说明:跨服务器物理内存共享样例需要双机环境,未执行运行验证;9.2-beta.2 环境未安装匹配的 910B OPS 包,因此两个依赖 aclnnAdd 的 model 样例仅完成 ASC Kernel 与元数据验证,不将混用 9.1 OPS 的结果计为 9.2 通过。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已确认本次变更无需更新接口文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本 PR 仅包含 74 个本次 ASC 前端迁移及 pre-commit 修复涉及的 example/ 文件,不包含本地构建产物、验证日志或其他工作区文件。 See merge request: cann/runtime!5323 | 1 month ago | |
【PR】: 新增描述符驱动的异步内存复制样例 Co-authored-by: 2403_89963296<2540257541@qq.com> # message auto-generated for no-merge-commit merge: !4956 merge example/1_basic_features/memory/13_memcpy_descriptor into master 【PR】: 新增描述符驱动的异步内存复制样例 Created-by: 2403_89963296 Commit-by: 2403_89963296 Merged-by: cann-robot Description: # Pull Request ## 描述 新增 Runtime7 单 Device 描述符驱动异步内存复制样例,补充 aclrtGetMemcpyDescSize、aclrtSetMemcpyDesc 和 aclrtMemcpyAsyncWithDesc 三个配套接口的场景化用法。 样例生成 1024 个确定的 uint32_t 输入元素,为源数据、目的数据和内存复制描述符申请 Device 内存,通过 ACL_MEMCPY_INNER_DEVICE_TO_DEVICE 配置描述符并在 Stream 上异步下发 4096 Byte 的 Device 内复制任务。Stream 同步后,样例将结果回拷至 Host 并逐项校验,任一 API、数据校验或必要资源清理失败均返回非零退出码。 本次变更还包括: - 新增样例的 main.cpp、CMakeLists.txt 和 run.sh。 - 新增中英文 README,说明产品支持、编译运行、关键 API 和示例输出。 - 更新 memory 主题的中英文样例导航。 - 普通 Runtime 样例直接链接 libacl_rt.so,不依赖 Kernel 或多 Device 能力。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 如何测试 测试环境: - CANN:9.2.0 - SOC:Ascend910_9362 - Device:单 Device 0 执行命令: bash source /home/developer/Ascend/cann/set_env.sh source /mnt/workspace/runtime/example/set_sample_env.sh cd /mnt/workspace/runtime/example/1_basic_features/memory/13_memcpy_descriptor bash run.sh 关键运行结果: text [INFO] Configured a 32-byte memcpy descriptor for 4096 bytes of data [INFO] Verified all 1024 copied elements [INFO] [SUCCESS] Memcpy descriptor sample completed successfully [SUCCESS] Memcpy descriptor sample executed successfully. 格式与合规检查: bash pre-commit run --show-diff-on-failure --files \ example/1_basic_features/memory/13_memcpy_descriptor/main.cpp \ example/1_basic_features/memory/13_memcpy_descriptor/README.md \ example/1_basic_features/memory/13_memcpy_descriptor/README_en.md \ example/1_basic_features/memory/13_memcpy_descriptor/CMakeLists.txt \ example/1_basic_features/memory/13_memcpy_descriptor/run.sh \ example/1_basic_features/memory/README.md \ example/1_basic_features/memory/README_en.md 检查结果:clang-format 和 OAT Compliance Check 均通过;bash -n、git diff --check 及 README 链接检查通过。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 - 源分支:example/1_basic_features/memory/13_memcpy_descriptor - 目标分支:master - 提交:d4aeec3defe405c31e54d0f422dd310e8cd5e067 - 变更范围:新增 5 个样例文件,更新 2 个 memory 主题导航文件。 - 本 PR 不新增或修改公开 API,不改变 Runtime 实现和既有接口行为。 See merge request: cann/runtime!4956 | 2 months ago | |
【PR】: 新增可复用 aclDataBuffer 样例 Co-authored-by: 2403_89963296<2540257541@qq.com> # message auto-generated for no-merge-commit merge: !5043 merge example/1_basic_features/memory/14_reusable_data_buffer into master 【PR】: 新增可复用 aclDataBuffer 样例 Created-by: 2403_89963296 Commit-by: 2403_89963296 Merged-by: cann-robot Description: # Pull Request ## 描述 新增 Runtime7 单 Device 可复用 aclDataBuffer 样例,补充 aclUpdateDataBuffer、aclGetDataBufferAddr 和 aclGetDataBufferSizeV2 等接口的场景化用法。 样例分别准备 37 Byte 和 83 Byte 的确定性数据以及对应的 Device 缓冲区。首先使用短数据创建 aclDataBuffer,验证地址、有效大小和逐字节内容;随后调用 aclUpdateDataBuffer 将同一个描述对象切换到长数据,并再次完成验证。 本次变更还包括: - 新增样例的 main.cpp、CMakeLists.txt 和 run.sh。 - 新增中英文 README,说明产品支持、运行方法、关键 API 和示例输出。 - 更新 memory 主题的中英文样例导航。 - 完善异常返回和资源清理流程。 ## 变更类型 - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue 关联 Issue:#<993> ## 如何测试 测试环境: - CANN:9.3.0-weekly.20260916.01 - SOC:Ascend910_9362 - Device:单 Device 0 - GCC:13.3.0 执行命令: ```bash source /home/developer/Ascend/cann/set_env.sh source /mnt/workspace/runtime/example/set_sample_env.sh cd /mnt/workspace/runtime/example/1_basic_features/memory/14_reusable_data_buffer bash run.sh See merge request: cann/runtime!5043 | 2 months ago | |
【PR】: 新增批量张量 Host/Device 往返传输样例 Co-authored-by: 2403_89963296<2540257541@qq.com> # message auto-generated for no-merge-commit merge: !5047 merge example/1_basic_features/memory/15_batch_tensor_round_trip into master 【PR】: 新增批量张量 Host/Device 往返传输样例 Created-by: 2403_89963296 Commit-by: 2403_89963296 Merged-by: cann-robot Description: # Pull Request ## 描述 新增 15_batch_tensor_round_trip 样例,演示同一组小张量在四种批量复制模式下完成 Host/Device 往返传输。 主要变更: - 覆盖 aclrtMemcpyBatch、aclrtMemcpyBatchV2、 aclrtMemcpyBatchAsync 和 aclrtMemcpyBatchAsyncV2。 - 每种模式分别执行 H2D 和 D2H。 - 使用锁页 Host 内存保证异步复制语义。 - 逐张量、逐元素校验复制结果。 - 验证旧版接口的 failIndex,并展示 V2 接口无 failIndex 输出参数的差异。 - 新增中英文 README、构建运行脚本,并更新 memory 主题导航。 ## 变更类型 - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 如何测试 1. 加载 CANN 和 Runtime 样例环境。 2. 进入 example/1_basic_features/memory/15_batch_tensor_round_trip。 3. 执行 bash run.sh。 测试结果: - CANN 9.3.0、Ascend910_9362 环境编译运行成功。 - 四种批量复制模式均执行成功。 - 4、7、11 元素的三个张量均通过逐元素校验。 - 旧版同步和异步接口的 H2D、D2H failIndex 均为 SIZE_MAX。 - pre-commit、clang-format、OAT hook、bash -n 和 git diff --check 均通过。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 样例编号使用 15,避免与另一pr的 14_reusable_data_buffer 发生目录冲突。 See merge request: cann/runtime!5047 | 2 months ago | |
【PR】: 新增结果表切片偏移复制样例 Co-authored-by: 2403_89963296<2540257541@qq.com> # message auto-generated for no-merge-commit merge: !5050 merge example/1_basic_features/memory/16_guarded_result_slice into master 【PR】: 新增结果表切片偏移复制样例 Created-by: 2403_89963296 Commit-by: 2403_89963296 Merged-by: cann-robot Description: # Pull Request ## 描述 新增 16_guarded_result_slice 单 Device 样例,演示为结果表设置 32 位哨兵值后,通过 Device 内保存的间接基地址和字节偏移异步更新目标切片,并回传校验目标切片及其前后未覆盖区。 主要变更: - 使用 aclrtMemsetD32 构造并独立校验 Host 侧期望表的哨兵基线。 - 使用 aclrtMemsetD32Async 在 Stream 上异步初始化 Device 侧结果表。 - 使用 aclrtMemcpyAsyncWithOffset 通过 Device 基地址槽完成偏移 D2D 复制。 - 新增源码、构建脚本、运行脚本和中英文 README。 - 更新 memory 主题的中英文样例导航。 ## 变更类型 - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 如何测试 1. 在 A3 环境使用 CANN 9.2.0 构建并运行样例: bash export ASCEND_INSTALL_PATH=/home/developer/Ascend/cann-9.2.0 bash example/1_basic_features/memory/16_guarded_result_slice/run.sh 2. 确认程序输出以下校验结果并以 0 退出: text [INFO] Verified Host sentinel baseline (16 elements) [INFO] Verified prefix guard [0, 5) [INFO] Verified copied slice [5, 11) [INFO] Verified suffix guard [11, 16) [INFO] [SUCCESS] Guarded result slice sample completed successfully [SUCCESS] Guarded result slice sample executed successfully. 3. 对本次变更的全部文件执行 pre-commit: bash pre-commit run --show-diff-on-failure --files \ example/1_basic_features/memory/16_guarded_result_slice/CMakeLists.txt \ example/1_basic_features/memory/16_guarded_result_slice/README.md \ example/1_basic_features/memory/16_guarded_result_slice/README_en.md \ example/1_basic_features/memory/16_guarded_result_slice/main.cpp \ example/1_basic_features/memory/16_guarded_result_slice/run.sh \ example/1_basic_features/memory/README.md \ example/1_basic_features/memory/README_en.md 测试结果: - 在 Ascend910_9362 A2 设备上构建和运行成功。 - Host 哨兵基线、目标切片及前后未覆盖区均通过逐元素校验。 - clang-format、OAT、pre-commit、git diff --check 和 bash -n 均通过。 - 本地仓库未提供可独立执行的 CodeCheck 工具,CodeCheck 待 GitCode CI 流水线验证。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于 commit message 的格式、无效 commit 的合并等 ## 其他信息 - 三个关键 API 的正式文档均标记支持 A2、A3、A5,本样例的产品支持范围取三者交集。 - 当前分支:example/1_basic_features/memory/16_guarded_result_slice。 - 目标分支:master。 See merge request: cann/runtime!5050 | 2 months ago | |
feat: 新增按配置分配并识别内存样例(#1065) Co-authored-by: 2403_89963296<2540257541@qq.com> # message auto-generated for no-merge-commit merge: !5414 merge example/1_basic_features/memory/17_configured_allocation into master feat: 新增按配置分配并识别内存样例(#1065) Created-by: 2403_89963296 Commit-by: 2403_89963296 Merged-by: cann-robot Description: # Pull Request ## 描述 新增 example/1_basic_features/memory/17_configured_allocation 样例,为按应用模块管理传输缓冲区的场景提供完整的单 Device 流程。 Host 和 Device 暂存内存按应用模块 ID 33 配置分配,查询指针属性以选择复制方向,并检查两个 Device 缓冲区的类型。样例完成 1024 个 32 位整数的 Host → 配置分配的 Device 缓冲区 → 缓存 Device 缓冲区 → Host 往返传输,使用带同步的释放接口等待异步传输完成,再逐元素校验回传结果。只有校验和全部资源清理成功才输出成功标记。 本次覆盖 aclrtCheckMemType、aclrtFreeHostWithDevSync、aclrtFreeWithDevSync、aclrtMallocCached、aclrtMallocHostWithCfg、aclrtMallocWithCfg、aclrtPointerGetAttributes 七个接口,提供源码、中英文说明、CMake 和运行脚本,更新直接父主题的双语导航。 ## 变更类型 - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue Closes #1065 https://gitcode.com/cann/runtime/issues/1065 ## 如何测试 1. 在安装 CANN 的受支持设备环境,加载 CANN 环境并设置 ASCEND_INSTALL_PATH,进入 example/1_basic_features/memory/17_configured_allocation 后执行 bash run.sh。 2. 检查两个 Device 缓冲区的类型匹配结果、三种传输方向、同步释放日志及 1024 个元素的逐项校验;程序退出码应为 0,并输出 [SUCCESS] Configured allocation sample completed successfully。 3. 对全部 7 个改动文件执行本地 Pre-commit,并执行 git diff --check 和 bash -n example/1_basic_features/memory/17_configured_allocation/run.sh。 已在 CANN 9.2.0、Ascend910_9362 上完成构建与实机运行,1024 个元素全部通过校验,资源清理成功。本地 Pre-commit(clang-format、OAT)、差异和 Shell 语法检查通过。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 根据正式 API 文档,关键接口的产品支持范围交集为 Atlas A2、Atlas A3、Ascend 950PR/Ascend 950DT。A2、Ascend 950 尚未完成实机验证。远端 CodeCheck 结果需以本 PR 的 CodeCheck_precommit 和实际 openLiBing 扫描结果为准,本地检查不替代远端 CodeCheck。 See merge request: cann/runtime!5414 | 1 month ago | |
feat: 新增组件内存排查样例(#1200) Co-authored-by: 2403_89963296<2540257541@qq.com> # message auto-generated for no-merge-commit merge: !5750 merge feat/component-memory-triage-20261021 into master feat: 新增组件内存排查样例(#1200) Created-by: 2403_89963296 Commit-by: 2403_89963296 Merged-by: cann-robot Description: # Pull Request ## 描述 排查组件内存占用时,需要根据当前占用与历史峰值确定优先检查的组件。本 PR 新增 19_component_memory_triage,使用 aclrtGetMemUsageInfo 获取单 Device 组件快照,校验统计数据,并按可配置的每组件阈值输出 CURRENT_PRESSURE、HISTORICAL_PEAK 或 WITHIN_BUDGET。 查询数组填满时扩容重查;达到样例保护上限仍填满则失败,避免把截断结果当作完整报告。默认阈值为当前 64 MiB、峰值 128 MiB。新增源码、运行入口、双语说明及直接父主题导航,共 7 个文件。组件统计不用于推算剩余可分配内存或精确业务分配增量。 ## 变更类型 - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue Closes #1200 https://gitcode.com/cann/runtime/issues/1200 Issue 负责人:Yanxijiu(2403_89963296)。合并后关闭关联 Issue。 ## 如何测试 1. 在受支持的 A3 Ascend910_9362、CANN 9.3.0 环境,设置 ASCEND_INSTALL_PATH 为实际 CANN 安装目录,进入样例目录执行: bash bash run.sh bash run.sh 1 128 bash run.sh 64 1 三次构建运行均成功,分别得到 WITHIN_BUDGET、CURRENT_PRESSURE、HISTORICAL_PEAK。实测组件当前占用为 29458432 Byte、峰值为 29470720 Byte;已核对组件排序、当前占用不大于峰值及各判断与返回统计一致。实际运行结果会随环境变化。 2. 验证参数 0、-1、1x、溢出 MiB、非法第二阈值和多余参数均被拒绝;bash run.sh 0 将程序失败传播为非零退出码;缺失 ASCEND_INSTALL_PATH 时脚本失败。失败运行未输出成功标记。 3. 对本任务全部 7 个文件执行仓库 Pre-commit(clang-format、OAT),使用 PRE_COMMIT_FROM_REF=HEAD 确保实际扫描显式文件清单。格式化后检查差异并复跑,退出码为 0 且文件无改写。git diff --check、bash -n、API 清单/双语文档/链接检查通过;每个 C/C++ 函数不超过 50 个非空非注释行。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 - API 支持范围为 A2/A3,A2 尚未实机验证;A5(Ascend 950PR/Ascend 950DT)不支持本接口。 - 基于上游 master 创建独立分支,仅包含本样例和直接父主题导航;上游未提供 develop 分支。 - 远端 CodeCheck 未验证:已查询本 PR 流水线记录,当前 total_count=0,暂无 CodeCheck_precommit、CodeCheck_style Job 或 openLiBing 报告。后续需在本 PR 流水线页面复查上述 Job 及 openLiBing 最终报告;本地检查不替代远端结果。 See merge request: cann/runtime!5750 | 1 month ago | |
fix: Synchronize memory example handoffs Co-authored-by: aodebiao<18003961989@163.com> # message auto-generated for no-merge-commit merge: !5987 merge fix/synchronize-memory-example-reads-20261030 into master fix: Synchronize memory example handoffs Created-by: gxhgxh2475698 Commit-by: aodebiao Merged-by: cann-robot Description: # Pull Request ## Description Synchronize asynchronous device reads and writes before handing off or releasing memory in five examples. ## Motivation The memory-copy examples enqueue a read and immediately force-destroy the stream, which does not wait for pending tasks. In the IPC examples, the producer publishes the memory identifier before its write completes and the consumer sends the completion flag before its read completes. File handoffs do not synchronize device streams. The consumer also signals before closing its import, although the API requires importers to close before the exporter. ## Changes - Check aclrtSynchronizeStream after the read in three memory-copy examples. - Wait for the producer write before publishing the identifier, and for the consumer read before closing its import and sending the completion flag in both IPC examples. ## Change Type - [x] Bug Fix - [ ] New Feature - [ ] Code Style Update - [ ] Refactoring - [ ] Build Process or Auxiliary Tool Changes - [ ] Documentation Content Update ## Associated Issues Fixes #1290 ## How to Test - Checked source order before and after in all seven files against the kernel helpers and documented force-destroy and IPC close ordering. - git diff --check passed. CANN/NPU execution and compilation were not available. ## Checklist - [x] My code follows the project's code style - [x] I have self-tested the code - [ ] I have updated related documentation - [x] I used appropriate type labels in the title - [x] I have read the Contributing Guide and followed its regulations ## Additional Information The change is limited to examples; no Runtime implementation is changed. See merge request: cann/runtime!5987 | 22 days ago | |
fix: Synchronize memory example handoffs Co-authored-by: aodebiao<18003961989@163.com> # message auto-generated for no-merge-commit merge: !5987 merge fix/synchronize-memory-example-reads-20261030 into master fix: Synchronize memory example handoffs Created-by: gxhgxh2475698 Commit-by: aodebiao Merged-by: cann-robot Description: # Pull Request ## Description Synchronize asynchronous device reads and writes before handing off or releasing memory in five examples. ## Motivation The memory-copy examples enqueue a read and immediately force-destroy the stream, which does not wait for pending tasks. In the IPC examples, the producer publishes the memory identifier before its write completes and the consumer sends the completion flag before its read completes. File handoffs do not synchronize device streams. The consumer also signals before closing its import, although the API requires importers to close before the exporter. ## Changes - Check aclrtSynchronizeStream after the read in three memory-copy examples. - Wait for the producer write before publishing the identifier, and for the consumer read before closing its import and sending the completion flag in both IPC examples. ## Change Type - [x] Bug Fix - [ ] New Feature - [ ] Code Style Update - [ ] Refactoring - [ ] Build Process or Auxiliary Tool Changes - [ ] Documentation Content Update ## Associated Issues Fixes #1290 ## How to Test - Checked source order before and after in all seven files against the kernel helpers and documented force-destroy and IPC close ordering. - git diff --check passed. CANN/NPU execution and compilation were not available. ## Checklist - [x] My code follows the project's code style - [x] I have self-tested the code - [ ] I have updated related documentation - [x] I used appropriate type labels in the title - [x] I have read the Contributing Guide and followed its regulations ## Additional Information The change is limited to examples; no Runtime implementation is changed. See merge request: cann/runtime!5987 | 22 days ago | |
fix: 迁移 Ascend C 样例至 ASC 前端 Co-authored-by: xiao_hhh<guohui37@huawei.com> # message auto-generated for no-merge-commit merge: !5323 merge fix_ascendc_cmake into master fix: 迁移 Ascend C 样例至 ASC 前端 Created-by: xiao_hhh Commit-by: xiao_hhh Merged-by: cann-robot Description: # Pull Request ## 描述 将 40 个实际编译 Ascend C Kernel 的 Runtime example 从 legacy --cce-aicore-lang 构建链迁移到 ASC CMake 前端,统一使用 find_package(ASC)、ASC language 和显式 NPU 架构映射。 同时保留样例原有执行行为,复用公共 Kernel 源文件,补齐 FatBin 安装规则,并保留 D2D 同步拷贝场景所需的显式流同步。 ## 变更类型 - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 1. CANN 9.1.0、Ascend 910B3、Driver 25.5.0:40/40 Kernel target 编译通过,59/59 Device ELF 包含 ParamSummary,35/35 可执行单机样例通过。 2. CANN 9.2.0-beta.2、Ascend 910B3、Driver 25.5.0:40/40 Kernel target 编译通过,59/59 Device ELF 包含 ParamSummary;安装版可构建的 34 个单机样例全部通过,0_launch_kernel 的 simple/placeholder 模式均通过。 3. 使用当前源码 Runtime 补测 9.2-beta.2 安装包尚未提供的接口:binary_enumerate_functions、binary_get_function_count、launch_blocking 均编译并真机运行通过,ldd -r 无未定义符号。 4. pre-commit run --files <本次74个文件>、clang-format、OAT 和 git diff --check 均通过。 说明:跨服务器物理内存共享样例需要双机环境,未执行运行验证;9.2-beta.2 环境未安装匹配的 910B OPS 包,因此两个依赖 aclnnAdd 的 model 样例仅完成 ASC Kernel 与元数据验证,不将混用 9.1 OPS 的结果计为 9.2 通过。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已确认本次变更无需更新接口文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本 PR 仅包含 74 个本次 ASC 前端迁移及 pre-commit 修复涉及的 example/ 文件,不包含本地构建产物、验证日志或其他工作区文件。 See merge request: cann/runtime!5323 | 1 month ago | |
fix: 迁移 Ascend C 样例至 ASC 前端 Co-authored-by: xiao_hhh<guohui37@huawei.com> # message auto-generated for no-merge-commit merge: !5323 merge fix_ascendc_cmake into master fix: 迁移 Ascend C 样例至 ASC 前端 Created-by: xiao_hhh Commit-by: xiao_hhh Merged-by: cann-robot Description: # Pull Request ## 描述 将 40 个实际编译 Ascend C Kernel 的 Runtime example 从 legacy --cce-aicore-lang 构建链迁移到 ASC CMake 前端,统一使用 find_package(ASC)、ASC language 和显式 NPU 架构映射。 同时保留样例原有执行行为,复用公共 Kernel 源文件,补齐 FatBin 安装规则,并保留 D2D 同步拷贝场景所需的显式流同步。 ## 变更类型 - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 1. CANN 9.1.0、Ascend 910B3、Driver 25.5.0:40/40 Kernel target 编译通过,59/59 Device ELF 包含 ParamSummary,35/35 可执行单机样例通过。 2. CANN 9.2.0-beta.2、Ascend 910B3、Driver 25.5.0:40/40 Kernel target 编译通过,59/59 Device ELF 包含 ParamSummary;安装版可构建的 34 个单机样例全部通过,0_launch_kernel 的 simple/placeholder 模式均通过。 3. 使用当前源码 Runtime 补测 9.2-beta.2 安装包尚未提供的接口:binary_enumerate_functions、binary_get_function_count、launch_blocking 均编译并真机运行通过,ldd -r 无未定义符号。 4. pre-commit run --files <本次74个文件>、clang-format、OAT 和 git diff --check 均通过。 说明:跨服务器物理内存共享样例需要双机环境,未执行运行验证;9.2-beta.2 环境未安装匹配的 910B OPS 包,因此两个依赖 aclnnAdd 的 model 样例仅完成 ASC Kernel 与元数据验证,不将混用 9.1 OPS 的结果计为 9.2 通过。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已确认本次变更无需更新接口文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本 PR 仅包含 74 个本次 ASC 前端迁移及 pre-commit 修复涉及的 example/ 文件,不包含本地构建产物、验证日志或其他工作区文件。 See merge request: cann/runtime!5323 | 1 month ago | |
fix: 迁移 Ascend C 样例至 ASC 前端 Co-authored-by: xiao_hhh<guohui37@huawei.com> # message auto-generated for no-merge-commit merge: !5323 merge fix_ascendc_cmake into master fix: 迁移 Ascend C 样例至 ASC 前端 Created-by: xiao_hhh Commit-by: xiao_hhh Merged-by: cann-robot Description: # Pull Request ## 描述 将 40 个实际编译 Ascend C Kernel 的 Runtime example 从 legacy --cce-aicore-lang 构建链迁移到 ASC CMake 前端,统一使用 find_package(ASC)、ASC language 和显式 NPU 架构映射。 同时保留样例原有执行行为,复用公共 Kernel 源文件,补齐 FatBin 安装规则,并保留 D2D 同步拷贝场景所需的显式流同步。 ## 变更类型 - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 1. CANN 9.1.0、Ascend 910B3、Driver 25.5.0:40/40 Kernel target 编译通过,59/59 Device ELF 包含 ParamSummary,35/35 可执行单机样例通过。 2. CANN 9.2.0-beta.2、Ascend 910B3、Driver 25.5.0:40/40 Kernel target 编译通过,59/59 Device ELF 包含 ParamSummary;安装版可构建的 34 个单机样例全部通过,0_launch_kernel 的 simple/placeholder 模式均通过。 3. 使用当前源码 Runtime 补测 9.2-beta.2 安装包尚未提供的接口:binary_enumerate_functions、binary_get_function_count、launch_blocking 均编译并真机运行通过,ldd -r 无未定义符号。 4. pre-commit run --files <本次74个文件>、clang-format、OAT 和 git diff --check 均通过。 说明:跨服务器物理内存共享样例需要双机环境,未执行运行验证;9.2-beta.2 环境未安装匹配的 910B OPS 包,因此两个依赖 aclnnAdd 的 model 样例仅完成 ASC Kernel 与元数据验证,不将混用 9.1 OPS 的结果计为 9.2 通过。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已确认本次变更无需更新接口文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本 PR 仅包含 74 个本次 ASC 前端迁移及 pre-commit 修复涉及的 example/ 文件,不包含本地构建产物、验证日志或其他工作区文件。 See merge request: cann/runtime!5323 | 1 month ago | |
fix: Synchronize memory example handoffs Co-authored-by: aodebiao<18003961989@163.com> # message auto-generated for no-merge-commit merge: !5987 merge fix/synchronize-memory-example-reads-20261030 into master fix: Synchronize memory example handoffs Created-by: gxhgxh2475698 Commit-by: aodebiao Merged-by: cann-robot Description: # Pull Request ## Description Synchronize asynchronous device reads and writes before handing off or releasing memory in five examples. ## Motivation The memory-copy examples enqueue a read and immediately force-destroy the stream, which does not wait for pending tasks. In the IPC examples, the producer publishes the memory identifier before its write completes and the consumer sends the completion flag before its read completes. File handoffs do not synchronize device streams. The consumer also signals before closing its import, although the API requires importers to close before the exporter. ## Changes - Check aclrtSynchronizeStream after the read in three memory-copy examples. - Wait for the producer write before publishing the identifier, and for the consumer read before closing its import and sending the completion flag in both IPC examples. ## Change Type - [x] Bug Fix - [ ] New Feature - [ ] Code Style Update - [ ] Refactoring - [ ] Build Process or Auxiliary Tool Changes - [ ] Documentation Content Update ## Associated Issues Fixes #1290 ## How to Test - Checked source order before and after in all seven files against the kernel helpers and documented force-destroy and IPC close ordering. - git diff --check passed. CANN/NPU execution and compilation were not available. ## Checklist - [x] My code follows the project's code style - [x] I have self-tested the code - [ ] I have updated related documentation - [x] I used appropriate type labels in the title - [x] I have read the Contributing Guide and followed its regulations ## Additional Information The change is limited to examples; no Runtime implementation is changed. See merge request: cann/runtime!5987 | 22 days ago | |
fix: 迁移 Ascend C 样例至 ASC 前端 Co-authored-by: xiao_hhh<guohui37@huawei.com> # message auto-generated for no-merge-commit merge: !5323 merge fix_ascendc_cmake into master fix: 迁移 Ascend C 样例至 ASC 前端 Created-by: xiao_hhh Commit-by: xiao_hhh Merged-by: cann-robot Description: # Pull Request ## 描述 将 40 个实际编译 Ascend C Kernel 的 Runtime example 从 legacy --cce-aicore-lang 构建链迁移到 ASC CMake 前端,统一使用 find_package(ASC)、ASC language 和显式 NPU 架构映射。 同时保留样例原有执行行为,复用公共 Kernel 源文件,补齐 FatBin 安装规则,并保留 D2D 同步拷贝场景所需的显式流同步。 ## 变更类型 - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 1. CANN 9.1.0、Ascend 910B3、Driver 25.5.0:40/40 Kernel target 编译通过,59/59 Device ELF 包含 ParamSummary,35/35 可执行单机样例通过。 2. CANN 9.2.0-beta.2、Ascend 910B3、Driver 25.5.0:40/40 Kernel target 编译通过,59/59 Device ELF 包含 ParamSummary;安装版可构建的 34 个单机样例全部通过,0_launch_kernel 的 simple/placeholder 模式均通过。 3. 使用当前源码 Runtime 补测 9.2-beta.2 安装包尚未提供的接口:binary_enumerate_functions、binary_get_function_count、launch_blocking 均编译并真机运行通过,ldd -r 无未定义符号。 4. pre-commit run --files <本次74个文件>、clang-format、OAT 和 git diff --check 均通过。 说明:跨服务器物理内存共享样例需要双机环境,未执行运行验证;9.2-beta.2 环境未安装匹配的 910B OPS 包,因此两个依赖 aclnnAdd 的 model 样例仅完成 ASC Kernel 与元数据验证,不将混用 9.1 OPS 的结果计为 9.2 通过。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已确认本次变更无需更新接口文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本 PR 仅包含 74 个本次 ASC 前端迁移及 pre-commit 修复涉及的 example/ 文件,不包含本地构建产物、验证日志或其他工作区文件。 See merge request: cann/runtime!5323 | 1 month ago | |
fix: 迁移 Ascend C 样例至 ASC 前端 Co-authored-by: xiao_hhh<guohui37@huawei.com> # message auto-generated for no-merge-commit merge: !5323 merge fix_ascendc_cmake into master fix: 迁移 Ascend C 样例至 ASC 前端 Created-by: xiao_hhh Commit-by: xiao_hhh Merged-by: cann-robot Description: # Pull Request ## 描述 将 40 个实际编译 Ascend C Kernel 的 Runtime example 从 legacy --cce-aicore-lang 构建链迁移到 ASC CMake 前端,统一使用 find_package(ASC)、ASC language 和显式 NPU 架构映射。 同时保留样例原有执行行为,复用公共 Kernel 源文件,补齐 FatBin 安装规则,并保留 D2D 同步拷贝场景所需的显式流同步。 ## 变更类型 - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 1. CANN 9.1.0、Ascend 910B3、Driver 25.5.0:40/40 Kernel target 编译通过,59/59 Device ELF 包含 ParamSummary,35/35 可执行单机样例通过。 2. CANN 9.2.0-beta.2、Ascend 910B3、Driver 25.5.0:40/40 Kernel target 编译通过,59/59 Device ELF 包含 ParamSummary;安装版可构建的 34 个单机样例全部通过,0_launch_kernel 的 simple/placeholder 模式均通过。 3. 使用当前源码 Runtime 补测 9.2-beta.2 安装包尚未提供的接口:binary_enumerate_functions、binary_get_function_count、launch_blocking 均编译并真机运行通过,ldd -r 无未定义符号。 4. pre-commit run --files <本次74个文件>、clang-format、OAT 和 git diff --check 均通过。 说明:跨服务器物理内存共享样例需要双机环境,未执行运行验证;9.2-beta.2 环境未安装匹配的 910B OPS 包,因此两个依赖 aclnnAdd 的 model 样例仅完成 ASC Kernel 与元数据验证,不将混用 9.1 OPS 的结果计为 9.2 通过。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已确认本次变更无需更新接口文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本 PR 仅包含 74 个本次 ASC 前端迁移及 pre-commit 修复涉及的 example/ 文件,不包含本地构建产物、验证日志或其他工作区文件。 See merge request: cann/runtime!5323 | 1 month ago | |
【PR】: feat:remove all exclude Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !4195 merge master_precommit into master 【PR】: feat:remove all exclude Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 pre-commit example scripts docs,并把这些目录pre-commit排除项给去掉 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 pre-commit readme docs无新增文件 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!4195 | 3 months ago | |
feat: 新增组件内存排查样例(#1200) Co-authored-by: 2403_89963296<2540257541@qq.com> # message auto-generated for no-merge-commit merge: !5750 merge feat/component-memory-triage-20261021 into master feat: 新增组件内存排查样例(#1200) Created-by: 2403_89963296 Commit-by: 2403_89963296 Merged-by: cann-robot Description: # Pull Request ## 描述 排查组件内存占用时,需要根据当前占用与历史峰值确定优先检查的组件。本 PR 新增 19_component_memory_triage,使用 aclrtGetMemUsageInfo 获取单 Device 组件快照,校验统计数据,并按可配置的每组件阈值输出 CURRENT_PRESSURE、HISTORICAL_PEAK 或 WITHIN_BUDGET。 查询数组填满时扩容重查;达到样例保护上限仍填满则失败,避免把截断结果当作完整报告。默认阈值为当前 64 MiB、峰值 128 MiB。新增源码、运行入口、双语说明及直接父主题导航,共 7 个文件。组件统计不用于推算剩余可分配内存或精确业务分配增量。 ## 变更类型 - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue Closes #1200 https://gitcode.com/cann/runtime/issues/1200 Issue 负责人:Yanxijiu(2403_89963296)。合并后关闭关联 Issue。 ## 如何测试 1. 在受支持的 A3 Ascend910_9362、CANN 9.3.0 环境,设置 ASCEND_INSTALL_PATH 为实际 CANN 安装目录,进入样例目录执行: bash bash run.sh bash run.sh 1 128 bash run.sh 64 1 三次构建运行均成功,分别得到 WITHIN_BUDGET、CURRENT_PRESSURE、HISTORICAL_PEAK。实测组件当前占用为 29458432 Byte、峰值为 29470720 Byte;已核对组件排序、当前占用不大于峰值及各判断与返回统计一致。实际运行结果会随环境变化。 2. 验证参数 0、-1、1x、溢出 MiB、非法第二阈值和多余参数均被拒绝;bash run.sh 0 将程序失败传播为非零退出码;缺失 ASCEND_INSTALL_PATH 时脚本失败。失败运行未输出成功标记。 3. 对本任务全部 7 个文件执行仓库 Pre-commit(clang-format、OAT),使用 PRE_COMMIT_FROM_REF=HEAD 确保实际扫描显式文件清单。格式化后检查差异并复跑,退出码为 0 且文件无改写。git diff --check、bash -n、API 清单/双语文档/链接检查通过;每个 C/C++ 函数不超过 50 个非空非注释行。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 - API 支持范围为 A2/A3,A2 尚未实机验证;A5(Ascend 950PR/Ascend 950DT)不支持本接口。 - 基于上游 master 创建独立分支,仅包含本样例和直接父主题导航;上游未提供 develop 分支。 - 远端 CodeCheck 未验证:已查询本 PR 流水线记录,当前 total_count=0,暂无 CodeCheck_precommit、CodeCheck_style Job 或 openLiBing 报告。后续需在本 PR 流水线页面复查上述 Job 及 openLiBing 最终报告;本地检查不替代远端结果。 See merge request: cann/runtime!5750 | 1 month ago | |
feat: 新增组件内存排查样例(#1200) Co-authored-by: 2403_89963296<2540257541@qq.com> # message auto-generated for no-merge-commit merge: !5750 merge feat/component-memory-triage-20261021 into master feat: 新增组件内存排查样例(#1200) Created-by: 2403_89963296 Commit-by: 2403_89963296 Merged-by: cann-robot Description: # Pull Request ## 描述 排查组件内存占用时,需要根据当前占用与历史峰值确定优先检查的组件。本 PR 新增 19_component_memory_triage,使用 aclrtGetMemUsageInfo 获取单 Device 组件快照,校验统计数据,并按可配置的每组件阈值输出 CURRENT_PRESSURE、HISTORICAL_PEAK 或 WITHIN_BUDGET。 查询数组填满时扩容重查;达到样例保护上限仍填满则失败,避免把截断结果当作完整报告。默认阈值为当前 64 MiB、峰值 128 MiB。新增源码、运行入口、双语说明及直接父主题导航,共 7 个文件。组件统计不用于推算剩余可分配内存或精确业务分配增量。 ## 变更类型 - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue Closes #1200 https://gitcode.com/cann/runtime/issues/1200 Issue 负责人:Yanxijiu(2403_89963296)。合并后关闭关联 Issue。 ## 如何测试 1. 在受支持的 A3 Ascend910_9362、CANN 9.3.0 环境,设置 ASCEND_INSTALL_PATH 为实际 CANN 安装目录,进入样例目录执行: bash bash run.sh bash run.sh 1 128 bash run.sh 64 1 三次构建运行均成功,分别得到 WITHIN_BUDGET、CURRENT_PRESSURE、HISTORICAL_PEAK。实测组件当前占用为 29458432 Byte、峰值为 29470720 Byte;已核对组件排序、当前占用不大于峰值及各判断与返回统计一致。实际运行结果会随环境变化。 2. 验证参数 0、-1、1x、溢出 MiB、非法第二阈值和多余参数均被拒绝;bash run.sh 0 将程序失败传播为非零退出码;缺失 ASCEND_INSTALL_PATH 时脚本失败。失败运行未输出成功标记。 3. 对本任务全部 7 个文件执行仓库 Pre-commit(clang-format、OAT),使用 PRE_COMMIT_FROM_REF=HEAD 确保实际扫描显式文件清单。格式化后检查差异并复跑,退出码为 0 且文件无改写。git diff --check、bash -n、API 清单/双语文档/链接检查通过;每个 C/C++ 函数不超过 50 个非空非注释行。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 - API 支持范围为 A2/A3,A2 尚未实机验证;A5(Ascend 950PR/Ascend 950DT)不支持本接口。 - 基于上游 master 创建独立分支,仅包含本样例和直接父主题导航;上游未提供 develop 分支。 - 远端 CodeCheck 未验证:已查询本 PR 流水线记录,当前 total_count=0,暂无 CodeCheck_precommit、CodeCheck_style Job 或 openLiBing 报告。后续需在本 PR 流水线页面复查上述 Job 及 openLiBing 最终报告;本地检查不替代远端结果。 See merge request: cann/runtime!5750 | 1 month ago | |
【PR】: feat:remove all exclude Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !4195 merge master_precommit into master 【PR】: feat:remove all exclude Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 pre-commit example scripts docs,并把这些目录pre-commit排除项给去掉 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 pre-commit readme docs无新增文件 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!4195 | 3 months ago | |
【PR】: feat:remove all exclude Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !4195 merge master_precommit into master 【PR】: feat:remove all exclude Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 pre-commit example scripts docs,并把这些目录pre-commit排除项给去掉 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 pre-commit readme docs无新增文件 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!4195 | 3 months ago | |
【PR】: feat:remove all exclude Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !4195 merge master_precommit into master 【PR】: feat:remove all exclude Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 pre-commit example scripts docs,并把这些目录pre-commit排除项给去掉 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 pre-commit readme docs无新增文件 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!4195 | 3 months ago |
memory
This directory focuses on Host/Device data transfer, shared memory, IPC, and multi-stream memory synchronization capabilities.
Sample List
- 0_h2h_memory_copy: Demonstrates Host to Host memory copy.
- 1_h2d_sync_memory_copy: Demonstrates Host to Device synchronous copy.
- 2_h2d_async_memory_copy: Demonstrates Host to Device asynchronous copy.
- 3_d2h_sync_memory_copy: Demonstrates Device to Host synchronous copy.
- 4_d2h_async_memory_copy: Demonstrates Device to Host asynchronous copy.
- 5_d2d_sync_memory_copy: Demonstrates Device to Device synchronous copy.
- 6_d2d_async_memory_copy: Demonstrates Device to Device asynchronous copy.
- 7_physical_memory_sharing_withpid: Demonstrates physical memory sharing with specified PID.
- 8_physical_memory_sharing_withoutpid: Demonstrates physical memory sharing without specified PID.
- 9_multistream_sync_memory: Demonstrates memory synchronization in multi-Stream scenarios.
- 10_ipc_memory_withpid: Demonstrates IPC memory sharing with specified PID.
- 11_ipc_memory_withoutpid: Demonstrates IPC memory sharing without specified PID.
- 12_cross_server_physical_memory_sharing_withoutpid: Demonstrates cross-server physical memory sharing.
- 13_memcpy_descriptor: Demonstrates descriptor-based asynchronous copying within one device and verifies the result.
- 14_reusable_data_buffer: Demonstrates reusing one DataBuffer for data with different valid lengths and verifies the address, size, and content.
- 15_batch_tensor_round_trip: Demonstrates Host/Device round-trip transfers and element-wise verification for the same small tensors in four batch-copy modes.
- 16_guarded_result_slice: Demonstrates an asynchronous result-slice update through indirect base addresses and offsets, with guard-region verification.
- 17_configured_allocation: Demonstrates allocation tagged by application module, memory identification, single-device round-trip transfers, synchronized release, and data verification.
- 19_component_memory_triage: Reads a single-device component memory snapshot, validates current and peak usage, and prioritizes investigation using thresholds.