Pull Request has been successfully merged by CANN-robot.
(Thank you for tangjie66's contribution.)变更摘要
本 PR 在 hixl engine 层引入可通过 GlobalResourceConfig 配置的多 worker 并发传输能力,仅对 UBOE/UB_RTP 协议生效,默认关闭(num_workers=1,走原有 DirectClientHandler 路径,不影响存量行为)。核心是新增 DirectMultiChannelHandler,将传输描述符按 split_batch_size 拆分后经线程池分发给多个 client 并发执行,并对配置项在 ParseCommResourceConfig 阶段做范围校验(越界直接返回 PARAM_INVALID)。多 worker 场景下建链改为调用线程串行逐个建链,以规避 hcomm 老版本 TpManager 并发建链导致的 TP 分裂竞态;异步传输语义上,部分/全部提交失败时 TransferAsync 同步返回错误,全部成功时由 GetTransferStatus 聚合各 worker 完成状态。
主要改动
- 新增配置字段与范围校验:
CommResourceConfigDesc新增multi_worker_num与multi_channel_split_batch_size字段,hixl_options.cc的ParseCommResourceConfig新增解析,校验num_workers ∈ [1, kMaxMultiWorkerNum(16)]、split_batch_size ∈ [1, UINT32_MAX],越界直接返回PARAM_INVALID;hixl_inner_types.h新增kDefaultSplitBatchSize = 128U与kMaxMultiWorkerNum = 16U常量。 - 新增
DirectMultiChannelHandler多通道处理器:新文件direct_multi_channel_handler.h/.cc实现拆分→线程池→收敛骨架,含ResolveActualWorkerNum(按 desc 数量与split_batch_size决定实际 worker 数)、SplitDescs(按 base/remainder 均分)、Submit/SubmitWorkersToPool/CheckStatus/QueryWorkersStatus等;Connect在调用线程内串行逐个HixlCSClientConnect建链。 ClientHandlerFactory按协议与 worker 数分派:Create中对 DIRECT 类型判断,当协议为COMM_TYPE_UBOE/COMM_TYPE_UBG且args.multi_worker_num > 1时分派到DirectMultiChannelHandler,否则维持DirectClientHandler原逻辑。- 配置从 engine 透传到 handler:
HandlerCreateArgs、ClientConfig及HixlClient/HixlEngine新增multi_worker_num、multi_channel_split_batch_size字段,HixlEngine::Initialize从GlobalResourceConfig读取(未配置时用默认值),并经FillClientConfigFields写入ClientConfig。 - 测试与测试桩支持:新增
direct_multi_channel_handler_unittest.cc(15 例,覆盖多 worker 建链/同步拆分传输/部分与全量 worker 激活/异步提交失败注入/纯函数ResolveActualWorkerNum、SplitDescs等);ascendcl_stub新增SetStubMallocHostFailOn/ResetStubMallocHostCounter用于对aclrtMallocHost做逐次失败注入以模拟异步提交失败。


🤖 AI 代码检视正在进行中,请稍候…


Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/hixl | ✅ zhujingjing, lining23666, zhaozhihui (3/2) | ✅ zhujingjing (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
tangjie66, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/lgtm


/lgtm


/approve


提交 PR 前,请先阅读 HIXL贡献指南 ,查看 PR 提交方式并遵守相关提交规范。
类型标签
描述
engine 层引入可配置的多 worker 并发传输,仅对 UBOE 和 UB_RTP 协议生效。
配置方式(GlobalResourceConfig)
{ "comm_resource_config.multi_channel.num_workers": 4, "comm_resource_config.multi_channel.split_batch_size": 128 }拆分规则
建链
异步传输语义
核心改动
测试项
UT 15 例(direct_multi_channel_handler_unittest.cc):
测试结果
Checklist
其它(可选)