| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
【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 | 22 天前 | |
fix(example): 修复 README 失效链接(#667) Co-authored-by: nevermore_t<tianjingxuan2@huawei.com> # message auto-generated for no-merge-commit merge: !3220 merge fix/issue-667-broken-links into master fix(example): 修复 README 失效链接(#667) Created-by: nevermore_t Commit-by: nevermore_t Merged-by: cann-robot Description: ## 描述 修复 issue #667 报告的 README 失效链接。 PR !1608 删除了 2_cntnotify 和 snapshot 两个样例目录(A2/A3 不支持 cntnotify 接口,snapshot 为试验接口后续 950 已不支持),但未同步清理父目录 README 中的引用链接,导致死链。 本次变更: - 删除 notify/README.md 中指向已删除的 2_cntnotify 的链接 - 删除 fault_tolerant/README.md 中指向已删除的 snapshot 的链接 - 统一 11 个 README 的 section title:"可先参考"→"可选参考"(更符合作为标题的语义,英文版对应 References) ## 变更类型 - [x] 📝 文档内容更新 ## 关联的Issue #667 ## 如何测试 1. 确认 example/2_advanced_features/notify/ 下不再有 2_cntnotify 目录引用 2. 确认 example/4_reliability/ 下不再有 snapshot 目录引用 3. 确认所有保留的链接指向的目录存在 4. grep -r "可先参考" example/ 返回空(已全部替换为"可选参考") ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定 See merge request: cann/runtime!3220 | 2 个月前 | |
【PR】: 新增 Host 内存零拷贝 Runtime 样例 Co-authored-by: LiuPeiling<1245275864@qq.com> # message auto-generated for no-merge-commit merge: !4316 merge feature/runtime7-simple-zero-copy into master 【PR】: 新增 Host 内存零拷贝 Runtime 样例 Created-by: freedom178 Commit-by: LiuPeiling Merged-by: cann-robot Description: # Pull Request ## 描述 新增 Host 内存注册与映射访问样例 0_simple_zero_copy。 本样例面向单个 Atlas A2 A3 A5 Device,申请三块 Host 锁页内存并注册为 Device 可映射内存,将映射地址传入 Ascend C Kernel,完成 16384 个 FP16 向量加法并在 Host 侧校验结果。 本次新增覆盖 3 个 CANN Runtime API: 本样例新增覆盖以下 3 个 CANN Runtime API: - aclrtHostRegisterV2 - 将一段已经分配的 Host 内存注册到 Runtime。 - 本样例使用 ACL_HOST_REG_MAPPED 标志,使该内存可以映射到 Device 地址空间。 - 注册期间 Host 内存不能提前释放。 - aclrtHostGetDevicePointer - 获取已注册 Host 内存对应的 Device 映射地址。 - 该接口不会分配 Device 内存,也不会复制数据。 - 本样例将返回的映射地址作为 Kernel 参数,使 NPU 直接读取输入并写入输出。 - aclrtHostUnregister - 解除 Host 内存在 Runtime 中的注册和 Device 映射关系。 - 调用后原 Device 映射地址不再允许 Kernel 使用。 - 本样例在 Kernel 执行和结果校验完成后调用该接口,再通过 aclrtFreeHost 释放 Host 内存。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [ ] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [ ] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!4316 | 19 天前 | |
【PR】: fix_0_uvm_allocate Co-authored-by: chenyang<2082464740@qq.com> # message auto-generated for no-merge-commit merge: !4300 merge ex_uvm into master 【PR】: fix_0_uvm_allocate Created-by: weixin_51634168 Commit-by: weixin_51634168;chenyang Merged-by: cann-robot Description: 已根据 [issue #826](https://gitcode.com/cann/runtime/issues/826) 完成 0_uvm_allocate 样例的完善:在不支持 UVM 的 SOC(如 Ascend 910 系列)上运行时,样例打印提示并优雅返回,不再直接 exit 255。实现沿用了仓库已有的 [SKIP] 跳过模式(参考 1_basic_features/stream/3_stream_config_query)。 改动内容: - main.cpp - 新增 kSampleSkipped 结果码,区分失败与跳过两种语义。 - AllocateKernelBuffers(main.cpp:66):捕获 aclrtMemAllocManaged 返回的 ACL_ERROR_RT_FEATURE_NOT_SUPPORT (207000),通过 aclrtGetSocName() 取当前 SOC 名并打印 [SKIP] 提示;相比硬编码 SOC 名单,按能力错误码判断可同时覆盖 910、950PR/DT 及未来不支持 UVM 的平台。 - RunKernelLaunchSample(main.cpp:190):透传跳过码,资源正常清理后以退出码 0 结束;清理失败仍按真实错误返回 -1。 - run.sh:程序输出经 tee 写入 output_msg.txt;退出码非 0 时报 [FAILURE],检测到 [SKIP] 标记则打印 [SUCCESS] ... skipped 并以 0 结束、跳过 md5sum 和结果校验,成功路径行为不变。 - README.md / README_en.md:产品支持表下补充运行时 SOC 检查与 207000 跳过行为说明,并在示例输出中增加跳过场景的输出示例。 text [INFO] [SKIP] uvm_allocate sample skipped: the current SOC (Ascend910A) does not support UVM, aclrtMemAllocManaged returned error code 207000. [SUCCESS] uvm_allocate sample skipped because the current SOC does not support UVM. See merge request: cann/runtime!4300 | 20 天前 | |
fix(example): 修复 README 失效链接(#667) Co-authored-by: nevermore_t<tianjingxuan2@huawei.com> # message auto-generated for no-merge-commit merge: !3220 merge fix/issue-667-broken-links into master fix(example): 修复 README 失效链接(#667) Created-by: nevermore_t Commit-by: nevermore_t Merged-by: cann-robot Description: ## 描述 修复 issue #667 报告的 README 失效链接。 PR !1608 删除了 2_cntnotify 和 snapshot 两个样例目录(A2/A3 不支持 cntnotify 接口,snapshot 为试验接口后续 950 已不支持),但未同步清理父目录 README 中的引用链接,导致死链。 本次变更: - 删除 notify/README.md 中指向已删除的 2_cntnotify 的链接 - 删除 fault_tolerant/README.md 中指向已删除的 snapshot 的链接 - 统一 11 个 README 的 section title:"可先参考"→"可选参考"(更符合作为标题的语义,英文版对应 References) ## 变更类型 - [x] 📝 文档内容更新 ## 关联的Issue #667 ## 如何测试 1. 确认 example/2_advanced_features/notify/ 下不再有 2_cntnotify 目录引用 2. 确认 example/4_reliability/ 下不再有 snapshot 目录引用 3. 确认所有保留的链接指向的目录存在 4. grep -r "可先参考" example/ 返回空(已全部替换为"可选参考") ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定 See merge request: cann/runtime!3220 | 2 个月前 | |
优化example示例中 产品支持情况 描述 Co-authored-by: qiang_zq<qiang.zhangqiang@huawei.com> # message auto-generated for no-merge-commit merge: !1276 merge sample into master 优化example示例中 产品支持情况 描述 Created-by: qiang_zq Commit-by: qiang_zq Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 1、补充部分新增example示例 readme 缺少的“产品支持情况”描述 2、历史example示例 readme 中“产品支持情况”与docs中API描述不一致 3、优化example样例执行步骤,run.sh中编译完成后自动执行,将原来编译+运行 2步操作 合为一步 4、目录 README 补全: 为 device、stream、event、memory、kernel、callback、model_ri、notify、tdt_buffer、tdt_channel、tdt_queue、built_in_task 等目录新增了 README.md,改善了导航体验 5、链接路径修正: 修正了嵌套目录的相对路径(从 ../../README.md 改为 ../../../README.md) 代码审查报告 https://gitcode.com/cann/runtime/pull/1276?ref=&did=65e24693459e9d96f1d4ad02bef022d0968fba55#tid-166839878 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/runtime/issues/299 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> /example/0_quickstart/0_hello_cann$ bash run.sh Configuring CMake... -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/0_hello_cann/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/0_hello_cann/build/main Run the sample: ./build/main ACL init successfully Set device 0 successfully Create stream successfully Input vectors: self: [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] other: [0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0] alpha: 1.0 Create output aclDataBuffer successfully, buffer addr = 0x12c0c0016000 Get workspace size successfully, workspace size = 0 [Warning]: tiling struct [ReduceOpTilingDataV2] is conflict with one in file kl_div_v2.cc, line 41 [Warning]: tiling struct [RepeatInterleaveGradTilingData] is conflict with one in file repeat_interleave_grad_tiling.h, line 21 [Warning]: tiling struct [IndexFillTilingData] is conflict with one in file index_fill_tiling.h, line 21 [Warning]: tiling struct [MapIndexTilingData] is conflict with one in file map_index_tiling_arch35.h, line 23 [Warning]: tiling struct [MaskedSelectV3TilingData] is conflict with one in file masked_select_v3_tiling.h, line 27 [Warning]: tiling struct [MaskedSelectV3TilingData] is conflict with one in file masked_select_v3_tiling.h, line 27 [Warning]: tiling struct [ScatterPaKvCacheTilingData] is conflict with one in file scatter_pa_kv_cache_tiling.h, line 35 [Warning]: tiling struct [ScatterPaKvCacheTilingData] is conflict with one in file scatter_pa_kv_cache_tiling.h, line 35 [Warning]: tiling struct [TopKTopPSampleTilingData] is conflict with one in file top_k_top_p_sample_tiling.h, line 26 [Warning]: tiling struct [AvgPool3dGradTilingBlockParam] is conflict with one in file avg_pool_3d_grad_tiling.h, line 99 [Warning]: tiling struct [AvgPool3dGradTilingParam] is conflict with one in file avg_pool_3d_grad_tiling.h, line 125 [Warning]: tiling struct [FusedCrossEntropyLossWithMaxSumTilingData] is conflict with one in file fused_cross_entropy_loss_with_max_sum_tiling.h, line 27 [Warning]: tiling struct [TilingDataBackgroundReplace] is conflict with one in file background_replace_tiling.h, line 22 [Warning]: tiling struct [TilingDataBlendImages] is conflict with one in file blend_images_custom_tiling.h, line 24 Launch aclnnAdd successfully Synchronize stream successfully Vector addition result: result[0] = 1.5 (expected: 1.5) result[1] = 3.0 (expected: 3.0) result[2] = 4.5 (expected: 4.5) result[3] = 6.0 (expected: 6.0) result[4] = 7.5 (expected: 7.5) result[5] = 9.0 (expected: 9.0) result[6] = 10.5 (expected: 10.5) result[7] = 12.0 (expected: 12.0) Free device memory successfully Destroy stream successfully Reset device successfully ACL finalize successfully Sample run successfully! /example/0_quickstart/1_error_handling$ bash run.sh Configuring CMake... -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/1_error_handling/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/1_error_handling/build/main Run the sample: ./build/main [INFO] ACL init and set device successfully [INFO] Current run mode: ACL_HOST [INFO] Triggering an expected invalid-parameter error with aclrtGetRunMode(nullptr) [ERROR] Diagnostics: ret=100000, peekErr=0, lastErr=0, recentErrMsg=[PID: 2238268] 2026-03-30-14:54:54.405.703 Invalid_Argument_Null_Pointer(EH0002): Argument [runMode] must not be null. Solution: Try again with a correct pointer argument. [WARN] aclrtGetErrorVerbose(0) returned error code 207000 [INFO] After diagnostics are consumed once: peekErr=207000, lastErr=207000, recentErrMsg=<null> [INFO] ACL finalize successfully ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> example/0_quickstart/1_error_handling/README.md example/1_basic_features/device/0_device_normal/README.md .... example/*/README.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/runtime!1276 | 5 个月前 | |
【PR】: Add English md files Co-authored-by: ycm0028<yechengmei@huawei.com> Co-authored-by: gitcode-bot<noreply@gitcode.com> # message auto-generated for no-merge-commit merge: !2990 merge master into master 【PR】: Add English md files Created-by: ycm0028 Commit-by: ycm0028;gitcode-bot Merged-by: cann-robot Description: # Pull Request ## 描述 Add English md files ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [.x] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 The English md files have been checked. ## 核对清单 <!-- [x] 表示选中 --> - [ ] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测 - [ x] 我已更新了相关的文档 - [ ] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!2990 | 2 个月前 |
3_memory_advanced
本章节聚焦高级内存管理主题,强调更细粒度的内存控制、自定义分配与流序内存池能力。
样例列表
- allocator:自定义分配器描述符、注册与回调执行。
相关主题
- cache_maintenance:缓存维护与一致性控制。
- host_register:Host 内存注册与高性能传输。
- managed_memory:托管内存与更高级内存抽象。
- memory_pool:流序内存池的创建、属性配置和异步分配释放。