已合并
增加mc2单卡测试mock server的能力 #3368
YuZhengzhong创建于 3月26日
增加mc2单卡测试mock server的能力 #3368
已合并
YuZhengzhong创建于 3月26日
YuZhengzhong成员
3月26日

描述

增加mc2单卡测试mock server的能力
需求背景与设计方案简述见关联的issue

关联的Issue

关联 issue #1475

测试

增加本地测试能力的特性

文档更新

不涉及文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 YuZhengzhong 的贡献)
YYuZhengzhong成员
3月26日 创建了 pull request,commit 4a51e26e
YYuZhengzhong成员
3月26日 关联了issue:[Requirement|需求建议]: MC2的测试在依赖多卡环境,建议增加使用单卡mock测试的能力,以验证算子功能与精度正确性
CANN-robot
CANN-robot成员
3月26日 评论:

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 /approve or /lgtm
  • Commenting /approve implies 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. 👍

likedislike
CANN-robotCANN-robot成员
3月26日 添加了label:cann-cla/yes
CANN-robotCANN-robot成员
3月26日 将monologue815,liudan12,gaoxiang618,mabing1118设为评审人
CANN-robotCANN-robot成员
3月26日 将monologue815,liudan12,gaoxiang618,mabing1118设为审查人
CANN-robot
CANN-robot成员
3月26日 评论:

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

likedislike
YYuZhengzhong成员
3月26日 修改了pull request 的描述
CANN-robot
CANN-robot成员
3月26日 评论:

问题/功能描述

新增一个通用的HCCL Server端模拟框架,用于在单卡环境下测试依赖HCCL通信的MC2算子。该框架通过模拟内核与Server间的workspace消息协议,使得AllGatherMatmul等分布式算子无需真实多卡环境即可进行单卡测试,解决了算子开发早期依赖真实集群进行通信测试的痛点。同时,提供了相应的C++集成测试程序,用于验证框架基础协议、数据拷贝和最终化流程的正确性。

修改方案描述

实现了一个包含MockHcclServer、MockContextBuilder、MultiRankMockContext等核心组件的C++框架,并通过pybind11提供Python绑定。框架在主机侧启动轮询线程,监听设备侧workspace中的通信请求,并利用传入的各rank输入tensor模拟真实的集合通信语义(如AllGather、ReduceScatter)。此外,新增了集成测试文件,通过多个测试用例验证了通信上下文构建、协议处理、数据模拟拷贝及资源清理等完整流程,确保框架的可行性。

likedislike
YYuZhengzhong成员
3月26日 修改了pull request 的描述
YuZhengzhong成员
3月26日 评论:

compile

likedislike
CANN-robotCANN-robot成员
3月26日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
3月26日 评论:

流水线任务触发成功
任务链接 [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执行结束

likedislike
CANN-robotCANN-robot成员
3月26日 添加了label:api-check-pass
CANN-robotCANN-robot成员
3月26日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
3月26日 添加了label:ci-pipeline-passed
liudan12成员
3月27日 评论:

/approve

likedislike
CANN-robotCANN-robot成员
3月27日 添加了label:approved
mabing成员
3月27日 评论:

/lgtm

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

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.

likedislike
CANN-robotCANN-robot成员
3月27日 关闭了关联的issue
CANN-robotCANN-robot成员
3月27日 合入了pull request