Pull Request已成功合入, 合并人@CANN-robot
(感谢 liangjinxuan-2026 的贡献)变更摘要
本 PR 是 2026 HCCL 通信库创新大赛粤港澳赛区「超能陆战队」(南方科技大学)的初赛与决赛完整工程代码归档。初赛实现基于 AICPU_TS 通信引擎的 HcclReduceScatter 算子,采用多 Thread 并行远端读取 + 固定顺序归约的算法;决赛在 CCU 通信引擎上重构了 ReduceScatter 实现,引入 BufferedReduce 循环展开、双流水线读取、多 Die 拓扑感知通道分组及 Combine Kernel 等优化技术。两阶段均包含完整的源码工程、构建脚本(build.sh)及代码格式化配置(.clang-format),不包含构建产物。
主要改动
-
决赛 CCU ReduceScatter 内核 (
ccu_kernel.cc):新增CcuReduceScatterKernel和CcuCombineKernel两个 CCU Kernel 函数。前者实现基于 CCU 原语的 ReduceScatter 算法,包含 BufferedReduce 循环优化(将归约拆分为 4KB 分片并利用ccu::LoopGroup进行循环展开并行执行)、双流水线数据读取(先发下一批读取再处理当前批)、以及根据源数量自适应选择树形归约或 BufferedReduce 路径;后者用于双 Die 场景下合并两个 Die 的局部归约结果。 -
决赛主机端资源构建 (
reduce_scatter.cc决赛版):在 CCU 引擎上实现拓扑感知的通道获取逻辑AcquirePeerChannels,按 Die 将 peer 通道分组,优先将包含本地 rank 归约的组分配到 peer 通道较少的 Die 上以实现负载均衡;通过RegisterCcuKernels完成 CCU Kernel 注册,支持单 Die 和双 Die 两种模式,持久化持有 kernel 参数避免被析构。 -
初赛 AICPU ReduceScatter 实现 (
exec_op.cc初赛版):基于 AICPU_TS 引擎实现多 Thread 并行通信算法,为每个远端 rank 分配独立 Thread 和 Channel,各 Thread 并行从对端读取数据到本地 buffer 不同临时分片,避免并发写入冲突;归约阶段固定按 rank 顺序执行以保证浮点结果可重复。 -
初赛 Host/Device 同步机制 (
launch_aicpu_kernel.cc):封装 AICPU Kernel 加载与下发流程,通过aclrtBinaryLoadFromFile加载算子二进制,利用HcommThreadNotify实现 Host 主 Stream 与 AICPU 侧 Thread 之间的双向同步,确保 Kernel 下发与完成的时序正确性。 -
公共基础设施:新增
BinaryStream序列化工具类(支持基础类型、std::vector、std::string、std::map的序列化与反序列化)用于AlgResourceCtx的引擎上下文持久化;定义统一的日志宏体系(HCCL_DEBUG/INFO/WARNING/ERROR)及错误检查宏(CHK_RET、CHK_PTR_NULL、ACLCHECK等);决赛版log.h额外增加ConvertCcuToHccl完成 CCU 错误码到 HCCL 错误码的转换。


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.
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/cann-ops-competitions | ✅ zutao, Albertq (2/2) | ✅ Albertq, zutao (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
Sami_Hui, thanks for your pull request. All authors of the commits have signed the CLA. 👍


Something went wrong during merge: git update-ref: exit status 128, stderr: "fatal: commit: cannot lock ref 'refs/heads/master': is at ba54b47891f16e9c6e1d5557c9212296f418fe6a but expected 1538a3adc2f97660d2f9c2395d71dc6fe9d0266c\n"
If you want to solve this problem, you can click here to do it in the FAQs.


当前PR是否有AI参与:
PR功能描述 / 为什么需要这个合入
按赛事要求归档超能陆战队的初赛与决赛完整工程代码。
归档目录:
03_university/CANN-HCCL-GHM-Competition-2026/preliminary/submissions/南方科技大学-超能陆战队/03_university/CANN-HCCL-GHM-Competition-2026/final/submissions/南方科技大学-超能陆战队/该PR关联的issue
无。
希望检视人员了解
改动类型 / Change Type
测试信息 / Testing
检查清单 / Checklist