已合并
ttk适配batch一致性 #47
ttk适配batch一致性 #47
已合并
蔡政洋创建于 12 天前
蔡政洋
蔡政洋
12 天前

描述

ttk适配batch一致性验证

关联的Issue

https://gitcode.com/cann/ops-test-kit/issues/38

测试

文档更新

类型标签

  • Bug修复
  • 新特性
  • 性能优化
  • 文档更新
  • 其他,请描述:
likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 蔡政洋 的贡献)
atomgit-bot
atomgit-bot
12 天前 评论:

变更摘要

此 PR 为 TTK 框架引入了 batch 一致性适配功能。核心思路是在 TestcaseE2e 中新增 batch_axisbatch_slice_infobatch_seed 三个 batch 相关字段,并基于它们自动生成 batch_consistency_id 来标识可参与 batch 一致性比较的用例组。同时,在 golden 生成、输入生成、自定义比较和结果返回等环节传递这些 batch 参数,使下游插件和比较函数能够感知 batch 信息,从而实现 batch 维度的一致性校验。

主要改动

  • TestcaseE2e 新增 batch 字段与 ID 生成:在 TestcaseE2e__slots__full_headers__init__ 中新增 batch_axisbatch_slice_infobatch_seedbatch_consistency_id 四个字段,并实现 _generate_batch_consistency_id() 方法,根据 batch_seed 与切片长度自动生成一致性 ID,在 _finalize_initialization 中调用。
  • Golden/输入生成环节透传 batch 参数:在 golden_generation.py_call_plugin_with_planinput_generation.pygenerate_inputs 中,将测试用例的 batch_axisbatch_slice_infobatch_seed 注入 extra 字典,传递给插件函数。
  • 自定义比较函数适配 batch 参数:在 profiling.py_try_custom_compare 中,提取测试用例的 batch_consistency_idbatch_axisbatch_slice_infobatch_seed,通过 inspect.signature 动态匹配后作为关键字参数传入自定义比较函数。
  • 结果结构新增 batch_consistency_id:在 result.pyFrameworkApiReturnStructure 中新增 batch_consistency_id 槽位,并在 _do_profile 中从 testcase 读取并赋值,使 profiling 结果携带 batch 一致性标识。
likedislike
不准确?
此处折叠了52条消息 查看更多
wangmingli
wangmingli成员
11 天前 评论:

/lgtm

likedislike
chenqi317成员
11 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
11 天前 添加了label:lgtmapproved
CANN-robotCANN-robot成员
11 天前 解决了最后一个问题
CANN-robotCANN-robot成员
11 天前 合入了pull request