已开启
fix(lint): Unify loop detection across OL43/OL23/OL56 for loop_unroll #584
lizixuan创建于 1 天前
fix(lint): Unify loop detection across OL43/OL23/OL56 for loop_unroll #584
已开启
合并受阻
1 天前 关联了issue:[Bug-Report|缺陷反馈]: [断裂点]unroll_list 参数官方文档没写、lint 三条规则各认各的——写 loop_unroll 被硬拦,写 loop 靠猜
1 天前 关联了issue:[Bug-Report|缺陷反馈]: [断裂点]unroll_list 参数官方文档没写、lint 三条规则各认各的——写 loop_unroll 被硬拦,写 loop 靠猜
1 天前 添加了label:cann-cla/yes
CANN-robot
1 天前 评论:
1 天前 评论:
CANN-robot
1 天前 评论:
1 天前 评论:
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
⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/pypto-gym | ❌ (0/2)(You can also ask: DCGDDD, wangzheng97, tsungl4, xinweiliu, jason_yuan_ye) | ❌ (0/1)(You can also ask: DCGDDD, jason_yuan_ye, gaoxingwang, foundea, 尹杰) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


1 天前 修改了pull request 的描述
Closes #118 / Closes #116
说明:#116 与 #118 为同一问题的重复提交(同一作者、同一标题、同一内容,#116 创建更早),本 PR 的修复同时覆盖两者。
问题
unroll_list是"能用、都在用、但文档不写"的参数,且 lint 三条规则对 loop 的识别口径互不相同:pypto.loop\\s\\*(匹配不上loop_unroll((被误拦),且 AST 兜底只看jit_funcs[0]。f.attr == "loop"严格相等 → loop_unroll 逃逸单值 unroll_list 门禁。修复(统一为 AST 级、口径一致)
_has_loop_structure_with_helpers,跟随一层同文件 helper 委托(覆盖 loop-in-helper 形态)。_is_pypto_loop_for_node接受loop与loop_unroll,单值门禁对两条 API 一致生效。文档(上游 pypto 仓,仓外)
pypto-loop.md kwargs 表补
unroll_list参数说明及两条 API 分工——不在本仓,另立项。验证
新增 5 个测试(loop_unroll 内联 OL43 PASS、loop in helper OL43/OL23 PASS、loop_unroll 多值 OL56 FAIL、单值 PASS);lint 267 个测试全部通过。