| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix: 修复白盒扫描发现的边界和并发问题 Co-authored-by: daijinling<daijinling2@huawei.com> # message auto-generated for no-merge-commit merge: !5115 merge bugfix/white_scan_20260920 into master fix: 修复白盒扫描发现的边界和并发问题 Created-by: daijinling Commit-by: daijinling Merged-by: cann-robot Description: ## 修改内容 - 使用同一把锁保护流错误消息的容量检查、写入和清理。 - Stars 任务的空 stream 在 ApiErrorDecorator 中转换为当前上下文默认流,Impl 层不重复处理。 - stat 失败且释放接口返回成功时关闭共享内存 fd。 ## 验证 - pre-commit:通过 - Runtime 构建:通过 - LLT:7/7 通过,源码改动可执行行覆盖率 100% - HLT:7/7 通过 - CI:通过 See merge request: cann/runtime!5115 | 1 天前 | |
refactor: 拆分并隔离 ApiHostMemory Co-authored-by: kongrong<kongrong@hisilicon.com> # message auto-generated for no-merge-commit merge: !4987 merge refactor/api-host-memory-combined into master refactor: 拆分并隔离 ApiHostMemory Created-by: carol696 Commit-by: kongrong Merged-by: cann-robot Description: # Pull Request ## 描述 本 PR 基于 #4491、#4560、#4663 的内存管理拆分分析,将原 #4813、#4814、#4815 合并为单个 ApiHostMemory 隔离拆分 PR。 本批接口: - rtsMallocHost - rtMallocHost - rtsFreeHost - rtFreeHost - rtFreeHostWithDevSync - rtsHostRegister - rtHostMemMapCapabilities - rtHostRegisterV2 - rtHostGetDevicePointer - rtsHostUnregister - rtMallocHostSharedMemory - rtFreeHostSharedMemory - rtHostGetDevicePointerAddrRange 具体变更: - 合并原三阶段 PR #4813、#4814、#4815 为单 PR:框架新增、C API 路由切换、arch5162/tiny 隔离一次性提交。 - 新增 ApiHostMemory 抽象入口、ApiImplHostMemory 正式实现和 api_c_host_memory.cc C API 入口。 - 将 HostMemory 相关 C API 从主 Api 调用链切换到 ApiHostMemory::Instance()。 - 删除主 Api、ApiImpl、ApiDecorator、ApiErrorDecorator、profile/profile-log decorator 中的旧 HostMemory 转发。 - tiny 编译正式 ApiImplHostMemory 并创建 HostMemory 实现对象;api_c_host_memory.cc 在 tiny stub 目标中作为 weak provider 编译,rtHostGetDevicePointerAddrRange 继续由 generated strong stub 覆盖,保持 tiny 对外 C API 打桩语义。 - ApiImplHostMemory::HostGetDevicePointerAddrRange 真实实现迁移到 api_impl_host_memory.cc;tiny 实现层随正式 ApiImplHostMemory 拥有真实实现,公开 C API 仍由 tiny generated strong stub 保持 feature-not-support;arch5162 继续不创建 HostMemory 实现。 - arch5162 继续使用 api_impl_host_memory_stub.cc,IsImplHostMemorySupported() 返回 false,Runtime 初始化时不挂载 HostMemory 实现。 - 保留原 HostMalloc 配置、UVA、HostRegister、addr range 等注释,并将 ErrMsg/ErrorMessage 上报边界迁移到 HostMemory 专属实现。 - 按检视意见收敛 api_impl_host_memory.cc:删除本地 CheckDeviceIdIsValid、GetReportProfApiData、FillHostMemMngExtInfo 重复实现,改为直接调用 Runtime 公共方法;HostFreeImpl 直接通过当前 driver 调用 PtrGetAttributes;HostMalloc/HostFree 去掉 ProfileLogRecord 层级,保留 Runtime CallApiBegin/End 与 extInfo 填充路径;删除 HostMemory 本地 CurrentContext 包装函数和 DEFAULT_HOST_MEMORY_DEVICE_ID,调用处显式展开为 Runtime::Instance()->CurrentContext(true, DEFAULT_DEVICE_ID)。 - 将 HostGetDevicePointerAddrRange 真实实现从 api_impl_standard_soc.cc 迁移到 api_impl_host_memory.cc,并删除 api_impl_stub.cc 中该成员的 feature-not-support 打桩。 - 同步普通、v200、cmodel、tiny、arch5162、910B 和 UT 的源文件列表。 - 按评审意见补齐 HostMalloc、HostMallocWithCfg 和 HostFree 的 Runtime CallApiBegin/End 覆盖范围,参数、cfg、Context 和 driver 失败路径均保持 begin/end 配对;不额外增加 ApiHostMemory::Instance() thread-local env flags 复位。 行为等价说明: - 支持产品继续编译并使用正式 ApiImplHostMemory。 - tiny 侧 ApiHostMemory 对象创建能力与修改前保持一致;公开 C API 中 rtHostGetDevicePointerAddrRange 继续命中 tiny unsupported generated stub,返回 feature-not-support;实现层直接调用 ApiHostMemory::HostGetDevicePointerAddrRange 时走 api_impl_host_memory.cc 真实实现,count == nullptr 返回 RT_ERROR_INVALID_VALUE。 - arch5162 不编译正式 HostMemory 实现,公开 runtime/ACL HostMemory API 继续由平台 stub 保持 feature-not-support 语义。 - 支持产品中 HostGetDevicePointerAddrRange 补回拆分前 ApiErrorDecorator 的 count 空指针校验,返回码与错误文案 Obtaining the device address range 保持一致。 - rtsMallocHost、rtHostMemMapCapabilities、rtHostGetDevicePointer、rtsHostUnregister、rtHostGetDevicePointerAddrRange 的 feature-not-support 返回码转换保持原 C API 语义。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无 ## 如何测试 描述测试此变更的步骤和前提条件: 1. cmake --build build --target runtime_utest_api_910B -j16:通过。 2. cmake --build build --target runtime_utest_task_910B -j16:通过。 3. cmake --build build --target runtime_utest_tiny_stub -j16:通过。 4. cmake --build build --target runtime_utest_arch5162 -j16:通过。 5. cmake --build build --target runtime_utest_api -j16:通过。 6. build/tests/ut/runtime/runtime/test/platform/910B/runtime_utest_api_910B --gtest_filter=ProfilerTest.HostMallocWithCfgInvalidParamKeepsProfileBeginEndPaired:ProfilerTest.HostMallocInvalidParamKeepsProfileBeginEndPaired:ProfilerTest.HostFreeInvalidParamKeepsProfileBeginEndPaired:通过。 7. build/tests/ut/runtime/runtime/test/platform/910B/runtime_utest_task_910B --gtest_filter=CloudV2IpcApiTest.HostGetDevicePointerAddrRange:通过。 8. build/tests/ut/runtime/runtime/runtime_utest_tiny_stub --gtest_filter=TinyStubTest.api_impl_stub:TinyStubTest.api_c_stub:通过。 9. build/tests/ut/runtime/runtime/test/platform/arch5162/runtime_utest_arch5162 --gtest_filter=Arch5162MemTest.UnsupportedHostMemoryApiImpls_ReturnNotSupport:通过。 10. git -c core.whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol diff --check upstream/master...HEAD:通过。 11. git commit --amend --no-edit:提交钩子 clang-format 与 OAT Compliance Check 通过。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 David 差异化分析:ApiImplDavid 未发现 HostMemory override 或 David 专属 HostMemory 实现,本 PR 不拆 David 专属 HostFunc/HostAtomic/Simt 逻辑;本轮仅将 950 David UT 中 HostMemory forwarding 用例切到新的 ApiHostMemory 边界,David 产品实现继续复用通用 HostMemory 实现。 CMake 行尾处理:本轮未修改 CMake;前序 HostMemory/tiny weak-provider 源文件列表调整保持不变,未为了 diff check 改动无关行尾。 See merge request: cann/runtime!4987 | 1 天前 | |
refactor: 拆分并隔离 ApiHostMemory Co-authored-by: kongrong<kongrong@hisilicon.com> # message auto-generated for no-merge-commit merge: !4987 merge refactor/api-host-memory-combined into master refactor: 拆分并隔离 ApiHostMemory Created-by: carol696 Commit-by: kongrong Merged-by: cann-robot Description: # Pull Request ## 描述 本 PR 基于 #4491、#4560、#4663 的内存管理拆分分析,将原 #4813、#4814、#4815 合并为单个 ApiHostMemory 隔离拆分 PR。 本批接口: - rtsMallocHost - rtMallocHost - rtsFreeHost - rtFreeHost - rtFreeHostWithDevSync - rtsHostRegister - rtHostMemMapCapabilities - rtHostRegisterV2 - rtHostGetDevicePointer - rtsHostUnregister - rtMallocHostSharedMemory - rtFreeHostSharedMemory - rtHostGetDevicePointerAddrRange 具体变更: - 合并原三阶段 PR #4813、#4814、#4815 为单 PR:框架新增、C API 路由切换、arch5162/tiny 隔离一次性提交。 - 新增 ApiHostMemory 抽象入口、ApiImplHostMemory 正式实现和 api_c_host_memory.cc C API 入口。 - 将 HostMemory 相关 C API 从主 Api 调用链切换到 ApiHostMemory::Instance()。 - 删除主 Api、ApiImpl、ApiDecorator、ApiErrorDecorator、profile/profile-log decorator 中的旧 HostMemory 转发。 - tiny 编译正式 ApiImplHostMemory 并创建 HostMemory 实现对象;api_c_host_memory.cc 在 tiny stub 目标中作为 weak provider 编译,rtHostGetDevicePointerAddrRange 继续由 generated strong stub 覆盖,保持 tiny 对外 C API 打桩语义。 - ApiImplHostMemory::HostGetDevicePointerAddrRange 真实实现迁移到 api_impl_host_memory.cc;tiny 实现层随正式 ApiImplHostMemory 拥有真实实现,公开 C API 仍由 tiny generated strong stub 保持 feature-not-support;arch5162 继续不创建 HostMemory 实现。 - arch5162 继续使用 api_impl_host_memory_stub.cc,IsImplHostMemorySupported() 返回 false,Runtime 初始化时不挂载 HostMemory 实现。 - 保留原 HostMalloc 配置、UVA、HostRegister、addr range 等注释,并将 ErrMsg/ErrorMessage 上报边界迁移到 HostMemory 专属实现。 - 按检视意见收敛 api_impl_host_memory.cc:删除本地 CheckDeviceIdIsValid、GetReportProfApiData、FillHostMemMngExtInfo 重复实现,改为直接调用 Runtime 公共方法;HostFreeImpl 直接通过当前 driver 调用 PtrGetAttributes;HostMalloc/HostFree 去掉 ProfileLogRecord 层级,保留 Runtime CallApiBegin/End 与 extInfo 填充路径;删除 HostMemory 本地 CurrentContext 包装函数和 DEFAULT_HOST_MEMORY_DEVICE_ID,调用处显式展开为 Runtime::Instance()->CurrentContext(true, DEFAULT_DEVICE_ID)。 - 将 HostGetDevicePointerAddrRange 真实实现从 api_impl_standard_soc.cc 迁移到 api_impl_host_memory.cc,并删除 api_impl_stub.cc 中该成员的 feature-not-support 打桩。 - 同步普通、v200、cmodel、tiny、arch5162、910B 和 UT 的源文件列表。 - 按评审意见补齐 HostMalloc、HostMallocWithCfg 和 HostFree 的 Runtime CallApiBegin/End 覆盖范围,参数、cfg、Context 和 driver 失败路径均保持 begin/end 配对;不额外增加 ApiHostMemory::Instance() thread-local env flags 复位。 行为等价说明: - 支持产品继续编译并使用正式 ApiImplHostMemory。 - tiny 侧 ApiHostMemory 对象创建能力与修改前保持一致;公开 C API 中 rtHostGetDevicePointerAddrRange 继续命中 tiny unsupported generated stub,返回 feature-not-support;实现层直接调用 ApiHostMemory::HostGetDevicePointerAddrRange 时走 api_impl_host_memory.cc 真实实现,count == nullptr 返回 RT_ERROR_INVALID_VALUE。 - arch5162 不编译正式 HostMemory 实现,公开 runtime/ACL HostMemory API 继续由平台 stub 保持 feature-not-support 语义。 - 支持产品中 HostGetDevicePointerAddrRange 补回拆分前 ApiErrorDecorator 的 count 空指针校验,返回码与错误文案 Obtaining the device address range 保持一致。 - rtsMallocHost、rtHostMemMapCapabilities、rtHostGetDevicePointer、rtsHostUnregister、rtHostGetDevicePointerAddrRange 的 feature-not-support 返回码转换保持原 C API 语义。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无 ## 如何测试 描述测试此变更的步骤和前提条件: 1. cmake --build build --target runtime_utest_api_910B -j16:通过。 2. cmake --build build --target runtime_utest_task_910B -j16:通过。 3. cmake --build build --target runtime_utest_tiny_stub -j16:通过。 4. cmake --build build --target runtime_utest_arch5162 -j16:通过。 5. cmake --build build --target runtime_utest_api -j16:通过。 6. build/tests/ut/runtime/runtime/test/platform/910B/runtime_utest_api_910B --gtest_filter=ProfilerTest.HostMallocWithCfgInvalidParamKeepsProfileBeginEndPaired:ProfilerTest.HostMallocInvalidParamKeepsProfileBeginEndPaired:ProfilerTest.HostFreeInvalidParamKeepsProfileBeginEndPaired:通过。 7. build/tests/ut/runtime/runtime/test/platform/910B/runtime_utest_task_910B --gtest_filter=CloudV2IpcApiTest.HostGetDevicePointerAddrRange:通过。 8. build/tests/ut/runtime/runtime/runtime_utest_tiny_stub --gtest_filter=TinyStubTest.api_impl_stub:TinyStubTest.api_c_stub:通过。 9. build/tests/ut/runtime/runtime/test/platform/arch5162/runtime_utest_arch5162 --gtest_filter=Arch5162MemTest.UnsupportedHostMemoryApiImpls_ReturnNotSupport:通过。 10. git -c core.whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol diff --check upstream/master...HEAD:通过。 11. git commit --amend --no-edit:提交钩子 clang-format 与 OAT Compliance Check 通过。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 David 差异化分析:ApiImplDavid 未发现 HostMemory override 或 David 专属 HostMemory 实现,本 PR 不拆 David 专属 HostFunc/HostAtomic/Simt 逻辑;本轮仅将 950 David UT 中 HostMemory forwarding 用例切到新的 ApiHostMemory 边界,David 产品实现继续复用通用 HostMemory 实现。 CMake 行尾处理:本轮未修改 CMake;前序 HostMemory/tiny weak-provider 源文件列表调整保持不变,未为了 diff check 改动无关行尾。 See merge request: cann/runtime!4987 | 1 天前 | |
refactor: 拆分并隔离 ApiHostMemory Co-authored-by: kongrong<kongrong@hisilicon.com> # message auto-generated for no-merge-commit merge: !4987 merge refactor/api-host-memory-combined into master refactor: 拆分并隔离 ApiHostMemory Created-by: carol696 Commit-by: kongrong Merged-by: cann-robot Description: # Pull Request ## 描述 本 PR 基于 #4491、#4560、#4663 的内存管理拆分分析,将原 #4813、#4814、#4815 合并为单个 ApiHostMemory 隔离拆分 PR。 本批接口: - rtsMallocHost - rtMallocHost - rtsFreeHost - rtFreeHost - rtFreeHostWithDevSync - rtsHostRegister - rtHostMemMapCapabilities - rtHostRegisterV2 - rtHostGetDevicePointer - rtsHostUnregister - rtMallocHostSharedMemory - rtFreeHostSharedMemory - rtHostGetDevicePointerAddrRange 具体变更: - 合并原三阶段 PR #4813、#4814、#4815 为单 PR:框架新增、C API 路由切换、arch5162/tiny 隔离一次性提交。 - 新增 ApiHostMemory 抽象入口、ApiImplHostMemory 正式实现和 api_c_host_memory.cc C API 入口。 - 将 HostMemory 相关 C API 从主 Api 调用链切换到 ApiHostMemory::Instance()。 - 删除主 Api、ApiImpl、ApiDecorator、ApiErrorDecorator、profile/profile-log decorator 中的旧 HostMemory 转发。 - tiny 编译正式 ApiImplHostMemory 并创建 HostMemory 实现对象;api_c_host_memory.cc 在 tiny stub 目标中作为 weak provider 编译,rtHostGetDevicePointerAddrRange 继续由 generated strong stub 覆盖,保持 tiny 对外 C API 打桩语义。 - ApiImplHostMemory::HostGetDevicePointerAddrRange 真实实现迁移到 api_impl_host_memory.cc;tiny 实现层随正式 ApiImplHostMemory 拥有真实实现,公开 C API 仍由 tiny generated strong stub 保持 feature-not-support;arch5162 继续不创建 HostMemory 实现。 - arch5162 继续使用 api_impl_host_memory_stub.cc,IsImplHostMemorySupported() 返回 false,Runtime 初始化时不挂载 HostMemory 实现。 - 保留原 HostMalloc 配置、UVA、HostRegister、addr range 等注释,并将 ErrMsg/ErrorMessage 上报边界迁移到 HostMemory 专属实现。 - 按检视意见收敛 api_impl_host_memory.cc:删除本地 CheckDeviceIdIsValid、GetReportProfApiData、FillHostMemMngExtInfo 重复实现,改为直接调用 Runtime 公共方法;HostFreeImpl 直接通过当前 driver 调用 PtrGetAttributes;HostMalloc/HostFree 去掉 ProfileLogRecord 层级,保留 Runtime CallApiBegin/End 与 extInfo 填充路径;删除 HostMemory 本地 CurrentContext 包装函数和 DEFAULT_HOST_MEMORY_DEVICE_ID,调用处显式展开为 Runtime::Instance()->CurrentContext(true, DEFAULT_DEVICE_ID)。 - 将 HostGetDevicePointerAddrRange 真实实现从 api_impl_standard_soc.cc 迁移到 api_impl_host_memory.cc,并删除 api_impl_stub.cc 中该成员的 feature-not-support 打桩。 - 同步普通、v200、cmodel、tiny、arch5162、910B 和 UT 的源文件列表。 - 按评审意见补齐 HostMalloc、HostMallocWithCfg 和 HostFree 的 Runtime CallApiBegin/End 覆盖范围,参数、cfg、Context 和 driver 失败路径均保持 begin/end 配对;不额外增加 ApiHostMemory::Instance() thread-local env flags 复位。 行为等价说明: - 支持产品继续编译并使用正式 ApiImplHostMemory。 - tiny 侧 ApiHostMemory 对象创建能力与修改前保持一致;公开 C API 中 rtHostGetDevicePointerAddrRange 继续命中 tiny unsupported generated stub,返回 feature-not-support;实现层直接调用 ApiHostMemory::HostGetDevicePointerAddrRange 时走 api_impl_host_memory.cc 真实实现,count == nullptr 返回 RT_ERROR_INVALID_VALUE。 - arch5162 不编译正式 HostMemory 实现,公开 runtime/ACL HostMemory API 继续由平台 stub 保持 feature-not-support 语义。 - 支持产品中 HostGetDevicePointerAddrRange 补回拆分前 ApiErrorDecorator 的 count 空指针校验,返回码与错误文案 Obtaining the device address range 保持一致。 - rtsMallocHost、rtHostMemMapCapabilities、rtHostGetDevicePointer、rtsHostUnregister、rtHostGetDevicePointerAddrRange 的 feature-not-support 返回码转换保持原 C API 语义。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无 ## 如何测试 描述测试此变更的步骤和前提条件: 1. cmake --build build --target runtime_utest_api_910B -j16:通过。 2. cmake --build build --target runtime_utest_task_910B -j16:通过。 3. cmake --build build --target runtime_utest_tiny_stub -j16:通过。 4. cmake --build build --target runtime_utest_arch5162 -j16:通过。 5. cmake --build build --target runtime_utest_api -j16:通过。 6. build/tests/ut/runtime/runtime/test/platform/910B/runtime_utest_api_910B --gtest_filter=ProfilerTest.HostMallocWithCfgInvalidParamKeepsProfileBeginEndPaired:ProfilerTest.HostMallocInvalidParamKeepsProfileBeginEndPaired:ProfilerTest.HostFreeInvalidParamKeepsProfileBeginEndPaired:通过。 7. build/tests/ut/runtime/runtime/test/platform/910B/runtime_utest_task_910B --gtest_filter=CloudV2IpcApiTest.HostGetDevicePointerAddrRange:通过。 8. build/tests/ut/runtime/runtime/runtime_utest_tiny_stub --gtest_filter=TinyStubTest.api_impl_stub:TinyStubTest.api_c_stub:通过。 9. build/tests/ut/runtime/runtime/test/platform/arch5162/runtime_utest_arch5162 --gtest_filter=Arch5162MemTest.UnsupportedHostMemoryApiImpls_ReturnNotSupport:通过。 10. git -c core.whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol diff --check upstream/master...HEAD:通过。 11. git commit --amend --no-edit:提交钩子 clang-format 与 OAT Compliance Check 通过。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 David 差异化分析:ApiImplDavid 未发现 HostMemory override 或 David 专属 HostMemory 实现,本 PR 不拆 David 专属 HostFunc/HostAtomic/Simt 逻辑;本轮仅将 950 David UT 中 HostMemory forwarding 用例切到新的 ApiHostMemory 边界,David 产品实现继续复用通用 HostMemory 实现。 CMake 行尾处理:本轮未修改 CMake;前序 HostMemory/tiny weak-provider 源文件列表调整保持不变,未为了 diff check 改动无关行尾。 See merge request: cann/runtime!4987 | 1 天前 | |
【PR】:precommit src/runtime Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !3723 merge master_clang into master 【PR】:precommit src/runtime Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 请清晰准确地描述本次 Pull Request 的意图和变更内容。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [ ] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [ ] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!3723 | 2 个月前 | |
refactor: 刷新arch5162不支持Runtime接口桩 Co-authored-by: zhangpengpeng8<zhangpengpeng8@hisilicon.com> # message auto-generated for no-merge-commit merge: !4486 merge refactor/arch5162-runtime-api-capability into master refactor: 刷新arch5162不支持Runtime接口桩 Created-by: zhangpengpeng8 Commit-by: zhangpengpeng8 Merged-by: cann-robot Description: # Pull Request ## 描述 依据 arch5162 API 支持性分析,刷新产品 Runtime API 强桩清单及自动化校验: 1. 公共签名目录管理普通 libruntime.so 的 783 个 rt/rts API;arch5162 产品清单包含 654 个强桩,其中 650 个返回 RT_ERROR_FEATURE_NOT_SUPPORT,3 个为成功空操作,1 个为 void 空操作。 2. 从强桩清单移除需要保留真实实现的接口,并新增 rtBinaryLoadWithoutTilingKey、rtModelGetId、rtRegTaskFailCallbackByModule、rtsLaunchUpdateTask 4 个明确不支持接口。 3. rtGetDevice 使用 arch5162 专用实现:参数有效时固定写入设备号 0 并返回成功,空指针返回参数错误。 4. 对存在 ACL 调用路径的非 TDT 不支持能力维护 265 条 ACL-Runtime 映射,生成 UT 同时校验 ACL 和 Runtime 返回值;仅有 Runtime 入口的能力由 Runtime 强桩 UT 覆盖。 5. rtNpuGetFloatDebugStatus、rtNpuClearFloatDebugStatus、rtStarsTaskLaunch、rtStarsTaskLaunchWithFlag 的实现定义未使用 RTS_API 或 VISIBILITY_DEFAULT。本 PR 不改变其可见性,也暂不生成强桩,后续确认导出策略后再处理。 6. aclrtMemsetD32* 的错误透传涉及 ACL 公共实现,暂不在本 PR 扩大修改范围;本 PR 不修改 ACL 通用 memory.cpp 和 docs。 完整 ACL-Runtime 支持关系、跨层矛盾和接口调整依据见 [PR 4491](https://gitcode.com/cann/runtime/pull/4491)。 ## 变更类型 - [ ] Bug 修复 - [ ] 新功能 - [ ] 代码风格更新(格式化,局部变量) - [x] 重构(既不修复错误也不增加功能的代码变动) - [x] 构建过程或辅助工具的变动 - [ ] 文档内容更新 ## 关联的Issue 无。 ## 如何测试 1. python3 tests/ut/runtime/runtime/test/cmake/test_generate_runtime_api_stubs.py:9/9 通过。 2. runtime_utest_arch5162 --gtest_brief=1:1038/1038 通过,覆盖 654 个 Runtime 产品强桩、265 条 ACL-Runtime 映射、arch5162 专用 rtGetDevice 返回值及主线新增的 AICPU DFX、Notify 测试。 3. PRODUCT=ascend5162a、ENABLE_UT=ON、Release 配置下,runtime 和 runtime_utest_arch5162 目标编译链接通过。 4. ELF 符号核验:rtGetDevice 为导出强符号;上述 4 个暂缓接口未进入 arch5162 动态符号表。 5. pre-commit 的 clang-format 与 OAT 检查通过。 6. [编译与 UT 流水线](https://www.openlibing.com/apps/pipelineDetail?pipelineId=50ab408233ea4622975e6b0318a0cb06&pipelineRunId=326d9b6d14bd4447b56dcf40dc3d5d72&projectName=CANN):30 个任务完成、2 个忽略、0 个失败。 7. [静态检查流水线](https://www.openlibing.com/apps/pipelineDetail?pipelineId=aeb4b733d2324717a859e5923df342c7&pipelineRunId=a498f79fb2b84db4809f3d039f11dfe5&projectName=CANN):7 个任务完成、1 个未选择、0 个失败。 ## 大小对比 采用相同的 ascend5162a Release 构建配置与本次 rebase 时的 origin/master 提交 6347725d97e7f60dbdded8e5bf3801cbdcd466de 对比:主线 libruntime.so 为 6,077,928 字节,当前 PR 产物为 5,713,352 字节,减少 364,576 字节,约 6.00%。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 本 PR 需要修改文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于 commit message 的格式、无效 commit 的合并等 ## 其他信息 - 本次 rebase 基线:6347725d97e7f60dbdded8e5bf3801cbdcd466de。 - 当前提交:2dbfb77d3d391f22d5163e753968bb31bb57f028。 - 支持性分析与接口矩阵:[PR 4491](https://gitcode.com/cann/runtime/pull/4491)。 See merge request: cann/runtime!4486 | 25 天前 | |
refactor: 切换 ApiRtConfig API 调用链 Co-authored-by: wangzhensheng<wangzhensheng4@huawei.com> # message auto-generated for no-merge-commit merge: !4892 merge refactor/api-rt-config-route into master refactor: 切换 ApiRtConfig API 调用链 Created-by: wangzhensheng Commit-by: wangzhensheng Merged-by: cann-robot Description: # Pull Request ## 描述 将 Runtime 运行时配置相关接口的 API 入口从通用 Api 调用链切换到独立的 ApiRtConfig 调用链,完成此前新增 ApiRtConfig/ApiImplRtConfig 框架的调用链切换。 **主要变更** 1. 从原有文件中移除以下接口实现,新增统一入口文件 src/runtime/api/api_c_rt_config.cc,集中承载 13 个运行时配置接口: rtCtxSetSysParamOpt、rtCtxGetSysParamOpt、rtsCtxSetSysParamOpt、rtsCtxGetSysParamOpt rtsSetDeviceResLimit、rtsResetDeviceResLimit、rtsGetDeviceResLimit rtsSetStreamResLimit、rtsResetStreamResLimit、rtsGetStreamResLimit、 rtsUseStreamResInCurrentThread、rtsNotUseStreamResInCurrentThread、rtsGetResInCurrentThread 2. 切换运行时配置相关接口的调用链: text 调整前: RT/RTS C API -> Api::Instance() -> ApiImpl 调整后: RT/RTS C API -> ApiRtConfig::Instance() -> ApiImplRtConfig 3. 更新各产品构建配置,将新文件加入普通 Runtime、CModel、Tiny 和 Arch5162 编译源。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!4892 | 6 天前 | |
refactor: 切换 ApiDeviceTopology API 调用链 Co-authored-by: wangzhensheng<wangzhensheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5090 merge refactor/api-device-topology-route-v2 into master refactor: 切换 ApiDeviceTopology API 调用链 Created-by: wangzhensheng Commit-by: wangzhensheng Merged-by: cann-robot Description: # Pull Request ## 描述 将设备拓扑相关的 RT/RTS C API,从通用 Api 调用链切换到独立的 ApiDeviceTopology 调用链,它承接前面新增ApiDeviceTopology/ApiImplDeviceTopology 框架的 PR4874 和 PR4996,属于实际入口迁移阶段。 **调用链变化** text 调整前: 设备拓扑 C API -> Api::Instance() -> ApiImpl 调整后: 设备拓扑 C API -> ApiDeviceTopology::Instance() -> ApiImplDeviceTopology **迁移的接口** 新增 api_c_device_topology.cc,集中承载26个公开入口,对应16个 ApiDeviceTopology 内部方法: - 设备数量:rtGetDeviceCount、rtsGetDeviceCount - 物理 ID/设备索引转换: rtGetDevicePhyIdByIndex、rtGetDeviceIndexByPhyId、rtsGetLogicDevIdByPhyDevId、rtsGetPhyDevIdByLogicDevId - 用户 ID/逻辑 ID转换: rt/rtsGetLogicDevIdByUserDevId、rt/rtsGetUserDevIdByLogicDevId - P2P 控制和查询: rt/rtsEnableP2P、rt/rtsDisableP2P、rt/rtsDeviceCanAccessPeer、rt/rtsGetP2PStatus - 设备对信息: rtGetPairDevicesInfo、rtsGetPairDevicesInfo、rtGetPairPhyDevicesInfo - 设备标识: rtGetDeviceUuid、rtDeviceGetPCIBusId、rtDeviceGetByPCIBusId - 原子操作能力: rtDeviceGetHostAtomicCapabilities、rtDeviceGetP2PAtomicCapabilities 原定义分别从 api_c_device.cc 和 api_c_memory.cc 删除。 **平台处理** - 标准 Runtime、CModel:编译新的 C API 文件,并使用完整的 ApiImplDeviceTopology。 - Tiny:将全部26个接口加入不支持列表,使用 api_impl_device_topology_stub.cc,对外返回 ACL_ERROR_RT_FEATURE_NOT_SUPPORT。 - Arch5162:将26个接口在 stub catalog 中统一归类为 device_topology,并把新入口文件加入 weak-real 源列表,由平台桩机制提供不支持实现。 - 910B:增加新入口文件的 UT 编译配置。 **变更边界** 该 PR 只切换 C API 入口,**没有修改 ApiImplDeviceTopology 的功能实现,也没有删除旧 Api/ApiImpl 中的同名方法**,旧实现清理属于后续阶段。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!5090 | 1 天前 | |
refactor: 切换 ApiDeviceTopology API 调用链 Co-authored-by: wangzhensheng<wangzhensheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5090 merge refactor/api-device-topology-route-v2 into master refactor: 切换 ApiDeviceTopology API 调用链 Created-by: wangzhensheng Commit-by: wangzhensheng Merged-by: cann-robot Description: # Pull Request ## 描述 将设备拓扑相关的 RT/RTS C API,从通用 Api 调用链切换到独立的 ApiDeviceTopology 调用链,它承接前面新增ApiDeviceTopology/ApiImplDeviceTopology 框架的 PR4874 和 PR4996,属于实际入口迁移阶段。 **调用链变化** text 调整前: 设备拓扑 C API -> Api::Instance() -> ApiImpl 调整后: 设备拓扑 C API -> ApiDeviceTopology::Instance() -> ApiImplDeviceTopology **迁移的接口** 新增 api_c_device_topology.cc,集中承载26个公开入口,对应16个 ApiDeviceTopology 内部方法: - 设备数量:rtGetDeviceCount、rtsGetDeviceCount - 物理 ID/设备索引转换: rtGetDevicePhyIdByIndex、rtGetDeviceIndexByPhyId、rtsGetLogicDevIdByPhyDevId、rtsGetPhyDevIdByLogicDevId - 用户 ID/逻辑 ID转换: rt/rtsGetLogicDevIdByUserDevId、rt/rtsGetUserDevIdByLogicDevId - P2P 控制和查询: rt/rtsEnableP2P、rt/rtsDisableP2P、rt/rtsDeviceCanAccessPeer、rt/rtsGetP2PStatus - 设备对信息: rtGetPairDevicesInfo、rtsGetPairDevicesInfo、rtGetPairPhyDevicesInfo - 设备标识: rtGetDeviceUuid、rtDeviceGetPCIBusId、rtDeviceGetByPCIBusId - 原子操作能力: rtDeviceGetHostAtomicCapabilities、rtDeviceGetP2PAtomicCapabilities 原定义分别从 api_c_device.cc 和 api_c_memory.cc 删除。 **平台处理** - 标准 Runtime、CModel:编译新的 C API 文件,并使用完整的 ApiImplDeviceTopology。 - Tiny:将全部26个接口加入不支持列表,使用 api_impl_device_topology_stub.cc,对外返回 ACL_ERROR_RT_FEATURE_NOT_SUPPORT。 - Arch5162:将26个接口在 stub catalog 中统一归类为 device_topology,并把新入口文件加入 weak-real 源列表,由平台桩机制提供不支持实现。 - 910B:增加新入口文件的 UT 编译配置。 **变更边界** 该 PR 只切换 C API 入口,**没有修改 ApiImplDeviceTopology 的功能实现,也没有删除旧 Api/ApiImpl 中的同名方法**,旧实现清理属于后续阶段。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!5090 | 1 天前 | |
【PR】:precommit src/runtime Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !3723 merge master_clang into master 【PR】:precommit src/runtime Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 请清晰准确地描述本次 Pull Request 的意图和变更内容。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [ ] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [ ] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!3723 | 2 个月前 | |
fix: clean code & align rtEschedAckEvent parameter naming Co-authored-by: kongrong<kongrong@hisilicon.com> # message auto-generated for no-merge-commit merge: !5068 merge fix/esched-ack-event-param-format into master fix: clean code & align rtEschedAckEvent parameter naming Created-by: carol696 Commit-by: kongrong Merged-by: cann-robot Description: # Pull Request ## 描述 对齐 rtEschedAckEvent 在 Runtime API 调用链中的参数命名,使实现、接口类、驱动封装和相关 UT 使用与 rt_external_mem.h 声明一致的 subEvtId 命名。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无 ## 如何测试 描述测试此变更的步骤和前提条件: 1. git -c core.whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol diff --check 2. build/tests/ut/runtime/runtime/runtime_utest_api --gtest_filter='ApiEschedRouteTest.RoutesAllApisToApiEsched:ApiEschedRouteTest.MapsSpecialErrors' 3. build/tests/ut/runtime/runtime/test/platform/arch5162/runtime_utest_arch5162 --gtest_filter='*.rtEschedAckEvent:ApiEschedStubTest.*' 4. bash tests/build_ut.sh --ut=runtime --target=runtime_utest_api 测试结果: - diff whitespace 检查通过 - ApiEschedRouteTest 相关过滤用例通过 - arch5162 esched stub 相关过滤用例通过 - runtime_utest_api 构建成功;整套 UT 后续在 runtime_utest_api_910B 的 stream/event 相关用例附近出现 139 段错误,非本次 esched 过滤用例失败 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 无 See merge request: cann/runtime!5068 | 3 天前 | |
fix: 完善 Event 和 Notify 错误信息上报 Co-authored-by: zhangxingxing_xx<zhangxingxing33@hisilicon.com> # message auto-generated for no-merge-commit merge: !5015 merge fix/errmsg-ready-20260916 into master fix: 完善 Event 和 Notify 错误信息上报 Created-by: zhangxinxing_xx Commit-by: zhangxingxing_xx Merged-by: cann-robot Description: # Pull Request ## 描述 修复 Event、Notify 和 CountNotify 部分失败路径的错误分类、诊断信息缺失及重复结构化上报问题。 - Event 未 Record 即查询时间戳、计算耗时或执行受限 Wait 时,补充调用顺序错误;明确 Event 模式切换及捕获状态限制。 - 检查无效时间戳和时间戳频率,避免输出无效计算结果。 - 完善 IPC Notify reset 的不支持说明,以及批量 reset、跨 Server PID 设置和 WaitAndReset 部分生效时的诊断。 - 清理同步、CountNotify 和 external Event 部分中间层的重复上报;halSqTaskSend 在重试结束后按原始驱动错误码上报。 ## 变更类型 - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 1. 已对修改行执行 clang-format 16 格式化,完成 diff 空白检查和提交范围检查。 2. 已静态核对错误码、宏参数、失败分支及返回路径。 3. 本次未添加或修改 UT,未运行 UT 或完整构建。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测(已完成上述静态检查,未进行运行验证) - [ ] 我已更新了相关的文档(本次不涉及文档变更) - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本次包含 15 个 Runtime 源码文件,以一个提交合入 master,不包含整改过程注释和 UT 改动。 See merge request: cann/runtime!5015 | 5 天前 | |
refactor: 拆分并隔离 ApiHostMemory Co-authored-by: kongrong<kongrong@hisilicon.com> # message auto-generated for no-merge-commit merge: !4987 merge refactor/api-host-memory-combined into master refactor: 拆分并隔离 ApiHostMemory Created-by: carol696 Commit-by: kongrong Merged-by: cann-robot Description: # Pull Request ## 描述 本 PR 基于 #4491、#4560、#4663 的内存管理拆分分析,将原 #4813、#4814、#4815 合并为单个 ApiHostMemory 隔离拆分 PR。 本批接口: - rtsMallocHost - rtMallocHost - rtsFreeHost - rtFreeHost - rtFreeHostWithDevSync - rtsHostRegister - rtHostMemMapCapabilities - rtHostRegisterV2 - rtHostGetDevicePointer - rtsHostUnregister - rtMallocHostSharedMemory - rtFreeHostSharedMemory - rtHostGetDevicePointerAddrRange 具体变更: - 合并原三阶段 PR #4813、#4814、#4815 为单 PR:框架新增、C API 路由切换、arch5162/tiny 隔离一次性提交。 - 新增 ApiHostMemory 抽象入口、ApiImplHostMemory 正式实现和 api_c_host_memory.cc C API 入口。 - 将 HostMemory 相关 C API 从主 Api 调用链切换到 ApiHostMemory::Instance()。 - 删除主 Api、ApiImpl、ApiDecorator、ApiErrorDecorator、profile/profile-log decorator 中的旧 HostMemory 转发。 - tiny 编译正式 ApiImplHostMemory 并创建 HostMemory 实现对象;api_c_host_memory.cc 在 tiny stub 目标中作为 weak provider 编译,rtHostGetDevicePointerAddrRange 继续由 generated strong stub 覆盖,保持 tiny 对外 C API 打桩语义。 - ApiImplHostMemory::HostGetDevicePointerAddrRange 真实实现迁移到 api_impl_host_memory.cc;tiny 实现层随正式 ApiImplHostMemory 拥有真实实现,公开 C API 仍由 tiny generated strong stub 保持 feature-not-support;arch5162 继续不创建 HostMemory 实现。 - arch5162 继续使用 api_impl_host_memory_stub.cc,IsImplHostMemorySupported() 返回 false,Runtime 初始化时不挂载 HostMemory 实现。 - 保留原 HostMalloc 配置、UVA、HostRegister、addr range 等注释,并将 ErrMsg/ErrorMessage 上报边界迁移到 HostMemory 专属实现。 - 按检视意见收敛 api_impl_host_memory.cc:删除本地 CheckDeviceIdIsValid、GetReportProfApiData、FillHostMemMngExtInfo 重复实现,改为直接调用 Runtime 公共方法;HostFreeImpl 直接通过当前 driver 调用 PtrGetAttributes;HostMalloc/HostFree 去掉 ProfileLogRecord 层级,保留 Runtime CallApiBegin/End 与 extInfo 填充路径;删除 HostMemory 本地 CurrentContext 包装函数和 DEFAULT_HOST_MEMORY_DEVICE_ID,调用处显式展开为 Runtime::Instance()->CurrentContext(true, DEFAULT_DEVICE_ID)。 - 将 HostGetDevicePointerAddrRange 真实实现从 api_impl_standard_soc.cc 迁移到 api_impl_host_memory.cc,并删除 api_impl_stub.cc 中该成员的 feature-not-support 打桩。 - 同步普通、v200、cmodel、tiny、arch5162、910B 和 UT 的源文件列表。 - 按评审意见补齐 HostMalloc、HostMallocWithCfg 和 HostFree 的 Runtime CallApiBegin/End 覆盖范围,参数、cfg、Context 和 driver 失败路径均保持 begin/end 配对;不额外增加 ApiHostMemory::Instance() thread-local env flags 复位。 行为等价说明: - 支持产品继续编译并使用正式 ApiImplHostMemory。 - tiny 侧 ApiHostMemory 对象创建能力与修改前保持一致;公开 C API 中 rtHostGetDevicePointerAddrRange 继续命中 tiny unsupported generated stub,返回 feature-not-support;实现层直接调用 ApiHostMemory::HostGetDevicePointerAddrRange 时走 api_impl_host_memory.cc 真实实现,count == nullptr 返回 RT_ERROR_INVALID_VALUE。 - arch5162 不编译正式 HostMemory 实现,公开 runtime/ACL HostMemory API 继续由平台 stub 保持 feature-not-support 语义。 - 支持产品中 HostGetDevicePointerAddrRange 补回拆分前 ApiErrorDecorator 的 count 空指针校验,返回码与错误文案 Obtaining the device address range 保持一致。 - rtsMallocHost、rtHostMemMapCapabilities、rtHostGetDevicePointer、rtsHostUnregister、rtHostGetDevicePointerAddrRange 的 feature-not-support 返回码转换保持原 C API 语义。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无 ## 如何测试 描述测试此变更的步骤和前提条件: 1. cmake --build build --target runtime_utest_api_910B -j16:通过。 2. cmake --build build --target runtime_utest_task_910B -j16:通过。 3. cmake --build build --target runtime_utest_tiny_stub -j16:通过。 4. cmake --build build --target runtime_utest_arch5162 -j16:通过。 5. cmake --build build --target runtime_utest_api -j16:通过。 6. build/tests/ut/runtime/runtime/test/platform/910B/runtime_utest_api_910B --gtest_filter=ProfilerTest.HostMallocWithCfgInvalidParamKeepsProfileBeginEndPaired:ProfilerTest.HostMallocInvalidParamKeepsProfileBeginEndPaired:ProfilerTest.HostFreeInvalidParamKeepsProfileBeginEndPaired:通过。 7. build/tests/ut/runtime/runtime/test/platform/910B/runtime_utest_task_910B --gtest_filter=CloudV2IpcApiTest.HostGetDevicePointerAddrRange:通过。 8. build/tests/ut/runtime/runtime/runtime_utest_tiny_stub --gtest_filter=TinyStubTest.api_impl_stub:TinyStubTest.api_c_stub:通过。 9. build/tests/ut/runtime/runtime/test/platform/arch5162/runtime_utest_arch5162 --gtest_filter=Arch5162MemTest.UnsupportedHostMemoryApiImpls_ReturnNotSupport:通过。 10. git -c core.whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol diff --check upstream/master...HEAD:通过。 11. git commit --amend --no-edit:提交钩子 clang-format 与 OAT Compliance Check 通过。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 David 差异化分析:ApiImplDavid 未发现 HostMemory override 或 David 专属 HostMemory 实现,本 PR 不拆 David 专属 HostFunc/HostAtomic/Simt 逻辑;本轮仅将 950 David UT 中 HostMemory forwarding 用例切到新的 ApiHostMemory 边界,David 产品实现继续复用通用 HostMemory 实现。 CMake 行尾处理:本轮未修改 CMake;前序 HostMemory/tiny weak-provider 源文件列表调整保持不变,未为了 diff check 改动无关行尾。 See merge request: cann/runtime!4987 | 1 天前 | |
refactor: 合并 ApiIpcMemory 隔离拆分 Co-authored-by: kongrong<kongrong@hisilicon.com> # message auto-generated for no-merge-commit merge: !4972 merge refactor/api-ipc-memory-combined into master refactor: 合并 ApiIpcMemory 隔离拆分 Created-by: carol696 Commit-by: kongrong Merged-by: cann-robot Description: # Pull Request ## 描述 本 PR 合并 ApiIpcMemory 隔离拆分三阶段代码改动,基于 #4820、#4821、#4822 聚合为一个可验证分支。 具体变更: - 新增 ApiIpcMemory 抽象入口、ApiImplIpcMemory 实现类和 api_impl_ipc_memory_stub.cc,并接入 Runtime 生命周期、创建失败回滚和析构路径。 - 新增 api_c_ipc_memory.cc,将 key-based IPC Memory C API 入口切换到 ApiIpcMemory::Instance()。 - tiny/arch5162 等不支持目标保留公开 C API 符号,由生成桩返回 ACL_ERROR_RT_FEATURE_NOT_SUPPORT。 - 本次补充 tiny 下 rtSetIpcMemorySuperPodPid 不支持桩和 UT,避免 api_c_ipc_memory.cc 被 tiny 排除后缺失公开符号。 - 保留原有注释、参数校验、ErrMsg/ErrorMessage 转换和 feature-not-support 映射;本次未修改无关 CMake 行尾。 - 复核 profiling_agent.cc 中 IPC Memory 三个接口注册:拆分前 ApiImpl::IpcSetMemoryName / IpcOpenMemory / IpcCloseMemory / IpcCloseMemoryByName 无 CallApiBegin/CallApiEnd 上报链路,本 PR 不应扩大 profiling 行为;已删除新实现中的 IPC Memory profiling 调用和 profiling_agent.cc 新增注册,保持拆分前后一致。 - 恢复 api_impl_ipc_memory.cc 中 IpcSetMemoryName / IpcOpenMemory / IpcCloseMemory / IpcCloseMemoryByName / IpcDestroyMemoryName / SetIpcMemPid 的 context 获取为 CurrentContext(true, DEFAULT_DEVICE_ID),保持拆分前 ApiImpl::CurrentContext() 的默认设备隐式 SetDevice 语义;新增“无当前 context + 已配置默认设备”回归用例。 本批拆分 Runtime C API 共 11 个: - rtIpcSetMemoryName - rtIpcDestroyMemoryName - rtIpcOpenMemory - rtIpcCloseMemory - rtSetIpcMemPid - rtSetIpcMemorySuperPodPid - rtIpcMemImportPidInterServer - rtsIpcMemGetExportKey - rtsIpcMemClose - rtsIpcMemImportByKey - rtsIpcMemSetImportPid David 差异化说明: - rtIpcSetMemoryAttr / ApiImpl::IpcSetMemoryAttr 涉及 ApiImplDavid::IpcSetMemoryAttr、CheckIpcMapRoute 和 IPC 属性同步差异逻辑,继续保留在原主 Api + David 重载链路中,本 PR 不拆。 - rtSetIpcMemorySuperPodPid 当前不属于 David 差异接口,已纳入 ApiIpcMemory 路由;tiny 下同样按不支持能力补齐生成桩。 本 PR 不包含: - 不拆分 rtIpcSetMemoryAttr。 - 不扩大到其他 Memory 子模块接口。 - 不做无关格式化或行尾调整。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 描述测试此变更的步骤和前提条件: 1. cmake --build build --target runtime_utest_api -j16:通过。 2. ./build/tests/ut/runtime/runtime/runtime_utest_api --gtest_filter='ApiImplTest.api_impl_ipc_memory_*':3 个用例通过,覆盖新增默认设备隐式 context 回归。 3. ./build/tests/ut/runtime/runtime/runtime_utest_api --gtest_filter='ApiIpcMemoryRouteTest.*:ApiImplTest.api_impl_ipc_memory_*':7 个用例通过。 4. ./build/tests/ut/runtime/runtime/runtime_utest_api --gtest_filter='ProfilerTest.ProfilerCallApiBeginEndDirectReportApiData:ProfilerTest.ProfilerCallApiBeginOffKeepsNestedStackPaired:ProfilerTest.ProfilerCallApiEndWithEmptyStack:ProfilerTest.ProfilerCallApiEndReportsTaskTrack:ProfilerTest.ProfilerCallApiEndStopsWhenTaskTrackReportFails':5 个 profiling 用例通过。 5. cmake --build build --target runtime_utest_api_910B -j16:通过。 6. ./build/tests/ut/runtime/runtime/test/platform/910B/runtime_utest_api_910B --gtest_filter='CloudV2ApiTest.ipc_memory_success:CloudV2ApiTest.rts_ipc_open_with_flag_succ:CloudV2ApiTest2.ipc_open_with_flag_succ:CloudV2ApiTest2.ipc_open_with_flag_error:CloudV2NpuDriverTest.CreateIpcMem_fail:CloudV2NpuDriverTest.SetIpcMemAttr_fail:CloudV2NpuDriverTest.OpenIpcMem_fail:CloudV2NpuDriverTest.CloseIpcMem_fail:CloudV2NpuDriverTest.SetIpcMemPid_fail:RtMemoryApiTest.rtSetIpcMemorySuperPodPid':匹配 9 个 910B IPC Memory 用例通过。 7. 本轮增量 git diff --check 5558ce8ac HEAD:通过;git diff --name-only 5558ce8ac HEAD 仅包含 src/runtime/api/impl/api_impl_ipc_memory.cc 和 tests/ut/runtime/runtime/test/rt_utest_api_impl.cc。 8. 行尾检查:src/runtime/api/impl/api_impl_ipc_memory.cc 和 tests/ut/runtime/runtime/test/rt_utest_api_impl.cc 均为 LF-only。 9. git diff origin/master...HEAD -- src/runtime/core/src/common/profiling_agent.cc:无输出,确认 profiling_agent.cc 对 master 无净差异。 此前 tiny 补充验证: - cmake --build build --target runtime_utest_tiny_stub -j16:通过。 - ./build/tests/ut/runtime/runtime/runtime_utest_tiny_stub --gtest_filter='TinyStubTest.api_c_stub:TinyStubTest.ipc_memory_impl_lifecycle_not_support':2 个用例通过。 - ./build/tests/ut/runtime/runtime/runtime_utest_tiny_stub:65 个用例通过。 - rg -n "rtSetIpcMemorySuperPodPid" build/tests/ut/runtime/runtime/generated/runtime_api_stubs/tiny/api_c_generated_stub.cc:确认 tiny 生成桩包含该符号。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 最新覆盖提交:2198261601a346fb85ee222dea9c1a866ab73d6b。 See merge request: cann/runtime!4972 | 3 天前 | |
feat: 查询类aclrt接口扩展支持函数符号入参 Co-authored-by: chenyang<2082464740@qq.com> # message auto-generated for no-merge-commit merge: !4913 merge acll into master feat: 查询类aclrt接口扩展支持函数符号入参 Created-by: weixin_51634168 Commit-by: chenyang Merged-by: cann-robot Description: # feat: 查询类aclrt接口扩展支持函数符号入参 ## 描述 扩展 8 个查询类 aclrt 接口,使其在兼容现有 aclrtFuncHandle 入参的同时,支持传入核函数符号。接口统一使用 const void* func,不新增 C++ 重载。 | 接口 | 本次变化 | | --- | --- | | aclrtGetFunctionAddr | aclrtFuncHandle → const void*,支持查询 AIC/AIV 起始地址 | | aclrtGetFunctionName | aclrtFuncHandle → const void* | | aclrtGetFunctionAttribute | aclrtFuncHandle → const void* | | aclrtGetFunctionSize | aclrtFuncHandle → const void* | | aclrtFunctionGetBinary | const aclrtFuncHandle → const void* | | aclrtFunctionGetParamCount | 签名原本就是 const void*,本次扩展符号入参处理 | | aclrtFunctionGetParamInfo | 签名原本就是 const void*,本次扩展符号入参处理 | | aclrtFunctionGetAvailDynUbufPerBlock | void* → const void* | Runtime 查询入口通过共用的 ConvertFuncToKernel 解析入参:符号查找成功时使用对应 Kernel;返回“未找到”时按既有函数句柄校验;返回其他错误时保留错误码转换,并补回接口级错误上报和日志刷新。同步更新 ACL 转发、Runtime 声明与 stub,以及接口文档。 ## 变更类型 - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 ## 如何测试 按接口运行定向 UT,原有句柄路径与新增符号路径均通过;本次补充的错误路径和 ACL 转发用例也已通过。 | 接口或场景 | UT 覆盖 | 结果 | | --- | --- | --- | | aclrtGetFunctionAddr | TestFuncGetAddr、TestRtsFuncGetAddr_*:符号成功、句柄回退、符号查询其他错误及下游入参/出参 | PASSED | | aclrtGetFunctionSize | CloudV2ApiKernelTest.TestFuncGetSize*:符号路径及 AIC/AIV 大小 | PASSED | | aclrtGetFunctionName | TestFuncGetName*、TestRtsFuncGetName_*:符号路径 | PASSED | | aclrtGetFunctionAttribute | TestFuncGetAttribute、TestRtFunctionGetAttribute_*:符号路径及属性值 | PASSED | | aclrtFunctionGetBinary | TestRtFunctionGetBinary_*:符号路径及 binary handle | PASSED | | aclrtFunctionGetParamCount | TestRtFunctionGetParamCount_*:符号路径及参数个数 | PASSED | | aclrtFunctionGetParamInfo | TestRtFunctionGetParamInfo_*:符号路径及参数偏移、大小 | PASSED | | aclrtFunctionGetAvailDynUbufPerBlock | TestRtFunctionGetAvailDynUbufPerBlock_*:符号路径、下游 Kernel 及动态 UB 大小 | PASSED | | ACL 层 const void* 转发 | UTEST_ACL_Runtime.aclrtFunctionGetAvailDynUbufPerBlock_ConstSymbolTest:符号原样转发及动态 UB 出参 | PASSED | Runtime 用例使用 runtime_utest_api 和 runtime_utest_api_910B 目标,ACL 用例使用 ascendcl_utest 目标;各接口的定向执行命令沿用原测试记录。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 aclrtFunctionGetParamCount 和 aclrtFunctionGetParamInfo 的公开参数类型未变;本次改变的是它们对函数符号的处理能力。 See merge request: cann/runtime!4913 | 1 天前 | |
【PR】:precommit src/runtime Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !3723 merge master_clang into master 【PR】:precommit src/runtime Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 请清晰准确地描述本次 Pull Request 的意图和变更内容。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [ ] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [ ] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!3723 | 2 个月前 | |
refactor: 切换 ApiDeviceTopology API 调用链 Co-authored-by: wangzhensheng<wangzhensheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5090 merge refactor/api-device-topology-route-v2 into master refactor: 切换 ApiDeviceTopology API 调用链 Created-by: wangzhensheng Commit-by: wangzhensheng Merged-by: cann-robot Description: # Pull Request ## 描述 将设备拓扑相关的 RT/RTS C API,从通用 Api 调用链切换到独立的 ApiDeviceTopology 调用链,它承接前面新增ApiDeviceTopology/ApiImplDeviceTopology 框架的 PR4874 和 PR4996,属于实际入口迁移阶段。 **调用链变化** text 调整前: 设备拓扑 C API -> Api::Instance() -> ApiImpl 调整后: 设备拓扑 C API -> ApiDeviceTopology::Instance() -> ApiImplDeviceTopology **迁移的接口** 新增 api_c_device_topology.cc,集中承载26个公开入口,对应16个 ApiDeviceTopology 内部方法: - 设备数量:rtGetDeviceCount、rtsGetDeviceCount - 物理 ID/设备索引转换: rtGetDevicePhyIdByIndex、rtGetDeviceIndexByPhyId、rtsGetLogicDevIdByPhyDevId、rtsGetPhyDevIdByLogicDevId - 用户 ID/逻辑 ID转换: rt/rtsGetLogicDevIdByUserDevId、rt/rtsGetUserDevIdByLogicDevId - P2P 控制和查询: rt/rtsEnableP2P、rt/rtsDisableP2P、rt/rtsDeviceCanAccessPeer、rt/rtsGetP2PStatus - 设备对信息: rtGetPairDevicesInfo、rtsGetPairDevicesInfo、rtGetPairPhyDevicesInfo - 设备标识: rtGetDeviceUuid、rtDeviceGetPCIBusId、rtDeviceGetByPCIBusId - 原子操作能力: rtDeviceGetHostAtomicCapabilities、rtDeviceGetP2PAtomicCapabilities 原定义分别从 api_c_device.cc 和 api_c_memory.cc 删除。 **平台处理** - 标准 Runtime、CModel:编译新的 C API 文件,并使用完整的 ApiImplDeviceTopology。 - Tiny:将全部26个接口加入不支持列表,使用 api_impl_device_topology_stub.cc,对外返回 ACL_ERROR_RT_FEATURE_NOT_SUPPORT。 - Arch5162:将26个接口在 stub catalog 中统一归类为 device_topology,并把新入口文件加入 weak-real 源列表,由平台桩机制提供不支持实现。 - 910B:增加新入口文件的 UT 编译配置。 **变更边界** 该 PR 只切换 C API 入口,**没有修改 ApiImplDeviceTopology 的功能实现,也没有删除旧 Api/ApiImpl 中的同名方法**,旧实现清理属于后续阶段。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!5090 | 1 天前 | |
fix: errmsg质量加固 Co-authored-by: chingbb<qinbeibei4@huawei.com> # message auto-generated for no-merge-commit merge: !5006 merge errmsg into master fix: errmsg质量加固 Created-by: chingbb Commit-by: chingbb Merged-by: cann-robot Description: # Pull Request ## 描述 针对模型相关高频接口EE9999以及漏报完成排查整改。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue ## 如何测试 1. 编译验证:bash build.sh 2. 确认错误消息格式符合 EE 错误码规范 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 See merge request: cann/runtime!5006 | 1 天前 | |
【PR】: clean code Co-authored-by: wangzhensheng<wangzhensheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5052 merge master into master 【PR】: clean code Created-by: wangzhensheng Commit-by: wangzhensheng Merged-by: cann-robot Description: # Pull Request ## 描述 clean code 1. 对齐 pkg_inc/runtime/runtime/rts/rts_context.h 头文件中 rtsCtxSetSysParamOpt/rtsCtxGetSysParamOpt 的定义与头文件声明: cpp rtsCtxSetSysParamOpt(rtSysParamOpt configOpt, int64_t configVal); rtsCtxGetSysParamOpt(rtSysParamOpt configOpt, int64_t* configVal); 从实现参数中移除了 const修饰: - const rtSysParamOpt → rtSysParamOpt - const int64_t → int64_t - int64_t* const → int64_t* 这些参数都是按值传递,包括指针本身也是按值传递,因此顶层 const 不属于函数类型,不会改变 ABI、参数含义或运行行为。修改只是让实现形式与公开头文件保持一致。 2. 收紧局部变量可变性: cpp rtError_t ret 改为: cpp const rtError_t ret 该变量保存 Driver::GetPairDevicesInfo 的返回值,后续不会重新赋值。 **变更边界** - 只修改 api_c_rt_config.cc 和 api_impl_device_topology.cc - 没有增加、删除或迁移接口 - 没有修改 ApiRtConfig 或 ApiDeviceTopology 调用链 - 没有修改错误码、参数校验和平台实现 - 没有新增或调整测试 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!5052 | 5 天前 | |
refactor: 切换 Snapshot API 调用链 Co-authored-by: l00798094<lishun30@huawei.com> # message auto-generated for no-merge-commit merge: !4896 merge codex/api-snapshot-route into master refactor: 切换 Snapshot API 调用链 Created-by: lexbb Commit-by: l00798094 Merged-by: cann-robot Description: # Pull Request ## 描述 本 PR 是快照管理 API 拆分的“切换调用链”阶段,基于已合入 ApiSnapshot 框架的最新 cann/runtime:master。 本次切换 6 个接口: - aclrtSnapShotProcessLock -> rtSnapShotProcessLock - aclrtSnapShotProcessBackup -> rtSnapShotProcessBackup - aclrtSnapShotProcessRestore -> rtSnapShotProcessRestore - aclrtSnapShotProcessUnlock -> rtSnapShotProcessUnlock - aclrtSnapShotCallbackRegister -> rtSnapShotCallbackRegister - aclrtSnapShotCallbackUnregister -> rtSnapShotCallbackUnregister 具体变更: - 将上述 Runtime C API 的调用对象从主 Api 切换为独立 ApiSnapshot。 - 新增路由 UT,覆盖 6 个接口、错误码映射、不支持芯片前置返回以及组件实例缺失场景。 - rtSnapShotProcessGetState 保持原状,继续在 C API 层直接读取 GlobalStateManager。 行为等价说明: - 芯片能力检查、参数检查顺序和公开返回码不变。 - Lock/Unlock 的回调顺序及全局状态切换不变。 - Backup/Restore 的互斥锁范围、状态前置校验、回调顺序和完成后的状态转换不变。 - Callback Register/Unregister 的参数透传和返回值不变。 - 调用链由 Api::Instance() -> ApiErrorDecorator -> ApiImpl 调整为 ApiSnapshot::Instance() -> ApiImplSnapshot;原 ApiErrorDecorator 中的 Backup/Restore 状态校验已在框架阶段等价收敛至 ApiImplSnapshot。 - 新入口不再执行 Api::Instance() 中与快照无关的 ThreadLocalContainer::SetEnvFlags(0) 附带写入。 本 PR 不包含: - 不修改 rtSnapShotProcessGetState。 - 不删除主 Api/ApiImpl/decorator 中的旧 Snapshot 方法。 - 不执行 arch5162 的最终组件和公共 C API 强桩隔离。 ## 变更类型 - [ ] Bug 修复 - [ ] 新功能 - [ ] 代码风格更新 - [x] 重构 - [x] 测试变动 - [ ] 文档内容更新 ## 关联的Issue 暂无关联 Issue。 ## 如何测试 1. git diff --check:通过。 2. python tests/ut/runtime/runtime/test/cmake/test_generate_runtime_api_stubs.py:9/9 通过。 3. OAT:非法文件类型 0,License Header 问题 0。 4. 新增 rt_utest_api_snapshot_route.cc 路由单测;当前本地环境缺少完整 C++ 构建工具链,需由线上 CI 执行编译和 UT。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关文档 - [x] 标题使用了合适的类型标签 - [x] 已遵守贡献指南和提交格式要求 ## 其他信息 - 本 PR 仅包含提交 041419384 refactor: 切换 Snapshot API 调用链。 - 推荐合入顺序:新增框架 -> 切换调用链 -> arch5162 组件隔离。 - 回退本 PR 后,6 个 C API 将恢复到主 Api 调用链,不影响已合入的 ApiSnapshot 框架。 See merge request: cann/runtime!4896 | 7 天前 | |
fix: SOC version增加dfx,以及sqaddr基类子类归一,以ub互联launch性能提升 Co-authored-by: sunnana_004434229<sunnana@huawei.com> # message auto-generated for no-merge-commit merge: !4931 merge fix/soc-version-log-sqaddr-base into master fix: SOC version增加dfx,以及sqaddr基类子类归一,以ub互联launch性能提升 Created-by: sunnana_004434229 Commit-by: sunnana_004434229 Merged-by: cann-robot Description: # Pull Request ## 描述 SOC version增加dfx,以及sqaddr基类子类归一,以ub互联launch性能提升 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无 ## 如何测试 描述测试此变更的步骤和前提条件: 1. cmake --build build_ut --target ascendcl_cpp_utest runtime_utest_api_910B runtime_utest_arch5162 -j4:构建通过。 2. ascendcl_cpp_utest --gtest_filter='UTEST_ACL_Runtime.aclrtKernelArgsInitByUserMem_*':2 个用例通过;runtime_utest_api_910B --gtest_filter='NewCloudV2ApiTest.create_args_test_02':1 个用例通过;runtime_utest_arch5162 --gtest_filter='*aclrtKernelArgsInitByUserMem*:*rtsKernelArgsInitByUserMem*':2 个用例通过。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 完整生产 runtime 目标因环境缺少 abseil 补丁且网络下载失败未完成;相关源码已由上述 UT 目标成功编译。 See merge request: cann/runtime!4931 | 2 天前 | |
【PR】:precommit src/runtime Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !3723 merge master_clang into master 【PR】:precommit src/runtime Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 请清晰准确地描述本次 Pull Request 的意图和变更内容。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [ ] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [ ] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!3723 | 2 个月前 | |
feat: 查询类aclrt接口扩展支持函数符号入参 Co-authored-by: chenyang<2082464740@qq.com> # message auto-generated for no-merge-commit merge: !4913 merge acll into master feat: 查询类aclrt接口扩展支持函数符号入参 Created-by: weixin_51634168 Commit-by: chenyang Merged-by: cann-robot Description: # feat: 查询类aclrt接口扩展支持函数符号入参 ## 描述 扩展 8 个查询类 aclrt 接口,使其在兼容现有 aclrtFuncHandle 入参的同时,支持传入核函数符号。接口统一使用 const void* func,不新增 C++ 重载。 | 接口 | 本次变化 | | --- | --- | | aclrtGetFunctionAddr | aclrtFuncHandle → const void*,支持查询 AIC/AIV 起始地址 | | aclrtGetFunctionName | aclrtFuncHandle → const void* | | aclrtGetFunctionAttribute | aclrtFuncHandle → const void* | | aclrtGetFunctionSize | aclrtFuncHandle → const void* | | aclrtFunctionGetBinary | const aclrtFuncHandle → const void* | | aclrtFunctionGetParamCount | 签名原本就是 const void*,本次扩展符号入参处理 | | aclrtFunctionGetParamInfo | 签名原本就是 const void*,本次扩展符号入参处理 | | aclrtFunctionGetAvailDynUbufPerBlock | void* → const void* | Runtime 查询入口通过共用的 ConvertFuncToKernel 解析入参:符号查找成功时使用对应 Kernel;返回“未找到”时按既有函数句柄校验;返回其他错误时保留错误码转换,并补回接口级错误上报和日志刷新。同步更新 ACL 转发、Runtime 声明与 stub,以及接口文档。 ## 变更类型 - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 ## 如何测试 按接口运行定向 UT,原有句柄路径与新增符号路径均通过;本次补充的错误路径和 ACL 转发用例也已通过。 | 接口或场景 | UT 覆盖 | 结果 | | --- | --- | --- | | aclrtGetFunctionAddr | TestFuncGetAddr、TestRtsFuncGetAddr_*:符号成功、句柄回退、符号查询其他错误及下游入参/出参 | PASSED | | aclrtGetFunctionSize | CloudV2ApiKernelTest.TestFuncGetSize*:符号路径及 AIC/AIV 大小 | PASSED | | aclrtGetFunctionName | TestFuncGetName*、TestRtsFuncGetName_*:符号路径 | PASSED | | aclrtGetFunctionAttribute | TestFuncGetAttribute、TestRtFunctionGetAttribute_*:符号路径及属性值 | PASSED | | aclrtFunctionGetBinary | TestRtFunctionGetBinary_*:符号路径及 binary handle | PASSED | | aclrtFunctionGetParamCount | TestRtFunctionGetParamCount_*:符号路径及参数个数 | PASSED | | aclrtFunctionGetParamInfo | TestRtFunctionGetParamInfo_*:符号路径及参数偏移、大小 | PASSED | | aclrtFunctionGetAvailDynUbufPerBlock | TestRtFunctionGetAvailDynUbufPerBlock_*:符号路径、下游 Kernel 及动态 UB 大小 | PASSED | | ACL 层 const void* 转发 | UTEST_ACL_Runtime.aclrtFunctionGetAvailDynUbufPerBlock_ConstSymbolTest:符号原样转发及动态 UB 出参 | PASSED | Runtime 用例使用 runtime_utest_api 和 runtime_utest_api_910B 目标,ACL 用例使用 ascendcl_utest 目标;各接口的定向执行命令沿用原测试记录。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 aclrtFunctionGetParamCount 和 aclrtFunctionGetParamInfo 的公开参数类型未变;本次改变的是它们对函数符号的处理能力。 See merge request: cann/runtime!4913 | 1 天前 | |
【PR】: fix ErrMsg Co-authored-by: x00508183<xiachanglin@huawei.com> # message auto-generated for no-merge-commit merge: !4759 merge master into master 【PR】: fix ErrMsg Created-by: xiachanglin Commit-by: x00508183 Merged-by: cann-robot Description: # Pull Request ## 描述 ErrMsg整改。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [ ] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [ ] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!4759 | 5 天前 | |
fix: errmsg质量加固 Co-authored-by: chingbb<qinbeibei4@huawei.com> # message auto-generated for no-merge-commit merge: !5006 merge errmsg into master fix: errmsg质量加固 Created-by: chingbb Commit-by: chingbb Merged-by: cann-robot Description: # Pull Request ## 描述 针对模型相关高频接口EE9999以及漏报完成排查整改。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue ## 如何测试 1. 编译验证:bash build.sh 2. 确认错误消息格式符合 EE 错误码规范 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 See merge request: cann/runtime!5006 | 1 天前 | |
【feat】: merge back arch5162 mem alloc Co-authored-by: kongrong<kongrong@hisilicon.com> # message auto-generated for no-merge-commit merge: !3969 merge master into master 【feat】: merge back arch5162 mem alloc Created-by: carol696 Commit-by: kongrong Merged-by: cann-robot Description: # Pull Request ## 描述 请清晰准确地描述本次 Pull Request 的意图和变更内容。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!3969 | 1 个月前 | |
refactor: 收敛memMng公共方法到runtime并聚类UVM Co-authored-by: kongrong<kongrong@hisilicon.com> # message auto-generated for no-merge-commit merge: !4955 merge refactor/api-uvm-runtime-convergence into master refactor: 收敛memMng公共方法到runtime并聚类UVM Created-by: carol696 Commit-by: kongrong Merged-by: cann-robot Description: # Pull Request ## 描述 从 #4909 中抽取 UVM 相关的公共方法收敛和文件归位改动,不引入 ApiUvm/ApiImplUvm 框架代码。 本 PR 主要包含: - 将 ApiImpl::GetDeviceCount 和 ApiImpl::GetDevice 的主体逻辑收敛到 Runtime 公共方法,主 API 侧保留委托调用。 - 将 profiler 内存 extInfo 填充公共逻辑收敛到 Runtime,保持上报字段和设备号转换逻辑一致。 - 将 rtMemAllocManaged / rtMemFreeManaged C 入口移动到 api_c_uvm.cc。 - 将 ManagedMemAlloc / ManagedMemFree 实现移动到 api_impl_uvm.cc,使 UVM C 入口和实现集中在 UVM 文件。 本 PR 不修改 CMake,不新增 UVM 框架类,不切换 UVM 调用链到新组件。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 描述测试此变更的步骤和前提条件: 1. bash tests/build_ut.sh --ut=runtime --target=runtime_utest_api:构建成功,runtime_utest_api.xml 显示 593 tests / 0 failures / 0 errors。 2. build/tests/ut/runtime/runtime/runtime_utest_api --gtest_filter='ProfilerTest.ApiProfileDecoratorMemCopySyncExtInfo:ProfilerTest.ApiProfileDecoratorMemCopySyncFailedNoExtInfo:ProfilerTest.RuntimeProfileMemcpyExtInfoUsesCurrentDeviceId:ProfilerTest.RuntimeGetCurrentDeviceIdMatchesRtGetDevice:ProfilerTest.RuntimeProfileDeviceIdOverflow:ProfilerTest.ApiProfileDecoratorMemSetSyncExtInfo:ProfilerTest.ApiProfileDecoratorMemSetSyncFailedNoExtInfo:ProfilerTest.ApiProfileDecoratorDevMallocExtInfo:ProfilerTest.ApiProfileDecoratorDevMallocFailedNoExtInfo:ProfilerTest.ApiProfileDecoratorDevFreeExtInfo:ProfilerTest.ApiProfileDecoratorMemMngMemoryTypeExtInfo:ProfilerTest.ApiProfileDecoratorSetMemcpyDescExtInfo:ProfilerTest.ApiProfileDecoratorMemcpyBatchSingleKindExtInfo:ProfilerTest.ApiProfileDecoratorMemcpyBatchMultiKindExtInfo:ProfilerTest.ApiProfileDecoratorMemcpyBatchAsyncStreamId:ProfilerTest.ApiProfileDecoratorMemcpyBatchCopyKindBranches:ProfilerTest.ApiProfileDecoratorMemoryWrappersFillExtInfo:ProfilerTest.ApiProfileDecoratorMemcpyAndMemsetWrappersFillExtInfo:ProfilerTest.ApiProfileDecoratorMemcpyBatchWrappersFillExtInfo':19 tests passed。 3. git -c core.whitespace=cr-at-eol diff --check:通过。 4. rg 扫描确认 UVM C 入口和 ApiImpl 实现均集中在 api_c_uvm.cc / api_impl_uvm.cc。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 - 本 PR 从 #4909 抽取窄范围改动,避免引入框架代码。 - 已确认未修改 CMake 文件,未做无关行尾转换;原代码注释已保留在迁移后位置。 See merge request: cann/runtime!4955 | 7 天前 | |
【PR】:precommit src/runtime Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !3723 merge master_clang into master 【PR】:precommit src/runtime Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 请清晰准确地描述本次 Pull Request 的意图和变更内容。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [ ] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [ ] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!3723 | 2 个月前 | |
【PR】:precommit src/runtime Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !3723 merge master_clang into master 【PR】:precommit src/runtime Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 请清晰准确地描述本次 Pull Request 的意图和变更内容。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [ ] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [ ] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!3723 | 2 个月前 | |
refactor: 扩展 ApiDeviceTopology 框架 Co-authored-by: wangzhensheng<wangzhensheng4@huawei.com> # message auto-generated for no-merge-commit merge: !4996 merge refactor/api-device-topology-framework-expand-1 into master refactor: 扩展 ApiDeviceTopology 框架 Created-by: wangzhensheng Commit-by: wangzhensheng Merged-by: cann-robot Description: # Pull Request ## 描述 扩展 ApiDeviceTopology/ApiImplDeviceTopology 框架,将设备枚举、设备 ID 映射、UUID/PCI 信息及原子操作能力查询纳入设备拓扑模块。本次仍属于框架准备阶段,尚未切换对应的 C API 调用入口。 **主要变更** ApiDeviceTopology 新增 10 个纯虚接口,ApiImplDeviceTopology 补齐对应实现: - 设备枚举:GetDeviceCount - 物理 ID 与设备索引转换: GetDevicePhyIdByIndex、GetDeviceIndexByPhyId - 用户 ID 与逻辑 ID 转换: GetLogicDevIdByUserDevId、GetUserDevIdByLogicDevId - 设备标识查询: GetDeviceUuid、GetDevicePCIBusId、GetDeviceByPCIBusId - 原子操作能力查询: GetHostAtomicCapabilities、GetP2PAtomicCapabilities ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!4996 | 5 天前 | |
fix: clean code & align rtEschedAckEvent parameter naming Co-authored-by: kongrong<kongrong@hisilicon.com> # message auto-generated for no-merge-commit merge: !5068 merge fix/esched-ack-event-param-format into master fix: clean code & align rtEschedAckEvent parameter naming Created-by: carol696 Commit-by: kongrong Merged-by: cann-robot Description: # Pull Request ## 描述 对齐 rtEschedAckEvent 在 Runtime API 调用链中的参数命名,使实现、接口类、驱动封装和相关 UT 使用与 rt_external_mem.h 声明一致的 subEvtId 命名。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无 ## 如何测试 描述测试此变更的步骤和前提条件: 1. git -c core.whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol diff --check 2. build/tests/ut/runtime/runtime/runtime_utest_api --gtest_filter='ApiEschedRouteTest.RoutesAllApisToApiEsched:ApiEschedRouteTest.MapsSpecialErrors' 3. build/tests/ut/runtime/runtime/test/platform/arch5162/runtime_utest_arch5162 --gtest_filter='*.rtEschedAckEvent:ApiEschedStubTest.*' 4. bash tests/build_ut.sh --ut=runtime --target=runtime_utest_api 测试结果: - diff whitespace 检查通过 - ApiEschedRouteTest 相关过滤用例通过 - arch5162 esched stub 相关过滤用例通过 - runtime_utest_api 构建成功;整套 UT 后续在 runtime_utest_api_910B 的 stream/event 相关用例附近出现 139 段错误,非本次 esched 过滤用例失败 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 无 See merge request: cann/runtime!5068 | 3 天前 | |
style: 统一 Event 接口声明与实现参数命名 Co-authored-by: zhangpengpeng8<zhangpengpeng8@hisilicon.com> # message auto-generated for no-merge-commit merge: !4507 merge master into master style: 统一 Event 接口声明与实现参数命名 Created-by: zhangpengpeng8 Commit-by: zhangpengpeng8 Merged-by: cann-robot Description: # Pull Request ## 描述 Event 接口声明和 ApiImplEvent 各产品实现中部分形参仍使用缩写或通用返回值名称,与 Runtime C API 层表达的参数语义不一致。本 PR 统一抽象接口、override 声明以及 common、tiny、stub 实现中的参数命名: - EventElapsedTime:retTime、startEvt、endEvt 分别调整为 timeInterval、startEvent、endEvent。 - EventGetTimeStamp:retTime 调整为 timeStamp。 - IpcGetEventHandle:evt 调整为 event。 实现函数体中的变量引用和 IPC Event 错误详情字段同步使用新名称。本次不改变函数返回类型、参数类型、参数顺序、const 限定、控制流程或返回行为,因此不影响 ABI 和运行逻辑。 ## 影响范围 - src/runtime/api/api_event.hpp - src/runtime/api/impl/api_impl_event.hpp - src/runtime/api/impl/api_impl_event.cc - src/runtime/api/impl/api_impl_event_common.cc - src/runtime/api/impl/api_impl_event_tiny_stub.cc - src/runtime/api/impl/api_impl_stub.cc ## 变更类型 - [ ] Bug 修复 - [ ] 新功能 - [x] 代码风格更新(命名一致性) - [ ] 重构(既不修复错误也不增加功能的代码变动) - [ ] 构建过程或辅助工具的变动 - [ ] 文档内容更新 ## 关联的 Issue 无。 ## 如何测试 1. 对 PR 最终 patchset 执行 pre-commit 检查。 2. clang-format:通过。 3. OAT Compliance Check:通过。 4. 构建 runtime_utest_tiny_stub:通过,覆盖 tiny 和通用 stub 实现。 5. 运行 runtime_utest_tiny_stub:61/61 通过。 6. 构建 runtimeut_src_static_lib:通过,覆盖标准 api_impl_event.cc 和 api_impl_event_common.cc 实现。 7. 线上 /compile:当前 head 的主编译流水线 27/27 通过,静态检查流水线 11/11 通过。 ## 核对清单 - [x] 我的代码遵循项目代码风格。 - [x] 已完成变更范围的静态检查。 - [x] 本次无需更新用户文档。 - [x] 标题使用了合适的类型标签。 - [x] 已阅读并遵守贡献指南。 ## 其他信息 当前 PR head 为 f1e0f8a0fb010c43aefd3797c95677f22664712f。 See merge request: cann/runtime!4507 | 26 天前 | |
【fix】: 修改error message语义化描述 Co-authored-by: DanielTANG<tangyuliang5@huawei.com> # message auto-generated for no-merge-commit merge: !3990 merge error_msg_fix into master 【fix】: 修改error message语义化描述 Created-by: Tacode Commit-by: DanielTANG Merged-by: cann-robot Description: # Pull Request ## 描述 修改error message语义化描述,修改显示传递__func__调用点 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> None ## 如何测试 UT以及集成测试 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!3990 | 1 个月前 | |
【PR】:precommit src/runtime Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !3723 merge master_clang into master 【PR】:precommit src/runtime Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 请清晰准确地描述本次 Pull Request 的意图和变更内容。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [ ] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [ ] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!3723 | 2 个月前 | |
feat: 查询类aclrt接口扩展支持函数符号入参 Co-authored-by: chenyang<2082464740@qq.com> # message auto-generated for no-merge-commit merge: !4913 merge acll into master feat: 查询类aclrt接口扩展支持函数符号入参 Created-by: weixin_51634168 Commit-by: chenyang Merged-by: cann-robot Description: # feat: 查询类aclrt接口扩展支持函数符号入参 ## 描述 扩展 8 个查询类 aclrt 接口,使其在兼容现有 aclrtFuncHandle 入参的同时,支持传入核函数符号。接口统一使用 const void* func,不新增 C++ 重载。 | 接口 | 本次变化 | | --- | --- | | aclrtGetFunctionAddr | aclrtFuncHandle → const void*,支持查询 AIC/AIV 起始地址 | | aclrtGetFunctionName | aclrtFuncHandle → const void* | | aclrtGetFunctionAttribute | aclrtFuncHandle → const void* | | aclrtGetFunctionSize | aclrtFuncHandle → const void* | | aclrtFunctionGetBinary | const aclrtFuncHandle → const void* | | aclrtFunctionGetParamCount | 签名原本就是 const void*,本次扩展符号入参处理 | | aclrtFunctionGetParamInfo | 签名原本就是 const void*,本次扩展符号入参处理 | | aclrtFunctionGetAvailDynUbufPerBlock | void* → const void* | Runtime 查询入口通过共用的 ConvertFuncToKernel 解析入参:符号查找成功时使用对应 Kernel;返回“未找到”时按既有函数句柄校验;返回其他错误时保留错误码转换,并补回接口级错误上报和日志刷新。同步更新 ACL 转发、Runtime 声明与 stub,以及接口文档。 ## 变更类型 - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 ## 如何测试 按接口运行定向 UT,原有句柄路径与新增符号路径均通过;本次补充的错误路径和 ACL 转发用例也已通过。 | 接口或场景 | UT 覆盖 | 结果 | | --- | --- | --- | | aclrtGetFunctionAddr | TestFuncGetAddr、TestRtsFuncGetAddr_*:符号成功、句柄回退、符号查询其他错误及下游入参/出参 | PASSED | | aclrtGetFunctionSize | CloudV2ApiKernelTest.TestFuncGetSize*:符号路径及 AIC/AIV 大小 | PASSED | | aclrtGetFunctionName | TestFuncGetName*、TestRtsFuncGetName_*:符号路径 | PASSED | | aclrtGetFunctionAttribute | TestFuncGetAttribute、TestRtFunctionGetAttribute_*:符号路径及属性值 | PASSED | | aclrtFunctionGetBinary | TestRtFunctionGetBinary_*:符号路径及 binary handle | PASSED | | aclrtFunctionGetParamCount | TestRtFunctionGetParamCount_*:符号路径及参数个数 | PASSED | | aclrtFunctionGetParamInfo | TestRtFunctionGetParamInfo_*:符号路径及参数偏移、大小 | PASSED | | aclrtFunctionGetAvailDynUbufPerBlock | TestRtFunctionGetAvailDynUbufPerBlock_*:符号路径、下游 Kernel 及动态 UB 大小 | PASSED | | ACL 层 const void* 转发 | UTEST_ACL_Runtime.aclrtFunctionGetAvailDynUbufPerBlock_ConstSymbolTest:符号原样转发及动态 UB 出参 | PASSED | Runtime 用例使用 runtime_utest_api 和 runtime_utest_api_910B 目标,ACL 用例使用 ascendcl_utest 目标;各接口的定向执行命令沿用原测试记录。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 aclrtFunctionGetParamCount 和 aclrtFunctionGetParamInfo 的公开参数类型未变;本次改变的是它们对函数符号的处理能力。 See merge request: cann/runtime!4913 | 1 天前 | |
feat: 查询类aclrt接口扩展支持函数符号入参 Co-authored-by: chenyang<2082464740@qq.com> # message auto-generated for no-merge-commit merge: !4913 merge acll into master feat: 查询类aclrt接口扩展支持函数符号入参 Created-by: weixin_51634168 Commit-by: chenyang Merged-by: cann-robot Description: # feat: 查询类aclrt接口扩展支持函数符号入参 ## 描述 扩展 8 个查询类 aclrt 接口,使其在兼容现有 aclrtFuncHandle 入参的同时,支持传入核函数符号。接口统一使用 const void* func,不新增 C++ 重载。 | 接口 | 本次变化 | | --- | --- | | aclrtGetFunctionAddr | aclrtFuncHandle → const void*,支持查询 AIC/AIV 起始地址 | | aclrtGetFunctionName | aclrtFuncHandle → const void* | | aclrtGetFunctionAttribute | aclrtFuncHandle → const void* | | aclrtGetFunctionSize | aclrtFuncHandle → const void* | | aclrtFunctionGetBinary | const aclrtFuncHandle → const void* | | aclrtFunctionGetParamCount | 签名原本就是 const void*,本次扩展符号入参处理 | | aclrtFunctionGetParamInfo | 签名原本就是 const void*,本次扩展符号入参处理 | | aclrtFunctionGetAvailDynUbufPerBlock | void* → const void* | Runtime 查询入口通过共用的 ConvertFuncToKernel 解析入参:符号查找成功时使用对应 Kernel;返回“未找到”时按既有函数句柄校验;返回其他错误时保留错误码转换,并补回接口级错误上报和日志刷新。同步更新 ACL 转发、Runtime 声明与 stub,以及接口文档。 ## 变更类型 - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 ## 如何测试 按接口运行定向 UT,原有句柄路径与新增符号路径均通过;本次补充的错误路径和 ACL 转发用例也已通过。 | 接口或场景 | UT 覆盖 | 结果 | | --- | --- | --- | | aclrtGetFunctionAddr | TestFuncGetAddr、TestRtsFuncGetAddr_*:符号成功、句柄回退、符号查询其他错误及下游入参/出参 | PASSED | | aclrtGetFunctionSize | CloudV2ApiKernelTest.TestFuncGetSize*:符号路径及 AIC/AIV 大小 | PASSED | | aclrtGetFunctionName | TestFuncGetName*、TestRtsFuncGetName_*:符号路径 | PASSED | | aclrtGetFunctionAttribute | TestFuncGetAttribute、TestRtFunctionGetAttribute_*:符号路径及属性值 | PASSED | | aclrtFunctionGetBinary | TestRtFunctionGetBinary_*:符号路径及 binary handle | PASSED | | aclrtFunctionGetParamCount | TestRtFunctionGetParamCount_*:符号路径及参数个数 | PASSED | | aclrtFunctionGetParamInfo | TestRtFunctionGetParamInfo_*:符号路径及参数偏移、大小 | PASSED | | aclrtFunctionGetAvailDynUbufPerBlock | TestRtFunctionGetAvailDynUbufPerBlock_*:符号路径、下游 Kernel 及动态 UB 大小 | PASSED | | ACL 层 const void* 转发 | UTEST_ACL_Runtime.aclrtFunctionGetAvailDynUbufPerBlock_ConstSymbolTest:符号原样转发及动态 UB 出参 | PASSED | Runtime 用例使用 runtime_utest_api 和 runtime_utest_api_910B 目标,ACL 用例使用 ascendcl_utest 目标;各接口的定向执行命令沿用原测试记录。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 aclrtFunctionGetParamCount 和 aclrtFunctionGetParamInfo 的公开参数类型未变;本次改变的是它们对函数符号的处理能力。 See merge request: cann/runtime!4913 | 1 天前 | |
refactor: 拆分并隔离 ApiHostMemory Co-authored-by: kongrong<kongrong@hisilicon.com> # message auto-generated for no-merge-commit merge: !4987 merge refactor/api-host-memory-combined into master refactor: 拆分并隔离 ApiHostMemory Created-by: carol696 Commit-by: kongrong Merged-by: cann-robot Description: # Pull Request ## 描述 本 PR 基于 #4491、#4560、#4663 的内存管理拆分分析,将原 #4813、#4814、#4815 合并为单个 ApiHostMemory 隔离拆分 PR。 本批接口: - rtsMallocHost - rtMallocHost - rtsFreeHost - rtFreeHost - rtFreeHostWithDevSync - rtsHostRegister - rtHostMemMapCapabilities - rtHostRegisterV2 - rtHostGetDevicePointer - rtsHostUnregister - rtMallocHostSharedMemory - rtFreeHostSharedMemory - rtHostGetDevicePointerAddrRange 具体变更: - 合并原三阶段 PR #4813、#4814、#4815 为单 PR:框架新增、C API 路由切换、arch5162/tiny 隔离一次性提交。 - 新增 ApiHostMemory 抽象入口、ApiImplHostMemory 正式实现和 api_c_host_memory.cc C API 入口。 - 将 HostMemory 相关 C API 从主 Api 调用链切换到 ApiHostMemory::Instance()。 - 删除主 Api、ApiImpl、ApiDecorator、ApiErrorDecorator、profile/profile-log decorator 中的旧 HostMemory 转发。 - tiny 编译正式 ApiImplHostMemory 并创建 HostMemory 实现对象;api_c_host_memory.cc 在 tiny stub 目标中作为 weak provider 编译,rtHostGetDevicePointerAddrRange 继续由 generated strong stub 覆盖,保持 tiny 对外 C API 打桩语义。 - ApiImplHostMemory::HostGetDevicePointerAddrRange 真实实现迁移到 api_impl_host_memory.cc;tiny 实现层随正式 ApiImplHostMemory 拥有真实实现,公开 C API 仍由 tiny generated strong stub 保持 feature-not-support;arch5162 继续不创建 HostMemory 实现。 - arch5162 继续使用 api_impl_host_memory_stub.cc,IsImplHostMemorySupported() 返回 false,Runtime 初始化时不挂载 HostMemory 实现。 - 保留原 HostMalloc 配置、UVA、HostRegister、addr range 等注释,并将 ErrMsg/ErrorMessage 上报边界迁移到 HostMemory 专属实现。 - 按检视意见收敛 api_impl_host_memory.cc:删除本地 CheckDeviceIdIsValid、GetReportProfApiData、FillHostMemMngExtInfo 重复实现,改为直接调用 Runtime 公共方法;HostFreeImpl 直接通过当前 driver 调用 PtrGetAttributes;HostMalloc/HostFree 去掉 ProfileLogRecord 层级,保留 Runtime CallApiBegin/End 与 extInfo 填充路径;删除 HostMemory 本地 CurrentContext 包装函数和 DEFAULT_HOST_MEMORY_DEVICE_ID,调用处显式展开为 Runtime::Instance()->CurrentContext(true, DEFAULT_DEVICE_ID)。 - 将 HostGetDevicePointerAddrRange 真实实现从 api_impl_standard_soc.cc 迁移到 api_impl_host_memory.cc,并删除 api_impl_stub.cc 中该成员的 feature-not-support 打桩。 - 同步普通、v200、cmodel、tiny、arch5162、910B 和 UT 的源文件列表。 - 按评审意见补齐 HostMalloc、HostMallocWithCfg 和 HostFree 的 Runtime CallApiBegin/End 覆盖范围,参数、cfg、Context 和 driver 失败路径均保持 begin/end 配对;不额外增加 ApiHostMemory::Instance() thread-local env flags 复位。 行为等价说明: - 支持产品继续编译并使用正式 ApiImplHostMemory。 - tiny 侧 ApiHostMemory 对象创建能力与修改前保持一致;公开 C API 中 rtHostGetDevicePointerAddrRange 继续命中 tiny unsupported generated stub,返回 feature-not-support;实现层直接调用 ApiHostMemory::HostGetDevicePointerAddrRange 时走 api_impl_host_memory.cc 真实实现,count == nullptr 返回 RT_ERROR_INVALID_VALUE。 - arch5162 不编译正式 HostMemory 实现,公开 runtime/ACL HostMemory API 继续由平台 stub 保持 feature-not-support 语义。 - 支持产品中 HostGetDevicePointerAddrRange 补回拆分前 ApiErrorDecorator 的 count 空指针校验,返回码与错误文案 Obtaining the device address range 保持一致。 - rtsMallocHost、rtHostMemMapCapabilities、rtHostGetDevicePointer、rtsHostUnregister、rtHostGetDevicePointerAddrRange 的 feature-not-support 返回码转换保持原 C API 语义。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无 ## 如何测试 描述测试此变更的步骤和前提条件: 1. cmake --build build --target runtime_utest_api_910B -j16:通过。 2. cmake --build build --target runtime_utest_task_910B -j16:通过。 3. cmake --build build --target runtime_utest_tiny_stub -j16:通过。 4. cmake --build build --target runtime_utest_arch5162 -j16:通过。 5. cmake --build build --target runtime_utest_api -j16:通过。 6. build/tests/ut/runtime/runtime/test/platform/910B/runtime_utest_api_910B --gtest_filter=ProfilerTest.HostMallocWithCfgInvalidParamKeepsProfileBeginEndPaired:ProfilerTest.HostMallocInvalidParamKeepsProfileBeginEndPaired:ProfilerTest.HostFreeInvalidParamKeepsProfileBeginEndPaired:通过。 7. build/tests/ut/runtime/runtime/test/platform/910B/runtime_utest_task_910B --gtest_filter=CloudV2IpcApiTest.HostGetDevicePointerAddrRange:通过。 8. build/tests/ut/runtime/runtime/runtime_utest_tiny_stub --gtest_filter=TinyStubTest.api_impl_stub:TinyStubTest.api_c_stub:通过。 9. build/tests/ut/runtime/runtime/test/platform/arch5162/runtime_utest_arch5162 --gtest_filter=Arch5162MemTest.UnsupportedHostMemoryApiImpls_ReturnNotSupport:通过。 10. git -c core.whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol diff --check upstream/master...HEAD:通过。 11. git commit --amend --no-edit:提交钩子 clang-format 与 OAT Compliance Check 通过。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 David 差异化分析:ApiImplDavid 未发现 HostMemory override 或 David 专属 HostMemory 实现,本 PR 不拆 David 专属 HostFunc/HostAtomic/Simt 逻辑;本轮仅将 950 David UT 中 HostMemory forwarding 用例切到新的 ApiHostMemory 边界,David 产品实现继续复用通用 HostMemory 实现。 CMake 行尾处理:本轮未修改 CMake;前序 HostMemory/tiny weak-provider 源文件列表调整保持不变,未为了 diff check 改动无关行尾。 See merge request: cann/runtime!4987 | 1 天前 | |
refactor: 合并 ApiIpcMemory 隔离拆分 Co-authored-by: kongrong<kongrong@hisilicon.com> # message auto-generated for no-merge-commit merge: !4972 merge refactor/api-ipc-memory-combined into master refactor: 合并 ApiIpcMemory 隔离拆分 Created-by: carol696 Commit-by: kongrong Merged-by: cann-robot Description: # Pull Request ## 描述 本 PR 合并 ApiIpcMemory 隔离拆分三阶段代码改动,基于 #4820、#4821、#4822 聚合为一个可验证分支。 具体变更: - 新增 ApiIpcMemory 抽象入口、ApiImplIpcMemory 实现类和 api_impl_ipc_memory_stub.cc,并接入 Runtime 生命周期、创建失败回滚和析构路径。 - 新增 api_c_ipc_memory.cc,将 key-based IPC Memory C API 入口切换到 ApiIpcMemory::Instance()。 - tiny/arch5162 等不支持目标保留公开 C API 符号,由生成桩返回 ACL_ERROR_RT_FEATURE_NOT_SUPPORT。 - 本次补充 tiny 下 rtSetIpcMemorySuperPodPid 不支持桩和 UT,避免 api_c_ipc_memory.cc 被 tiny 排除后缺失公开符号。 - 保留原有注释、参数校验、ErrMsg/ErrorMessage 转换和 feature-not-support 映射;本次未修改无关 CMake 行尾。 - 复核 profiling_agent.cc 中 IPC Memory 三个接口注册:拆分前 ApiImpl::IpcSetMemoryName / IpcOpenMemory / IpcCloseMemory / IpcCloseMemoryByName 无 CallApiBegin/CallApiEnd 上报链路,本 PR 不应扩大 profiling 行为;已删除新实现中的 IPC Memory profiling 调用和 profiling_agent.cc 新增注册,保持拆分前后一致。 - 恢复 api_impl_ipc_memory.cc 中 IpcSetMemoryName / IpcOpenMemory / IpcCloseMemory / IpcCloseMemoryByName / IpcDestroyMemoryName / SetIpcMemPid 的 context 获取为 CurrentContext(true, DEFAULT_DEVICE_ID),保持拆分前 ApiImpl::CurrentContext() 的默认设备隐式 SetDevice 语义;新增“无当前 context + 已配置默认设备”回归用例。 本批拆分 Runtime C API 共 11 个: - rtIpcSetMemoryName - rtIpcDestroyMemoryName - rtIpcOpenMemory - rtIpcCloseMemory - rtSetIpcMemPid - rtSetIpcMemorySuperPodPid - rtIpcMemImportPidInterServer - rtsIpcMemGetExportKey - rtsIpcMemClose - rtsIpcMemImportByKey - rtsIpcMemSetImportPid David 差异化说明: - rtIpcSetMemoryAttr / ApiImpl::IpcSetMemoryAttr 涉及 ApiImplDavid::IpcSetMemoryAttr、CheckIpcMapRoute 和 IPC 属性同步差异逻辑,继续保留在原主 Api + David 重载链路中,本 PR 不拆。 - rtSetIpcMemorySuperPodPid 当前不属于 David 差异接口,已纳入 ApiIpcMemory 路由;tiny 下同样按不支持能力补齐生成桩。 本 PR 不包含: - 不拆分 rtIpcSetMemoryAttr。 - 不扩大到其他 Memory 子模块接口。 - 不做无关格式化或行尾调整。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 描述测试此变更的步骤和前提条件: 1. cmake --build build --target runtime_utest_api -j16:通过。 2. ./build/tests/ut/runtime/runtime/runtime_utest_api --gtest_filter='ApiImplTest.api_impl_ipc_memory_*':3 个用例通过,覆盖新增默认设备隐式 context 回归。 3. ./build/tests/ut/runtime/runtime/runtime_utest_api --gtest_filter='ApiIpcMemoryRouteTest.*:ApiImplTest.api_impl_ipc_memory_*':7 个用例通过。 4. ./build/tests/ut/runtime/runtime/runtime_utest_api --gtest_filter='ProfilerTest.ProfilerCallApiBeginEndDirectReportApiData:ProfilerTest.ProfilerCallApiBeginOffKeepsNestedStackPaired:ProfilerTest.ProfilerCallApiEndWithEmptyStack:ProfilerTest.ProfilerCallApiEndReportsTaskTrack:ProfilerTest.ProfilerCallApiEndStopsWhenTaskTrackReportFails':5 个 profiling 用例通过。 5. cmake --build build --target runtime_utest_api_910B -j16:通过。 6. ./build/tests/ut/runtime/runtime/test/platform/910B/runtime_utest_api_910B --gtest_filter='CloudV2ApiTest.ipc_memory_success:CloudV2ApiTest.rts_ipc_open_with_flag_succ:CloudV2ApiTest2.ipc_open_with_flag_succ:CloudV2ApiTest2.ipc_open_with_flag_error:CloudV2NpuDriverTest.CreateIpcMem_fail:CloudV2NpuDriverTest.SetIpcMemAttr_fail:CloudV2NpuDriverTest.OpenIpcMem_fail:CloudV2NpuDriverTest.CloseIpcMem_fail:CloudV2NpuDriverTest.SetIpcMemPid_fail:RtMemoryApiTest.rtSetIpcMemorySuperPodPid':匹配 9 个 910B IPC Memory 用例通过。 7. 本轮增量 git diff --check 5558ce8ac HEAD:通过;git diff --name-only 5558ce8ac HEAD 仅包含 src/runtime/api/impl/api_impl_ipc_memory.cc 和 tests/ut/runtime/runtime/test/rt_utest_api_impl.cc。 8. 行尾检查:src/runtime/api/impl/api_impl_ipc_memory.cc 和 tests/ut/runtime/runtime/test/rt_utest_api_impl.cc 均为 LF-only。 9. git diff origin/master...HEAD -- src/runtime/core/src/common/profiling_agent.cc:无输出,确认 profiling_agent.cc 对 master 无净差异。 此前 tiny 补充验证: - cmake --build build --target runtime_utest_tiny_stub -j16:通过。 - ./build/tests/ut/runtime/runtime/runtime_utest_tiny_stub --gtest_filter='TinyStubTest.api_c_stub:TinyStubTest.ipc_memory_impl_lifecycle_not_support':2 个用例通过。 - ./build/tests/ut/runtime/runtime/runtime_utest_tiny_stub:65 个用例通过。 - rg -n "rtSetIpcMemorySuperPodPid" build/tests/ut/runtime/runtime/generated/runtime_api_stubs/tiny/api_c_generated_stub.cc:确认 tiny 生成桩包含该符号。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 最新覆盖提交:2198261601a346fb85ee222dea9c1a866ab73d6b。 See merge request: cann/runtime!4972 | 3 天前 | |
refactor:ApiKernelArgs拆分 Co-authored-by: Rick_Coding<yangsen24@huawei.com> # message auto-generated for no-merge-commit merge: !4775 merge master into master refactor:ApiKernelArgs拆分 Created-by: Rick_Coding Commit-by: Rick_Coding Merged-by: cann-robot Description: # Pull Request ## 描述 本提交对 KernelArgs API 进行独立模块拆分,将其从公共 Api/ApiImpl 及 Decorator 调用链中解耦,形成独立的 ApiKernelArgs/ApiImplKernelArgs 模块。 主要变更如下: 1. 新增 ApiKernelArgs 抽象接口和 ApiImplKernelArgs 实现类,迁移以下 8 个 KernelArgs 接口: - KernelArgsInit - KernelArgsInitByUserMem - KernelArgsGetMemSize - KernelArgsGetHandleMemSize - KernelArgsAppend - KernelArgsAppendPlaceHolder - KernelArgsGetPlaceHolderBuffer - KernelArgsFinalize 2. 将 GetToBeCalSystemParaNum、ProcessOverFlowArgs 两个 KernelArgs 私有辅助函数迁移至 ApiImplKernelArgs。 3. rtsKernelArgs* 对外接口改为通过 ApiKernelArgs::Instance() 获取实现,不再经过公共 Api 调用链。对外 C API 的函数签名、句柄校验和错误码转换逻辑保持不变。 4. 删除 Api、ApiDecorator、ApiErrorDecorator 和 ApiProfileDecorator 中的 KernelArgs 成员函数,原有参数校验、Error Message 上报和 Profiling Begin/End 逻辑下沉至 ApiImplKernelArgs,保持对外可观察行为。 5. 在 Runtime 中增加 ApiKernelArgs 的创建、注册、获取、初始化失败回滚和析构管理,确保独立实现对象生命周期完整。 6. 将原先依赖 ApiImpl 的上下文和 C2C 控制地址查询改为通过 Runtime/Device 公共能力获取,解除 ApiImplKernelArgs 对主 ApiImpl 的依赖。 7. arch5162 继续使用独立 KernelArgs stub 实现,8 个接口统一返回 RT_ERROR_FEATURE_NOT_SUPPORT,保持原有产品行为。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1.已经通过商用芯片RDV测试 2.已经通过tiny冒烟测试 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!4775 | 3 天前 | |
refactor:新增ApiKernelFunc拆分 Co-authored-by: Rick_Coding<yangsen24@huawei.com> # message auto-generated for no-merge-commit merge: !4865 merge master into master refactor:新增ApiKernelFunc拆分 Created-by: Rick_Coding Commit-by: Rick_Coding Merged-by: cann-robot Description: # Pull Request ## 描述 本 PR 是“Kernel 加载与执行”模块中 ApiKernelFunc API 大类拆分的框架阶段。 本批拆分 9 个以 Kernel/funcHandle 查询为核心的接口: aclrtGetFunctionAddr -> rtsFuncGetAddr -> ApiKernelFunc::FuncGetAddr aclrtGetFunctionName -> rtsFuncGetName -> ApiKernelFunc::FuncGetName aclrtGetFunctionAttribute -> rtFunctionGetAttribute -> ApiKernelFunc::FunctionGetAttribute aclrtGetFunctionSize -> rtFuncGetSize -> ApiKernelFunc::FuncGetSize aclrtFunctionGetBinary -> rtFunctionGetBinary -> ApiKernelFunc::FunctionGetBinary aclrtFunctionGetParamCount -> rtFunctionGetParamCount -> ApiKernelFunc::FunctionGetParamCount aclrtFunctionGetParamInfo -> rtFunctionGetParamInfo -> ApiKernelFunc::FunctionGetParamInfo aclrtFunctionGetAvailDynUbufPerBlock -> rtFunctionGetAvailDynUbufPerBlock aclrtGetFuncBySymbol -> rtGetFuncBySymbol -> ApiKernelFunc::GetFunctionBySymbol 具体变更: - 新增 ApiKernelFunc 抽象接口和 ApiImplKernelFunc 真实实现。 - 将参数校验、错误码、ErrMsg 和业务实现完整纳入新模块。 - 保留 FuncGetAddr 的 profiling begin/end 行为。 - ApiKernelFunc::Instance(flags) 保留线程环境标志设置和默认清零语义。 - 接入 Runtime 创建、初始化、失败回滚和析构生命周期。 - 在 Runtime 成员列表尾部追加 ApiKernelFunc 对象,降低内部布局影响。 - v100、v200/v201、cmodel 和 910B 接入真实实现。 - tiny 和 arch5162 接入不支持实现。 - 增加直接实现 UT、Runtime 生命周期 UT 和产品 stub UT。 行为等价说明: - 对外 C API 签名、handle 解包和返回码保持不变。 - 参数校验顺序、ErrMsg、Context 获取和产品支持策略保持不变。 - FuncGetAddr 的 profiling 类型及 begin/end 配对保持不变。 - 当前 C API 仍通过主 Api 调用链执行,对外行为尚未切换。 本 PR 不包含: - 不切换现有 C API 到 ApiKernelFunc。 - 不删除主 Api、ApiImpl、decorator 和平台 stub 中的旧接口。 - 不处理 ApiBinary、ApiKernelLaunch 和 ApiDevice 等后续模块。 剩余工作: - 路由阶段:将上述 9 个 C API 切换到 ApiKernelFunc,并验证新旧行为等价。 - 清理阶段:删除主 Api 旧实现、decorator、平台 stub 和旧 UT 残留。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1.已经通过商用芯片RDV测试 2.已经通过tiny冒烟测试 3.已经通过build构建 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!4865 | 5 天前 | |
【PR】:precommit src/runtime Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !3723 merge master_clang into master 【PR】:precommit src/runtime Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 请清晰准确地描述本次 Pull Request 的意图和变更内容。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [ ] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [ ] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!3723 | 2 个月前 | |
【PR】:precommit src/runtime Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !3723 merge master_clang into master 【PR】:precommit src/runtime Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 请清晰准确地描述本次 Pull Request 的意图和变更内容。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [ ] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [ ] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!3723 | 2 个月前 | |
refactor: 新增 ApiRtConfig 框架 Co-authored-by: wangzhensheng<wangzhensheng4@huawei.com> # message auto-generated for no-merge-commit merge: !4808 merge refactor/api-rt-config-framework into master refactor: 新增 ApiRtConfig 框架 Created-by: wangzhensheng Commit-by: wangzhensheng Merged-by: cann-robot Description: # Pull Request ## 描述 新增独立的 ApiRtConfig 接口及实现框架,用于承载运行时配置相关能力,为后续从原有 Api 中拆分这些方法做准备。 删除冗余函数:Runtime::GetTilingKeyFromKernel、Runtime::KernelSetDfx **主要变更** - 新增 ApiRtConfig 抽象接口,共包含 11 个方法: - 系统参数配置:CtxSetSysParamOpt、CtxGetSysParamOpt - 资源限制:SetDeviceResLimit、ResetDeviceResLimit、GetDeviceResLimit、SetStreamResLimit、ResetStreamResLimit、GetStreamResLimit、UseStreamResInCurrentThread、NotUseStreamResInCurrentThread、GetResInCurrentThread - 新增 ApiImplRtConfig 具体实现 - 完善对象创建和生命周期管理: - 新增 IsImplRtConfigSupported、CreateImplRtConfigAndGet、DestroyImplRtConfig。 - Runtime 增加 apiRtConfig_ 和 apiImplRtConfig_ 成员。 - 在 Runtime::InitApiImplies 中创建对象,在初始化成功后对外提供 ApiRtConfig::Instance()。 - 初始化失败及 v100/v200 Runtime 析构时释放对象。 - IsImplRtConfigSupported() 当前固定返回 true。 - 接入各构建目标: - runtime、v200、tiny、cmodel、arch5162 均加入 api_impl_rt_config.cc。 - 当前没有为 arch5162 单独提供 RT_ERROR_FEATURE_NOT_SUPPORT 实现,各目标原则上共用同一套实现。 **变更边界** - 当前PR仅新增了新框架、实现及 Runtime 生命周期接入,并未切换新框架;原有接口语义、逻辑、调用链仍维持原状。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!4808 | 8 天前 | |
refactor: 新增 ApiSnapshot 框架 Co-authored-by: l00798094<lishun30@huawei.com> # message auto-generated for no-merge-commit merge: !4670 merge codex/api-snapshot-framework into master refactor: 新增 ApiSnapshot 框架 Created-by: lexbb Commit-by: l00798094 Merged-by: cann-robot Description: # Pull Request ## 描述 本 PR 是快照管理 API 拆分的“新增框架”阶段,基于 cann/runtime:master。 本批接口: - aclrtSnapShotProcessLock -> rtSnapShotProcessLock - aclrtSnapShotProcessBackup -> rtSnapShotProcessBackup - aclrtSnapShotProcessRestore -> rtSnapShotProcessRestore - aclrtSnapShotProcessUnlock -> rtSnapShotProcessUnlock - aclrtSnapShotProcessGetState -> rtSnapShotProcessGetState - aclrtSnapShotCallbackRegister -> rtSnapShotCallbackRegister - aclrtSnapShotCallbackUnregister -> rtSnapShotCallbackUnregister 具体变更: - 新增抽象 ApiSnapshot、真实实现 ApiImplSnapshot 和不支持平台工厂桩。 - 将快照业务实现收敛至独立编译单元,保持状态校验、回调顺序和错误码不变。 - 接入 Runtime 创建、访问和销毁生命周期。 - 同步 runtime、cmodel、v200、tiny、arch5162、910B 及相关 UT 源文件矩阵。 - 增加工厂创建失败、生命周期、状态读取和非法状态直接 UT。 行为等价说明: - 本阶段现有 C API 仍走主 Api 调用链,公开符号、参数校验顺序、返回码和产品能力保持不变。 - Runtime 新成员追加在类布局尾部,避免改变已有成员偏移。 本 PR 不包含: - 不切换七个 Snapshot C API 的调用链。 - 不删除主 Api/ApiImpl/decorator 中的旧方法。 - 不执行 arch5162 的最终 C API 强桩隔离。 剩余工作: - 框架阶段合入后,基于最新主线提交“切换 Snapshot API 调用链”PR。 - 路由阶段合入后,提交“隔离 arch5162 ApiSnapshot 组件”PR。 ## 变更类型 - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 暂无关联 Issue。 ## 如何测试 1. pre-commit run clang-format --from-ref c210f8d88^ --to-ref c210f8d88:通过。 2. python tests/ut/runtime/runtime/test/cmake/test_generate_runtime_api_stubs.py:9/9 通过。 3. scripts/oat_check.sh:重放到最新主线后的聚合分支 45 个变更文件通过,非法文件类型 0,License Header 问题 0。 4. 当前本地及 WSL 环境缺少 CMake/C++ 编译器,完整 C++ 编译和 UT 尚未执行,需以线上 CI 编译结果补齐证据。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 - 本 PR 仅包含提交 c210f8d88 refactor: 新增 ApiSnapshot 框架。 - 推荐合入顺序:新增框架 -> 切换调用链 -> arch5162 组件隔离。 - 回退方式:单独回退本 PR 即可恢复原框架状态,不影响后续阶段之外的模块。 See merge request: cann/runtime!4670 | 9 天前 | |
fix: 统一SOMA内存池分配接口参数名(#889) Co-authored-by: ningjingyuan<ningjingyuan@huawei.com> # message auto-generated for no-merge-commit merge: !5141 merge fix/api-param-soma into master fix: 统一SOMA内存池分配接口参数名(#889) Created-by: ningjingyuan Commit-by: ningjingyuan Merged-by: cann-robot Description: # Pull Request ## 描述 NULL_PTR_RETURN_MSG_OUTER_WITH_FUNC_DESC 会通过 #PTR 将参数名写入 EE1004 错误信息。 rtMemPoolMallocAsync 的公开 C 接口及 @param 均使用 ptr,但 ApiSoma 虚接口、ApiImplSoma 实现和 stub 仍使用 devPtr,导致空指针错误信息中的参数名与接口文档不一致。 本 PR 将该接口实现链路的输出参数统一为 ptr。不修改参数类型、顺序、返回值、日志文案及运行行为。 ## 变更类型 <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue Closes #889 Issue:https://gitcode.com/cann/runtime/issues/889 ## 如何测试 1. 执行 pre-commit run --files src/runtime/api/api_soma.hpp src/runtime/api/impl/api_impl_soma.hpp src/runtime/api/impl/api_impl_soma.cc src/runtime/api/impl/api_impl_stub.cc,检查通过。 2. 执行 cmake --build build --target runtime_v100 runtime_utest_tiny_stub -j2,编译通过。 3. 执行 ./build/tests/ut/runtime/runtime/runtime_utest_tiny_stub --gtest_color=no,65 个用例全部通过。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 对外接口及 @param 已确认使用 ptr,无需额外文档修改 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本 PR 仅包含 rtMemPoolMallocAsync 一个接口的参数名同步,共修改 4 个文件、10 行新增和 10 行删除。 See merge request: cann/runtime!5141 | 2 天前 | |
【PR】:precommit src/runtime Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !3723 merge master_clang into master 【PR】:precommit src/runtime Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 请清晰准确地描述本次 Pull Request 的意图和变更内容。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [ ] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [ ] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!3723 | 2 个月前 | |
【PR】:precommit src/runtime Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !3723 merge master_clang into master 【PR】:precommit src/runtime Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 请清晰准确地描述本次 Pull Request 的意图和变更内容。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [ ] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [ ] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!3723 | 2 个月前 | |
feat: 查询类aclrt接口扩展支持函数符号入参 Co-authored-by: chenyang<2082464740@qq.com> # message auto-generated for no-merge-commit merge: !4913 merge acll into master feat: 查询类aclrt接口扩展支持函数符号入参 Created-by: weixin_51634168 Commit-by: chenyang Merged-by: cann-robot Description: # feat: 查询类aclrt接口扩展支持函数符号入参 ## 描述 扩展 8 个查询类 aclrt 接口,使其在兼容现有 aclrtFuncHandle 入参的同时,支持传入核函数符号。接口统一使用 const void* func,不新增 C++ 重载。 | 接口 | 本次变化 | | --- | --- | | aclrtGetFunctionAddr | aclrtFuncHandle → const void*,支持查询 AIC/AIV 起始地址 | | aclrtGetFunctionName | aclrtFuncHandle → const void* | | aclrtGetFunctionAttribute | aclrtFuncHandle → const void* | | aclrtGetFunctionSize | aclrtFuncHandle → const void* | | aclrtFunctionGetBinary | const aclrtFuncHandle → const void* | | aclrtFunctionGetParamCount | 签名原本就是 const void*,本次扩展符号入参处理 | | aclrtFunctionGetParamInfo | 签名原本就是 const void*,本次扩展符号入参处理 | | aclrtFunctionGetAvailDynUbufPerBlock | void* → const void* | Runtime 查询入口通过共用的 ConvertFuncToKernel 解析入参:符号查找成功时使用对应 Kernel;返回“未找到”时按既有函数句柄校验;返回其他错误时保留错误码转换,并补回接口级错误上报和日志刷新。同步更新 ACL 转发、Runtime 声明与 stub,以及接口文档。 ## 变更类型 - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 ## 如何测试 按接口运行定向 UT,原有句柄路径与新增符号路径均通过;本次补充的错误路径和 ACL 转发用例也已通过。 | 接口或场景 | UT 覆盖 | 结果 | | --- | --- | --- | | aclrtGetFunctionAddr | TestFuncGetAddr、TestRtsFuncGetAddr_*:符号成功、句柄回退、符号查询其他错误及下游入参/出参 | PASSED | | aclrtGetFunctionSize | CloudV2ApiKernelTest.TestFuncGetSize*:符号路径及 AIC/AIV 大小 | PASSED | | aclrtGetFunctionName | TestFuncGetName*、TestRtsFuncGetName_*:符号路径 | PASSED | | aclrtGetFunctionAttribute | TestFuncGetAttribute、TestRtFunctionGetAttribute_*:符号路径及属性值 | PASSED | | aclrtFunctionGetBinary | TestRtFunctionGetBinary_*:符号路径及 binary handle | PASSED | | aclrtFunctionGetParamCount | TestRtFunctionGetParamCount_*:符号路径及参数个数 | PASSED | | aclrtFunctionGetParamInfo | TestRtFunctionGetParamInfo_*:符号路径及参数偏移、大小 | PASSED | | aclrtFunctionGetAvailDynUbufPerBlock | TestRtFunctionGetAvailDynUbufPerBlock_*:符号路径、下游 Kernel 及动态 UB 大小 | PASSED | | ACL 层 const void* 转发 | UTEST_ACL_Runtime.aclrtFunctionGetAvailDynUbufPerBlock_ConstSymbolTest:符号原样转发及动态 UB 出参 | PASSED | Runtime 用例使用 runtime_utest_api 和 runtime_utest_api_910B 目标,ACL 用例使用 ascendcl_utest 目标;各接口的定向执行命令沿用原测试记录。 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 aclrtFunctionGetParamCount 和 aclrtFunctionGetParamInfo 的公开参数类型未变;本次改变的是它们对函数符号的处理能力。 See merge request: cann/runtime!4913 | 1 天前 | |
【PR】:precommit src/runtime Co-authored-by: duanpengliang<duanpengliang@huawei.com> # message auto-generated for no-merge-commit merge: !3723 merge master_clang into master 【PR】:precommit src/runtime Created-by: duanpengliang Commit-by: duanpengliang Merged-by: cann-robot Description: # Pull Request ## 描述 请清晰准确地描述本次 Pull Request 的意图和变更内容。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [ ] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [ ] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!3723 | 2 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 天前 | ||
| 1 天前 | ||
| 1 天前 | ||
| 1 天前 | ||
| 2 个月前 | ||
| 25 天前 | ||
| 6 天前 | ||
| 1 天前 | ||
| 1 天前 | ||
| 2 个月前 | ||
| 3 天前 | ||
| 5 天前 | ||
| 1 天前 | ||
| 3 天前 | ||
| 1 天前 | ||
| 2 个月前 | ||
| 1 天前 | ||
| 1 天前 | ||
| 5 天前 | ||
| 7 天前 | ||
| 2 天前 | ||
| 2 个月前 | ||
| 1 天前 | ||
| 5 天前 | ||
| 1 天前 | ||
| 1 个月前 | ||
| 7 天前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 5 天前 | ||
| 3 天前 | ||
| 26 天前 | ||
| 1 个月前 | ||
| 2 个月前 | ||
| 1 天前 | ||
| 1 天前 | ||
| 1 天前 | ||
| 3 天前 | ||
| 3 天前 | ||
| 5 天前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 8 天前 | ||
| 9 天前 | ||
| 2 天前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 1 天前 | ||
| 2 个月前 |