Pull Request has been successfully merged by CANN-robot.
(Thank you for dbj's contribution.)变更摘要
本次变更将 ReduceCopyMerge pass 的自动 CV Mix 合图开关从 pypto.set_pass_options 的档位式配置中剥离,改为仅通过新的实验性接口 pypto.experimental.auto_mix_partition(0/1) 配置,默认关闭(0)。原基于档位名(off/default/high)与 N>100 自定义 op 上限的配置被移除,配置项取值范围收紧为 0~1。
主要改动
- 新增实验接口
pypto.experimental.auto_mix_partition: 在新增文件python/pypto/experimental/pass_config.py中实现该函数,仅接受 0/1,其他值(含布尔、字符串、浮点等)抛出ValueError,并通过set_options(pass_options={'auto_mix_partition': value})写入配置;同时在python/pypto/experimental/__init__.py中导出该函数。 - 移除
set_pass_options/get_pass_options的auto_mix_partition支持: 删除python/pypto/config.py中的auto_mix_partition参数、文档说明及写入逻辑,并删除档位编解码相关的_AUTO_MIX_PARTITION_LEVELS、_encode_auto_mix_partition、_decode_auto_mix_partition及get_pass_options中的读回逻辑。 - 收敛默认值与 schema 范围:
framework/src/interface/configs/tile_fwk_config.json中auto_mix_partition默认值由 2 改为 0;tile_fwk_config_schema.json的default改为 0、maximum由 100000 改为 1,并将中英文label说明简化为 0(关闭)/1(开启,Cube op ≤ 2000 且 Vector op ≤ 2240)。 - 更新接口 UT:
python/tests/ut/interface/test_config_options.py中test_auto_mix_partition改为验证实验接口对 0/1 的接受以及对非法值、非法字符串、非法类型和布尔值的ValueError拒绝。


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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| 9.2.0 | ✅ gcw_kUomxQ2l, zhangyuebing (2/2) | ✅ gcw_kUomxQ2l (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
bytecode, thanks for your pull request. All authors of the commits have signed the CLA. 👍


🟠 High Priority
变更点:python/pypto/config.py 的 set_pass_options 签名删除了关键字参数 auto_mix_partition: Optional[Union[int, str]] = None(新文件第 256/257 行之间),且该函数签名形如 def set_pass_options(*, ...),没有 **kwargs 兜底。
受影响契约:set_pass_options 是 jit / runtime 的统一入口,python/pypto/frontend/parser/entry.py:978 会执行 pypto.set_pass_options(**self._pass_options),其中 _pass_options 就是用户传给 pypto.frontend.jit(pass_options=...) 的字典(entry.py:278 dict(pass_options))。
失败模式:仓库内未同步修改的调用方 python/tests/st/test_dualdst.py:51 仍为 pypto.frontend.jit(..., pass_options={"auto_mix_partition": 1})。该 kernel 被调用时会以关键字参数 auto_mix_partition 调用 set_pass_options,由于参数已被删除且无 **kwargs,直接抛出 TypeError: set_pass_options() got an unexpected keyword argument 'auto_mix_partition',导致该 ST 用例(及其覆盖的 dualdst 编译流程)失败。同理,任何沿用旧写法把 auto_mix_partition 放进 pass_options 的存量用户代码也会从“可用”变为“报错”。
建议:保留 set_pass_options 的 auto_mix_partition 参数作为兼容入口(内部转发到 pass_options['auto_mix_partition'] 或新的 experimental 入口),或同步更新 python/tests/st/test_dualdst.py:51 等仍使用 pass_options={"auto_mix_partition": ...} 的调用方为 pypto.experimental.auto_mix_partition(...)。


/compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/approve


/lgtm


feat(pypto): Add pypto.experimental.auto_mix_partition 0/1 config
Cherry-pick of #6648 onto 9.2.0.
The level-based auto_mix_partition config (off/default/high strings and the
N>100 custom op-limit) is removed from pypto.set_pass_options. The auto CV
Mix merging switch of the ReduceCopyMerge pass is now configured solely via
pypto.experimental.auto_mix_partition(0/1), defaulting to disabled (0).
The C++ ReduceCopyMerge level mapping (MapAutoMixPartitionToLimits) is kept
unchanged.
Changes:
Related Issues: #3431