Pull Request已成功合入, 合并人@CANN-robot
(感谢 YuZhengzhong 的贡献)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
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| tests | ✅ liudan12, mabing1118 (2/2) | ✅ liudan12 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
Allan_Yu, thanks for your pull request. All authors of the commits have signed the CLA. 👍


🔵 source code change are detected, tasks labels is removed in this pull request!


问题/功能描述
新增一个通用的HCCL Server端模拟框架,用于在单卡环境下测试依赖HCCL通信的MC2算子。该框架通过模拟内核与Server间的workspace消息协议,使得AllGatherMatmul等分布式算子无需真实多卡环境即可进行单卡测试,解决了算子开发早期依赖真实集群进行通信测试的痛点。同时,提供了相应的C++集成测试程序,用于验证框架基础协议、数据拷贝和最终化流程的正确性。
修改方案描述
实现了一个包含MockHcclServer、MockContextBuilder、MultiRankMockContext等核心组件的C++框架,并通过pybind11提供Python绑定。框架在主机侧启动轮询线程,监听设备侧workspace中的通信请求,并利用传入的各rank输入tensor模拟真实的集合通信语义(如AllGather、ReduceScatter)。此外,新增了集成测试文件,通过多个测试用例验证了通信上下文构建、协议处理、数据模拟拷贝及资源清理等完整流程,确保框架的可行性。


compile


流水线任务触发成功
任务链接 [99ade98776f14b0bad83dafd811b32f1][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Check_Pr | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Pre_Compile | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_X86_monitor | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_ARM_monitor | ✅ SUCCESS | >>>>> | >>>>> |
| StaticCheck_codespell_check | ⚠️ WARNING | >>>>> | |
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ⚠️ WARNING | >>>>> | |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| UT_Test | ✅ SUCCESS | ||
| Smoke_A900_npupool | ✅ SUCCESS | >>>>> | |
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| anti_virus | ✅ SUCCESS | >>>>> | |
| API_Check | ✅ SUCCESS | >>>>> |
[2026-03-26 23:13:23] CI执行结束


Review Guide
This pull-request passes review.
Committers who wrote a comment of /approve are: liudan12.
Reviewers who wrote a comment of /lgtm are: liudan12, mabing1118.


描述
增加mc2单卡测试mock server的能力
需求背景与设计方案简述见关联的issue
关联的Issue
关联 issue #1475
测试
增加本地测试能力的特性
文档更新
不涉及文档更新
类型标签