已合并
feat: add stream allocation logs #4715
feat: add stream allocation logs #4715
已合并
sunsummercqc创建于 9月3日
sunsummercqc
sunsummercqc
9月3日

Pull Request

Description

为 RT2 运行时增加流分配相关日志,便于定位执行器构建、辅助流创建以及外部主流绑定问题。

具体修改如下:

  1. 在 ModelV2ExecutorBuilder::Build 中增加 RT2 executor 身份日志,记录根 ComputeGraph 名称和模型名称。
  2. 在 StreamAllocator::AcquireStreams 中增加辅助流创建日志,记录逻辑流索引、RTS 流句柄和物理流 ID。
  3. 在 ModelV2Executor::OccupyStreamResource 中增加外部主流日志,仅当外部主流非空且替换原有主流时打印相关信息。

本次修改仅增加日志,不改变原有流分配和执行逻辑。

Change Type

Select the type of changes introduced:

无

How to Test

Describe the steps and prerequisites for testing this change:
1.
2.

Checklist

Additional Information

本次 PR 未修改设计文档,新增日志仅用于运行时问题定位和流资源调试。

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 sunsummercqc 的贡献)
sunsummercqcsunsummercqc
9月3日 添加了label:enhancement
sunsummercqcsunsummercqc
9月3日 创建了 pull request,commit 67b67e6b
atomgit-bot
atomgit-bot
9月3日 评论:

变更摘要

本 PR 为 RT2 运行时增加流分配相关日志,用于定位执行器构建、辅助流创建以及外部主流绑定问题。改动仅新增日志,不改变原有流分配与执行逻辑:在 ModelV2ExecutorBuilder::Build 中记录 RT2 executor 身份(根 ComputeGraph 名称与模型名称);在 StreamAllocator::AcquireStreams 中记录辅助流创建信息(逻辑流索引、RTS 流句柄与物理流 ID);在 ModelV2Executor::OccupyStreamResource 中仅当外部主流非空且替换原主流时打印相关日志。

主要改动

  • 执行器构建日志(model_v2_executor_builder.cc):在 ModelV2ExecutorBuilder::Build 中新增 GELOGI 日志,输出根 ComputeGraph 名称与模型名称,用于标识所构建的 RT2 executor。
  • 辅助流创建日志(stream_allocator.cc):在 StreamAllocator::AcquireStreams 中,每次通过 rtStreamCreateWithFlags 创建流后调用 aclrtStreamGetId 获取物理流 ID,并记录 RTS 流句柄、逻辑流索引及 rts_stream_id;同时新增 acl/acl_rt.h 头文件引用。
  • 外部主流绑定日志(model_v2_executor.cc):在 ModelV2Executor::OccupyStreamResource 中先保存原主流 previous_stream,当 arg.stream 非空且与原主流不同(发生替换)时,通过 aclrtStreamGetId 获取并记录外部主流的物理流 ID。
likedislike
不准确?
atomgit-bot
atomgit-bot
9月3日 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
sunsummercqcsunsummercqc
9月3日 修改了pull request 的描述
此处折叠了43条消息 查看更多
hugo111成员
9月3日 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
9月3日 添加了label:lgtm
yangyongqiang
yangyongqiang成员
9月3日 评论:

/approve

likedislike
CANN-robotCANN-robot成员
9月3日 添加了label:approved
CANN-robotCANN-robot成员
9月3日 合入了pull request