Pull Request has been successfully merged by CANN-robot.
(Thank you for chenyizhuo's contribution.)变更摘要
本 PR 为验证 experimental 文件夹下能否正常使用 REGISTER_EXEC_V2 注册方式,新增了一个实验性 AllReduce 算法及其配套的 ST 测试用例与离线仿真 CCU 启动桩:在 experimental/ops/all_reduce/register_v2_test/ 下新增 executor、template 与 CCU kernel 三层实现,并通过 REGISTER_EXEC_V2 完成注册;同时在 test/st/algorithm 下新增调用该算法的测试用例及 CCU 仿真 stub;此外更新了 build.sh 的可选 ST 算子列表与相关 README 文档(experimental/README.md 新增 3.2 节、新增 register_v2_test/README.md)。
主要改动
- 新增实验性 AllReduce 算法及
REGISTER_EXEC_V2注册:在experimental/ops/all_reduce/register_v2_test/下新增InsV2AllReduceExperimentalSoleExecutor(含Orchestrate、OrchestrateLoop、CalcRes、FastLaunchSaveCtx/FastLaunch)与模板类CcuTempAllReduceExperimentalMesh1D(含CalcSliceInfo、CalcRes、KernelRun、CheckCcuDataType),文件末尾通过REGISTER_EXEC_V2(HcclCMDType::HCCL_CMD_ALLREDUCE, CcuAllReduceExperimentalMesh1D, ...)注册,并以CANN_VERSION_NUM >= CANN_VERSION(9, 0, 0)条件编译保护。 - 新增 CCU kernel 实现:新增
ccu_kernel_all_reduce_experimental_mesh1d.h/.cc,定义CcuKernelArgAllReduceExperimentalMesh1D与CcuAllReduceExperimentalMesh1DKernel入口,kernel 内按PreSync→DoAllReduce(ReduceScatter + AllGather)→PostSync流程执行。 - 新增 ST 测试用例:新增
test/st/algorithm/testcase/all_reduce_experimental_testcase.cc,以多线程方式按 rank 下发HcclAllReduce并做结果成图校验,覆盖 2/3/4/8 rank、多种数据类型与sum/min/max、512KB 边界、1GB 多 loop 切片等成功场景,以及uint16/uint32被 API 层CheckDataType拦截的报错场景。 - 新增 CCU 启动桩与仿真环境适配:新增
hcomm_ccu_launch_stub.h/.cc,实现HcommCcuGetMemToken、HcommCcuKernelRegister*、HcclCommQueryCcuIns/HcclCommAssignCcuIns与HcommCcuKernelLaunch(仅支持CcuKernelAllReduceExperimentalMesh1D,按 AllReduce 语义生成LOCAL_COPY+READ_REDUCE+POST/WAIT任务);并修改sim_context_manager.cc(COMM_ENGINE_CCU分配 HOST 内存)、sim_thread_manager.cc(COMM_ENGINE_CCU映射为DEVICE_NOTIFY)、sim_world.cc(Deinit时调用ClearCcuLaunchStub())。 - 构建脚本与文档更新:
build.sh的--st_ops可用算子列表新增all_reduce_experimental;按 PR 描述,experimental/README.md新增「实现自定义算法」章节,并新增register_v2_test/README.md说明该文件夹的动机、结构、用法与限制。


Hi @chenyizhuo, welcome to submitting your first PR to hccl!
PR Merge Steps
1. CLA Signing
If the current PR label includes cann-cla/yes, it means you have signed the CLA and can proceed to the next step. If the label includes cann-cla/no, please sign the CLA first. If you have any questions, please refer to the FAQ.
2. CI Check
Please comment /compile to trigger the CI pipeline check. If the CI run is successful, the PR will be tagged with ci-pipeline-passed and you can proceed to the next step. If the CI run fails, the PR will be tagged with ci-pipeline-failed, please check the CI logs to fix the issues in the PR. If you have any questions, please refer to the FAQ.
3. Code Review
After CI passes, please refer to the PR Approval Progress and proactively @ the committers in the table to review the code. After approval, committers will comment /lgtm and /approve. Once the lgtm and approved labels are successfully added, the PR will be merged automatically.


/lgtm


/approve


描述
为完成在experimental文件夹打通REGISTER_EXEC_V2注册方式需求,在experimental文件夹新增一个算法来测试是否能在该文件夹使用REGISTER_EXEC_V2方式注册。
关联的Issue
NA
测试
流水线测试、真机测试和RDV测试通过。
文档更新
更新了experimental/README.md与experimental/README_en.md,添加了3.2节 实现自定义算法。增加了experimental/ops/all_reduce/example/README.md与同目录的README_en.md,描述register_v2_test文件夹的动机、结构、现状、用法、限制等。
类型标签