| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
优化example目录结构易用性及补充用例 Co-authored-by: qiang_zq<qiang.zhangqiang@huawei.com> # message auto-generated for no-merge-commit merge: !1163 merge sample into master 优化example目录结构易用性及补充用例 Created-by: qiang_zq Commit-by: qiang_zq Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 1、example 目录结构优化,按学习阶段重新组织目录结构(0_quickstart ~ 6_scenarios) 2、补充部分API的example用例 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/runtime/issues/284 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 部分用例执行过程 source /home/developer/Ascend/cann/set_env.sh && export SOC_VERSION=ascend910b3 && export ASCENDC_CMAKE_DIR=/home/developer/Ascend/cann/aarch64-linux/tikcpp/ascendc_kernel_cmake && export ASCEND_INSTALL_PATH=/home/developer/Ascend/cann && cd /mnt/workspace/gitCode/qiang_zq/runtime/example/3_memory_advanced/allocator/0_custom_allocator && rm -rf build && dos2unix run.sh 2>/dev/null || sed -i 's/\\r$//' run.sh && 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/3_memory_advanced/allocator/0_custom_allocator/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/3_memory_advanced/allocator/0_custom_allocator/build/main Run the sample: ./build/main ./build/main [INFO] CustomAlloc size=256 [INFO] CustomAllocAdvise size=128 [INFO] CustomAlloc size=128 [INFO] CustomFree invoked [INFO] CustomFree invoked [INFO] Allocator desc queried: descOut=0xaaaabd6a3780 allocCount=2 freeCount=2 用例执行报告 0_quickstart (3/3) ✅ ✅ 0_hello_cann ✅ 1_error_handling ✅ 2_system_info 1_basic_features (23/23) ✅ ✅ device/0_device_normal ✅ device/1_device_multi_thread ✅ device/2_device_P2P ✅ event/0_event_status ✅ event/1_event_timestamp ✅ memory/0_h2h_memory_copy ✅ memory/10_ipc_memory_withpid ✅ memory/11_ipc_memory_withoutpid ✅ memory/1_h2d_sync_memory_copy ✅ memory/2_h2d_async_memory_copy ✅ memory/3_d2h_sync_memory_copy ✅ memory/4_d2h_async_memory_copy ✅ memory/5_d2d_sync_memory_copy ✅ memory/6_d2d_async_memory_copy ✅ memory/7_physical_memory_sharing_withpid ✅ memory/8_physical_memory_sharing_withoutpid ✅ memory/9_multistream_sync_memory ✅ stream/0_simple_stream ✅ stream/1_stream_with_failure_mode ✅ stream/2_multi_stream 2_advanced_features (17/17) ✅ ✅ built_in_task/0_reduce_task ✅ built_in_task/1_random_num_task ✅ callback/0_simple_callback ✅ callback/1_callback_hostfunc ✅ callback/2_callback_exception ✅ group/0_compute_group ✅ kernel/0_launch_kernel ✅ kernel/1_launch_kernel_with_reslimit ✅ label/0_simple_label ✅ model_ri/0_simple_model ✅ model_ri/1_model_update ✅ model_ri/2_model_switch ✅ notify/0_ipc_notify_withpid ✅ notify/1_ipc_notify_withoutpid ✅ notify/2_cntnotify ✅ tdt_buffer/0_shared_buffer ✅ tdt_channel/0_simple_channel ✅ tdt_channel/1_channel_capacity ✅ tdt_queue/0_simple_queue ✅ tdt_queue/1_queue_route ✅ tdt_queue/2_queue_grant_attach 3_memory_advanced (1/1) ✅ ✅ allocator/0_custom_allocator 4_reliability (2/2) ✅ ✅ overflow_detection/0_overflow_detection ✅ snapshot/0_snapshot_management 5_performance (6/6) ✅ ✅ adump/0_adump_args ✅ adump/1_adump_callback ✅ adump/2_model_dump_config ✅ profiling/0_create_config ✅ profiling/1_msproftx ✅ profiling/2_subscribe_model ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> docs/02_dev_guide/初始化.md example/*.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/runtime!1163 | 4 个月前 | |
【PR】:优化 Runtime 样例可执行性与文档一致性 Co-authored-by: shi-qiong<shiqiong3@huawei.com> # message auto-generated for no-merge-commit merge: !3236 merge feature/runtime-example-usability-fixes into master 【PR】:优化 Runtime 样例可执行性与文档一致性 Created-by: shi-qiong Commit-by: shi-qiong Merged-by: cann-robot Description: # Pull Request ## 描述 本次 PR 主要优化 Runtime example 的文档一致性、运行步骤完整性和自动化执行友好性,降低样例运行和评估过程中的误判风险。 | 编号 | 级别 | 描述 | 建议 | |------|------|------|------| | 1 | 严重 | 5_performance/profiling/3_mstx_with_domain/README.md 疑似从 toolkit 仓错误搬运:引用 sample_run.sh(实际为 run.sh)、安装路径指向 /usr/local/Ascend/ascend-toolkit/8.x.x/tools/mstx/samples、表格链接 ./mstx_with_domain 子目录不存在(实际为同级 cpp 文件),与 CMakeLists.txt+run.sh 工程结构不符 | 按本仓实际工程结构重写该 README,对齐全仓统一的"编译运行"小节格式 | | 2 | 一般 | 4 处失败链接:4_reliability/README.md→snapshot/(目录缺失)、4_reliability/fault_tolerant/README.md→../snapshot/、2_advanced_features/notify/README.md→2_cntnotify(目录缺失)、3_mstx_with_domain 表格链接 | 删除失效链接,或补齐对应目录/用例 | | 3 | 一般 | 31 个用例 README 环境配置步骤不完整:2/3/4/5 模块普遍改用手动 export SOC_VERSION,未提及 set_sample_env.sh,与 1_basic_features(全部使用 set_sample_env.sh)方案并存,文档体系不统一 | 全仓统一环境配置方式,推荐统一采用 source set_sample_env.sh 并在所有用例 README 写全 4 步骤 | | 4 | 一般 | 设备复位接口不一致:ipcevent/0_ipcevent、ipcevent/1_ipcevent_multi_device 使用 aclrtResetDevice,其余 50 个用例统一使用 aclrtResetDeviceForce | 统一为 aclrtResetDeviceForce 或在 README 注明差异原因 | | 5 | 一般 | 10 个 memory 用例的示例输出夹带伪版本号 CANN Version: 1.0.0, TimeStamp: ...,与真实 CANN 版本(9.1.0)不符,且位置不统一 | 清理示例输出中的占位版本号 | | 6 | 提示 | ipcevent/1_ipcevent_multi_device 在设备数不足时 exit 1,易被自动化框架误判为 FAIL | 启动前调用 aclrtGetDeviceCount 预检,不满足时优雅退出(exit 0 + SKIP 提示) | | 7 | 提示 | 22 个 advanced/performance 用例缺少「示例输出」小节 | 补充各用例的预期运行输出 | | 8 | 提示 | 0_quickstart/0_hello_cann README 文字"快速入门示示例"("示例"重复);stream/0_simple_stream 输出"beging assigning task"拼写错误 | 修正文字笔误 | | 9 | 提示 | 产品支持表口径不一致:quickstart/1_basic_features 含"Ascend 950PR/950DT",2/3/4/5 仅列 Atlas A3/A2,差异未说明 | 统一产品支持表口径或补注差异原因 | 主要变更包括: - 修正部分 README 中错误链接、错误脚本名、错误路径和示例表格链接。 - 统一部分 advanced/performance 样例的环境配置说明,补充 set_sample_env.sh 使用方式。 - 为缺少示例输出的样例补充「示例输出」小节。 - 移除 memory 样例输出中的伪 CANN 版本号。 - 修复 quickstart/stream 文档与输出中的文字拼写问题。 - 为 ipcevent/1_ipcevent_multi_device 增加设备数预检,设备不足时以 SKIP 方式优雅退出,避免自动化框架误判为 FAIL。 - 补充产品支持表说明和 Device 复位接口使用约定。 - 调整 3_mstx_with_domain 样例 README、run.sh 和代码,使其与实际工程结构一致。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 描述测试此变更的步骤和前提条件: 1. 执行 git diff --check,确认无空白格式问题。 2. 执行修改后的样例验证,确认 3_mstx_with_domain 可正常编译运行。 3. 执行 ipcevent/1_ipcevent_multi_device,在设备数不足场景下确认输出 SKIP 提示并返回 0。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本次修改聚焦 Runtime example 易用性整改,未包含本地评估报告目录和辅助 skill 目录。 See merge request: cann/runtime!3236 | 1 个月前 | |
【PR】:优化 Runtime 样例可执行性与文档一致性 Co-authored-by: shi-qiong<shiqiong3@huawei.com> # message auto-generated for no-merge-commit merge: !3236 merge feature/runtime-example-usability-fixes into master 【PR】:优化 Runtime 样例可执行性与文档一致性 Created-by: shi-qiong Commit-by: shi-qiong Merged-by: cann-robot Description: # Pull Request ## 描述 本次 PR 主要优化 Runtime example 的文档一致性、运行步骤完整性和自动化执行友好性,降低样例运行和评估过程中的误判风险。 | 编号 | 级别 | 描述 | 建议 | |------|------|------|------| | 1 | 严重 | 5_performance/profiling/3_mstx_with_domain/README.md 疑似从 toolkit 仓错误搬运:引用 sample_run.sh(实际为 run.sh)、安装路径指向 /usr/local/Ascend/ascend-toolkit/8.x.x/tools/mstx/samples、表格链接 ./mstx_with_domain 子目录不存在(实际为同级 cpp 文件),与 CMakeLists.txt+run.sh 工程结构不符 | 按本仓实际工程结构重写该 README,对齐全仓统一的"编译运行"小节格式 | | 2 | 一般 | 4 处失败链接:4_reliability/README.md→snapshot/(目录缺失)、4_reliability/fault_tolerant/README.md→../snapshot/、2_advanced_features/notify/README.md→2_cntnotify(目录缺失)、3_mstx_with_domain 表格链接 | 删除失效链接,或补齐对应目录/用例 | | 3 | 一般 | 31 个用例 README 环境配置步骤不完整:2/3/4/5 模块普遍改用手动 export SOC_VERSION,未提及 set_sample_env.sh,与 1_basic_features(全部使用 set_sample_env.sh)方案并存,文档体系不统一 | 全仓统一环境配置方式,推荐统一采用 source set_sample_env.sh 并在所有用例 README 写全 4 步骤 | | 4 | 一般 | 设备复位接口不一致:ipcevent/0_ipcevent、ipcevent/1_ipcevent_multi_device 使用 aclrtResetDevice,其余 50 个用例统一使用 aclrtResetDeviceForce | 统一为 aclrtResetDeviceForce 或在 README 注明差异原因 | | 5 | 一般 | 10 个 memory 用例的示例输出夹带伪版本号 CANN Version: 1.0.0, TimeStamp: ...,与真实 CANN 版本(9.1.0)不符,且位置不统一 | 清理示例输出中的占位版本号 | | 6 | 提示 | ipcevent/1_ipcevent_multi_device 在设备数不足时 exit 1,易被自动化框架误判为 FAIL | 启动前调用 aclrtGetDeviceCount 预检,不满足时优雅退出(exit 0 + SKIP 提示) | | 7 | 提示 | 22 个 advanced/performance 用例缺少「示例输出」小节 | 补充各用例的预期运行输出 | | 8 | 提示 | 0_quickstart/0_hello_cann README 文字"快速入门示示例"("示例"重复);stream/0_simple_stream 输出"beging assigning task"拼写错误 | 修正文字笔误 | | 9 | 提示 | 产品支持表口径不一致:quickstart/1_basic_features 含"Ascend 950PR/950DT",2/3/4/5 仅列 Atlas A3/A2,差异未说明 | 统一产品支持表口径或补注差异原因 | 主要变更包括: - 修正部分 README 中错误链接、错误脚本名、错误路径和示例表格链接。 - 统一部分 advanced/performance 样例的环境配置说明,补充 set_sample_env.sh 使用方式。 - 为缺少示例输出的样例补充「示例输出」小节。 - 移除 memory 样例输出中的伪 CANN 版本号。 - 修复 quickstart/stream 文档与输出中的文字拼写问题。 - 为 ipcevent/1_ipcevent_multi_device 增加设备数预检,设备不足时以 SKIP 方式优雅退出,避免自动化框架误判为 FAIL。 - 补充产品支持表说明和 Device 复位接口使用约定。 - 调整 3_mstx_with_domain 样例 README、run.sh 和代码,使其与实际工程结构一致。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 描述测试此变更的步骤和前提条件: 1. 执行 git diff --check,确认无空白格式问题。 2. 执行修改后的样例验证,确认 3_mstx_with_domain 可正常编译运行。 3. 执行 ipcevent/1_ipcevent_multi_device,在设备数不足场景下确认输出 SKIP 提示并返回 0。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本次修改聚焦 Runtime example 易用性整改,未包含本地评估报告目录和辅助 skill 目录。 See merge request: cann/runtime!3236 | 1 个月前 | |
优化example目录结构易用性及补充用例 Co-authored-by: qiang_zq<qiang.zhangqiang@huawei.com> # message auto-generated for no-merge-commit merge: !1163 merge sample into master 优化example目录结构易用性及补充用例 Created-by: qiang_zq Commit-by: qiang_zq Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 1、example 目录结构优化,按学习阶段重新组织目录结构(0_quickstart ~ 6_scenarios) 2、补充部分API的example用例 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/runtime/issues/284 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 部分用例执行过程 source /home/developer/Ascend/cann/set_env.sh && export SOC_VERSION=ascend910b3 && export ASCENDC_CMAKE_DIR=/home/developer/Ascend/cann/aarch64-linux/tikcpp/ascendc_kernel_cmake && export ASCEND_INSTALL_PATH=/home/developer/Ascend/cann && cd /mnt/workspace/gitCode/qiang_zq/runtime/example/3_memory_advanced/allocator/0_custom_allocator && rm -rf build && dos2unix run.sh 2>/dev/null || sed -i 's/\\r$//' run.sh && 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/3_memory_advanced/allocator/0_custom_allocator/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/3_memory_advanced/allocator/0_custom_allocator/build/main Run the sample: ./build/main ./build/main [INFO] CustomAlloc size=256 [INFO] CustomAllocAdvise size=128 [INFO] CustomAlloc size=128 [INFO] CustomFree invoked [INFO] CustomFree invoked [INFO] Allocator desc queried: descOut=0xaaaabd6a3780 allocCount=2 freeCount=2 用例执行报告 0_quickstart (3/3) ✅ ✅ 0_hello_cann ✅ 1_error_handling ✅ 2_system_info 1_basic_features (23/23) ✅ ✅ device/0_device_normal ✅ device/1_device_multi_thread ✅ device/2_device_P2P ✅ event/0_event_status ✅ event/1_event_timestamp ✅ memory/0_h2h_memory_copy ✅ memory/10_ipc_memory_withpid ✅ memory/11_ipc_memory_withoutpid ✅ memory/1_h2d_sync_memory_copy ✅ memory/2_h2d_async_memory_copy ✅ memory/3_d2h_sync_memory_copy ✅ memory/4_d2h_async_memory_copy ✅ memory/5_d2d_sync_memory_copy ✅ memory/6_d2d_async_memory_copy ✅ memory/7_physical_memory_sharing_withpid ✅ memory/8_physical_memory_sharing_withoutpid ✅ memory/9_multistream_sync_memory ✅ stream/0_simple_stream ✅ stream/1_stream_with_failure_mode ✅ stream/2_multi_stream 2_advanced_features (17/17) ✅ ✅ built_in_task/0_reduce_task ✅ built_in_task/1_random_num_task ✅ callback/0_simple_callback ✅ callback/1_callback_hostfunc ✅ callback/2_callback_exception ✅ group/0_compute_group ✅ kernel/0_launch_kernel ✅ kernel/1_launch_kernel_with_reslimit ✅ label/0_simple_label ✅ model_ri/0_simple_model ✅ model_ri/1_model_update ✅ model_ri/2_model_switch ✅ notify/0_ipc_notify_withpid ✅ notify/1_ipc_notify_withoutpid ✅ notify/2_cntnotify ✅ tdt_buffer/0_shared_buffer ✅ tdt_channel/0_simple_channel ✅ tdt_channel/1_channel_capacity ✅ tdt_queue/0_simple_queue ✅ tdt_queue/1_queue_route ✅ tdt_queue/2_queue_grant_attach 3_memory_advanced (1/1) ✅ ✅ allocator/0_custom_allocator 4_reliability (2/2) ✅ ✅ overflow_detection/0_overflow_detection ✅ snapshot/0_snapshot_management 5_performance (6/6) ✅ ✅ adump/0_adump_args ✅ adump/1_adump_callback ✅ adump/2_model_dump_config ✅ profiling/0_create_config ✅ profiling/1_msproftx ✅ profiling/2_subscribe_model ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> docs/02_dev_guide/初始化.md example/*.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/runtime!1163 | 4 个月前 | |
优化example目录结构易用性及补充用例 Co-authored-by: qiang_zq<qiang.zhangqiang@huawei.com> # message auto-generated for no-merge-commit merge: !1163 merge sample into master 优化example目录结构易用性及补充用例 Created-by: qiang_zq Commit-by: qiang_zq Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 1、example 目录结构优化,按学习阶段重新组织目录结构(0_quickstart ~ 6_scenarios) 2、补充部分API的example用例 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/runtime/issues/284 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 部分用例执行过程 source /home/developer/Ascend/cann/set_env.sh && export SOC_VERSION=ascend910b3 && export ASCENDC_CMAKE_DIR=/home/developer/Ascend/cann/aarch64-linux/tikcpp/ascendc_kernel_cmake && export ASCEND_INSTALL_PATH=/home/developer/Ascend/cann && cd /mnt/workspace/gitCode/qiang_zq/runtime/example/3_memory_advanced/allocator/0_custom_allocator && rm -rf build && dos2unix run.sh 2>/dev/null || sed -i 's/\\r$//' run.sh && 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/3_memory_advanced/allocator/0_custom_allocator/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/3_memory_advanced/allocator/0_custom_allocator/build/main Run the sample: ./build/main ./build/main [INFO] CustomAlloc size=256 [INFO] CustomAllocAdvise size=128 [INFO] CustomAlloc size=128 [INFO] CustomFree invoked [INFO] CustomFree invoked [INFO] Allocator desc queried: descOut=0xaaaabd6a3780 allocCount=2 freeCount=2 用例执行报告 0_quickstart (3/3) ✅ ✅ 0_hello_cann ✅ 1_error_handling ✅ 2_system_info 1_basic_features (23/23) ✅ ✅ device/0_device_normal ✅ device/1_device_multi_thread ✅ device/2_device_P2P ✅ event/0_event_status ✅ event/1_event_timestamp ✅ memory/0_h2h_memory_copy ✅ memory/10_ipc_memory_withpid ✅ memory/11_ipc_memory_withoutpid ✅ memory/1_h2d_sync_memory_copy ✅ memory/2_h2d_async_memory_copy ✅ memory/3_d2h_sync_memory_copy ✅ memory/4_d2h_async_memory_copy ✅ memory/5_d2d_sync_memory_copy ✅ memory/6_d2d_async_memory_copy ✅ memory/7_physical_memory_sharing_withpid ✅ memory/8_physical_memory_sharing_withoutpid ✅ memory/9_multistream_sync_memory ✅ stream/0_simple_stream ✅ stream/1_stream_with_failure_mode ✅ stream/2_multi_stream 2_advanced_features (17/17) ✅ ✅ built_in_task/0_reduce_task ✅ built_in_task/1_random_num_task ✅ callback/0_simple_callback ✅ callback/1_callback_hostfunc ✅ callback/2_callback_exception ✅ group/0_compute_group ✅ kernel/0_launch_kernel ✅ kernel/1_launch_kernel_with_reslimit ✅ label/0_simple_label ✅ model_ri/0_simple_model ✅ model_ri/1_model_update ✅ model_ri/2_model_switch ✅ notify/0_ipc_notify_withpid ✅ notify/1_ipc_notify_withoutpid ✅ notify/2_cntnotify ✅ tdt_buffer/0_shared_buffer ✅ tdt_channel/0_simple_channel ✅ tdt_channel/1_channel_capacity ✅ tdt_queue/0_simple_queue ✅ tdt_queue/1_queue_route ✅ tdt_queue/2_queue_grant_attach 3_memory_advanced (1/1) ✅ ✅ allocator/0_custom_allocator 4_reliability (2/2) ✅ ✅ overflow_detection/0_overflow_detection ✅ snapshot/0_snapshot_management 5_performance (6/6) ✅ ✅ adump/0_adump_args ✅ adump/1_adump_callback ✅ adump/2_model_dump_config ✅ profiling/0_create_config ✅ profiling/1_msproftx ✅ profiling/2_subscribe_model ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> docs/02_dev_guide/初始化.md example/*.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/runtime!1163 | 4 个月前 | |
优化example目录结构易用性及补充用例 Co-authored-by: qiang_zq<qiang.zhangqiang@huawei.com> # message auto-generated for no-merge-commit merge: !1163 merge sample into master 优化example目录结构易用性及补充用例 Created-by: qiang_zq Commit-by: qiang_zq Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 1、example 目录结构优化,按学习阶段重新组织目录结构(0_quickstart ~ 6_scenarios) 2、补充部分API的example用例 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/runtime/issues/284 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 部分用例执行过程 source /home/developer/Ascend/cann/set_env.sh && export SOC_VERSION=ascend910b3 && export ASCENDC_CMAKE_DIR=/home/developer/Ascend/cann/aarch64-linux/tikcpp/ascendc_kernel_cmake && export ASCEND_INSTALL_PATH=/home/developer/Ascend/cann && cd /mnt/workspace/gitCode/qiang_zq/runtime/example/3_memory_advanced/allocator/0_custom_allocator && rm -rf build && dos2unix run.sh 2>/dev/null || sed -i 's/\\r$//' run.sh && 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/3_memory_advanced/allocator/0_custom_allocator/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/3_memory_advanced/allocator/0_custom_allocator/build/main Run the sample: ./build/main ./build/main [INFO] CustomAlloc size=256 [INFO] CustomAllocAdvise size=128 [INFO] CustomAlloc size=128 [INFO] CustomFree invoked [INFO] CustomFree invoked [INFO] Allocator desc queried: descOut=0xaaaabd6a3780 allocCount=2 freeCount=2 用例执行报告 0_quickstart (3/3) ✅ ✅ 0_hello_cann ✅ 1_error_handling ✅ 2_system_info 1_basic_features (23/23) ✅ ✅ device/0_device_normal ✅ device/1_device_multi_thread ✅ device/2_device_P2P ✅ event/0_event_status ✅ event/1_event_timestamp ✅ memory/0_h2h_memory_copy ✅ memory/10_ipc_memory_withpid ✅ memory/11_ipc_memory_withoutpid ✅ memory/1_h2d_sync_memory_copy ✅ memory/2_h2d_async_memory_copy ✅ memory/3_d2h_sync_memory_copy ✅ memory/4_d2h_async_memory_copy ✅ memory/5_d2d_sync_memory_copy ✅ memory/6_d2d_async_memory_copy ✅ memory/7_physical_memory_sharing_withpid ✅ memory/8_physical_memory_sharing_withoutpid ✅ memory/9_multistream_sync_memory ✅ stream/0_simple_stream ✅ stream/1_stream_with_failure_mode ✅ stream/2_multi_stream 2_advanced_features (17/17) ✅ ✅ built_in_task/0_reduce_task ✅ built_in_task/1_random_num_task ✅ callback/0_simple_callback ✅ callback/1_callback_hostfunc ✅ callback/2_callback_exception ✅ group/0_compute_group ✅ kernel/0_launch_kernel ✅ kernel/1_launch_kernel_with_reslimit ✅ label/0_simple_label ✅ model_ri/0_simple_model ✅ model_ri/1_model_update ✅ model_ri/2_model_switch ✅ notify/0_ipc_notify_withpid ✅ notify/1_ipc_notify_withoutpid ✅ notify/2_cntnotify ✅ tdt_buffer/0_shared_buffer ✅ tdt_channel/0_simple_channel ✅ tdt_channel/1_channel_capacity ✅ tdt_queue/0_simple_queue ✅ tdt_queue/1_queue_route ✅ tdt_queue/2_queue_grant_attach 3_memory_advanced (1/1) ✅ ✅ allocator/0_custom_allocator 4_reliability (2/2) ✅ ✅ overflow_detection/0_overflow_detection ✅ snapshot/0_snapshot_management 5_performance (6/6) ✅ ✅ adump/0_adump_args ✅ adump/1_adump_callback ✅ adump/2_model_dump_config ✅ profiling/0_create_config ✅ profiling/1_msproftx ✅ profiling/2_subscribe_model ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> docs/02_dev_guide/初始化.md example/*.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/runtime!1163 | 4 个月前 |
1_adump_callback
描述
本用例展示了单算子执行场景下如何通过回调函数接收Dump数据块。示例会注册 acldumpRegCallback 回调,在回调中解析 acldumpChunk 的文件名、偏移、分块标记、flag 和数据预览,并输出汇总统计信息。
产品支持情况
本样例支持以下产品:
| 产品 | 是否支持 |
|---|---|
| Atlas A3 训练系列产品/Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品/Atlas A2 推理系列产品 | √ |
编译运行
环境安装详情以及运行详情请见example目录下的README。
运行步骤如下:
# ${install_root} 替换为 CANN 安装根目录,默认安装在`/usr/local/Ascend`目录
source ${install_root}/cann/set_env.sh
# 自动识别 SOC_VERSION 和 ASCENDC_CMAKE_DIR
source ${git_clone_path}/example/set_sample_env.sh
# 编译运行
bash run.sh
CANN RUNTIME API
在该sample中,涉及的关键功能点及其关键接口,如下所示:
- 初始化
- 调用aclInit接口初始化AscendCL配置。
- 调用acldumpRegCallback接口注册Dump算子信息回调函数。
- 调用acldumpGetPath接口查询当前Dump输出路径。
- 调用acldumpUnregCallback接口去注册Dump算子信息回调函数。
- 调用aclFinalize接口实现AscendCL去初始化。
- Device管理
- 调用aclrtSetDevice接口指定用于运算的Device。
- 调用aclrtSynchronizeDevice接口阻塞等待正在运算中的Device完成运算。
- 调用aclrtResetDeviceForce接口强制复位当前运算的Device,回收Device上的资源。
- Stream管理
- 调用aclrtCreateStream接口创建Stream。
- 调用aclrtSynchronizeStream接口阻塞等待Stream上任务的完成。
- 调用aclrtDestroyStream接口销毁Stream。
- 内存管理
- 调用aclrtMalloc接口申请Device上的内存。
- 调用aclrtFree接口释放Device上的内存。
- 数据传输
- 调用aclrtMemcpy接口通过内存复制的方式实现数据传输。
本示例新增覆盖
- 回调数据解析:在回调中解析
acldumpChunk的文件名、偏移、是否最后一块、flag 和数据预览。 acldumpGetPath:查询当前Dump输出路径,便于与回调收到的文件名做对应。
示例输出
[INFO] acldumpGetPath returned dump path: ...
[INFO] Get workspace size...
[INFO] Begin to add...
[INFO] Receive dump tensor data success. file=..., bufLen=..., isLastChunk=..., offset=..., flag=..., preview=...
[INFO] result[0] is: 1.000000
[INFO] result[1] is: 2.000000
[INFO] result[2] is: 3.000000
[INFO] result[3] is: 5.000000
[INFO] result[4] is: 6.000000
[INFO] result[5] is: 7.000000
[INFO] result[6] is: 10.000000
[INFO] result[7] is: 11.000000
[INFO] Dump callback summary: total chunks=..., total bytes=..., total files=...
[INFO] Run the device_normal sample successfully.
已知issue
暂无