已合并
[usage] 流水线测试脚本新增gva直接读写相关接口 #391
thc72549创建于 7月21日
[usage] 流水线测试脚本新增gva直接读写相关接口 #391
已合并
thc72549创建于 7月21日
thc72549成员
7月21日

合入来源

问题/功能描述

修改方案描述

测试脚本中增加gva直接读写相关接口

是否涉及UT/ST

开发自检

likedislike
Pull Request已成功合入, 合并人@zhangjinshi
(感谢 thc72549 的贡献)
Tthc72549成员
7月21日 关联了issue:[Usage]: 测试脚本中缺少gva直接读写相关接口
atomgit-bot
atomgit-bot
7月21日 评论:

变更摘要

本次 PR 为 memcache 测试脚本新增了 GVA(GPU 虚拟地址)直接读写相关的批量操作接口,包括 GVA 分配、GVA 与 buffer 之间的拷贝、分层拷贝、写完成通知以及租约管理功能。这些改动仅在测试辅助代码中增加 CLI 命令与对应的客户端封装方法,不涉及正式源代码修改。

主要改动

  • 新增 6 个 CLI 命令及服务端处理函数:在 server.pyMmcTest 类中注册了 batch_allocbatch_copybatch_copy_layersbatch_write_finishbatch_add_leasebatch_remove_lease 命令,并实现了对应的处理逻辑,其中 batch_copybatch_copy_layers 涉及 NPU/CPU 设备的 buffer 注册与数据校验。
  • 新增客户端封装方法:在 test_case_common.pyTestClient 类中为上述 6 个命令增加了对应的客户端方法,统一通过 execute 发送请求。
  • 补全写完成通知调用:在 test_mmc_malloc.pywriter_worker 函数和 TestExample 测试用例中,于 batch_copy 之后增加了 batch_write_finish 调用,确保写操作完成后正确通知服务端。
likedislike
atomgit-bot
atomgit-bot
7月21日 评论:

代码审查

I have now completed a thorough review of all three changed files. Let me summarize my analysis:

server.py — Added 6 new CLI commands (batch_alloc, batch_copy, batch_copy_layers, batch_write_finish, batch_add_lease, batch_remove_lease) and their corresponding handler methods. All handlers correctly follow existing patterns (resource registration with try/finally cleanup, result_handler decorator, tensor_sum for None-safe summation, proper device selection based on copy direction).

test_case_common.py — Added 6 thin client wrapper methods, each correctly marshalling arguments into self.execute(...).

test_mmc_malloc.py — Added batch_write_finish calls in writer_worker and test_1_single_client with proper result assertions.

All changes are consistent with the existing codebase conventions. No correctness, security, reliability, or breaking-change issues were found.

审查总结

优先级 数量
P0 0
P1 0
P2 0
P3 0

审查结论: 未发现任何需要报告的问题。

各文件审查结果:

  • test/python/memcache/mock_server/server.py — 已审查,无问题。新增 6 个 CLI 命令及对应的处理方法,逻辑正确,遵循已有代码模式(资源注册/反注册的 try/finally 模式、result_handler 装饰器、tensor_sum 空值安全处理、根据 copy direction 正确选择 device)。
  • test/python/memcache/mock_server/test_case_common.py — 已审查,无问题。新增 6 个客户端封装方法,参数传递正确。
  • test/python/memcache/mock_server/test_mmc_malloc.py — 已审查,无问题。在 writer_workertest_1_single_client 中新增的 batch_write_finish 调用语义正确(写入完成后通知),结果断言合理,与已有读写流程的时序一致。

整体风险评估: 低风险。此次变更为纯测试脚本新增,不涉及源代码修改,新增接口遵循已有代码风格与约定,无逻辑缺陷、安全隐患或可靠性问题。

⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。

likedislike
ascend-robot
ascend-robot成员
7月21日 评论:
流水线 PR-pipeline_memcache#1596 [ commitID:09fc2ea9 ] 已完成
阶段 任务名 状态 详情
编译构建 Build_memcache >>>
恶意代码检查 Antipoison_memcache >>>
编码安全与规范检查 pre-commit >>>
CodeCheck_memcache >>>
开源片段检查 SCA_memcache >>>
开发者测试 UT_memcache >>>
流水线 PR-pipeline_memcache >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员评论有效
  • compile : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
ascend-robotascend-robot成员
7月21日 添加了label:stat/needs-squash
ascend-robotascend-robot成员
7月21日 添加了label:ascend-cla/yes
ascend-robotascend-robot成员
7月21日 添加了label:ci-pipeline-running
ascend-robot
ascend-robot成员
7月21日 评论:

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

⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 3 person(s) per module)、approve (requires ≥ 1 person(s) per module)

Module Approval Details

module lgtm status approve status
repo-Ascend/memcache ❌ (0/3)(You can also ask: leon_xun, RobustJay, wang-ruiju, liuyuqin, guoywang) ❌ (0/1)(You can also ask: yuncliu, weihaoran1, yrewzjsx, 于书苹, shepherd-cheung)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

thc72549, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
ascend-robotascend-robot成员
7月21日 删除了label:ci-pipeline-running
ascend-robotascend-robot成员
7月21日 添加了label:ci-pipeline-failed
thc72549成员
7月21日 评论:

retry

likedislike
ascend-robotascend-robot成员
7月21日 删除了label:ci-pipeline-failed
此处折叠了20条事件消息 查看更多
Zzhangjinshi成员
7月22日 合入了pull request