| Files | Last commit | Last update |
|---|---|---|
fix(ir): Descend into symbolic scalar expr operands to keep loop-carried scalars alive Co-authored-by: seu_chang<liuchang169@huawei.com> # message auto-generated for no-merge-commit merge: !6041 merge master into master fix(ir): Descend into symbolic scalar expr operands to keep loop-carried scalars alive Created-by: seu_chang Commit-by: seu_chang Merged-by: cann-robot Description: 本 PR 修复 IR 编译链路中符号标量表达式(RawSymbolicScalar)的遍历与存活分析问题:此前循环携带标量(loop-carried scalar)的引用存在于 RawSymbolicExpression 的操作数中,活跃性(liveness)收集器不会下钻访问,导致这些标量被错误裁剪、留下悬空引用。改动为 ScalarExpr 增加通用操作数访问接口 GetOperands(),由 RawSymbolicScalar 覆写暴露其操作数,并让变量使用收集器、宿主后端控制流代码生成(ir_backend.cpp)都能识别并保留这些标量(迭代参数、if 条件、continue 携带值、返回变量),最后补充了对应的回归测试。 See merge request: cann/pypto!6041 | 2 months ago | |
fix(machine): Detect intra-loop write overlap for single-root cell-match WAW Co-authored-by: songyangyang18<songyangyang18@huawei.com> # message auto-generated for no-merge-commit merge: !5770 merge cell-resolve into master fix(machine): Detect intra-loop write overlap for single-root cell-match WAW Created-by: songyangyang18 Commit-by: songyangyang18 Merged-by: cann-robot Description: ## 1. Background(背景信息) 当前 kernel 输入 tensor 的写后写依赖建立过程,单 root、跨迭代写同一 assemble 区域时,无法建立写后写依赖,导致精度异常。 为了解决场景精度异常问题,新增 PASS 在 IR 层进行写后写区域重叠校验:相对当前循环变量,相邻迭代写窗可分,并进行非重叠标记,用于machine部分的写后写依赖判定依据。 ## 2. 总体流程 1. 在create_function之后新增了infer_multi_iter_overlap_pass,用于检测loop 迭代间的写区域重叠; 2. 对于检测区域不重叠的打上标记,使用rebuildable attribute挂载在function上; 3. 获取function的assemble数量,数量>=2的保守视为存在写后写,只考虑assemble数量为1的场景; 4. 对于整体的function,识别assemble所在循环层的循环变量与步长,进行区域重叠检测,不存在循环变量的视为固定区域写,存在重叠;存在循环变量的进行重叠检测,用循环变量i+step与i的offset之差与assemble的tensor shape做比较。 ## 3. 验证场景一览 | # | scene | assemble offset(示意) | 期望 Mark / WAW | |---|-------|-------------------------|-----------------| | 1 | assemble_disjoint | [i*tile, 0] | Mark / 无 WAW | | 2 | assemble_overlap | [i*(tile//2), 0] | 不 Mark / 有 WAW | | 3 | nested_disjoint | [i*tile, j*tile_n](innermost=j 可分) | Mark / 无 WAW | | 4 | nested_overlap | [i*tile, j*(tile_n//2)](innermost=j 半窗重叠) | 不 Mark / 有 WAW | | 5 | fixed_offset | [0, 0](当前变量不在 offset) | 不 Mark / 有 WAW | | 6 | same_idx_diff_step | sibling:左半窗重叠 + 右 step=2 可分 | 同 raw 多 assemble → 不 Mark | | 7 | nested_inner_immediate_offset | 嵌套:[i*tile, 0],innermost=j 不在 offset | 不 Mark / 有 WAW | ## 4. PR限制约束(#3401 ) 1. 当前实现逻辑只考虑了最内层循环的重叠判定,在循环嵌套场景下,外层循环的影响没有考虑,存在局限。 2. 当前实现逻辑没有考虑循环内部创建tensor的情况,内部创建的tensor会自动根据迭代次数分配不同的地址区域,所以一定不重叠。 3. 更多的泛化性场景需要验证与补充。 See merge request: cann/pypto!5770 | 2 months ago | |
fix(ir): Preserve token dependencies for inplace operations Co-authored-by: zhaojunhan<zhaojunhan1@huawei.com> # message auto-generated for no-merge-commit merge: !5766 merge fix_inplace_op into master fix(ir): Preserve token dependencies for inplace operations Created-by: zhaojunhan Commit-by: zhaojunhan Merged-by: cann-robot Description: fix(ir): Preserve token dependencies for inplace operations PR 描述(中文): ## 问题背景 inplace 算子的输入与输出共享底层存储。原有 token 推导逻辑会为 inplace输入生成新的 read token,覆盖此前 reader 在输入 tensor 上保存的 read token,导致读后写(WAR)依赖无法正确传递。 在创建 root/hidden function 时,原始 tensor 会被本地 incast tensor 替换。如果没有同步 token 元数据,后续 Function 展开也无法识别该依赖。 ## 修改内容 - 识别与当前算子输出共享存储的 inplace 输入,不再为其生成新的 read token。 - 保留此前 reader 产生的 read token,并将其作为 inplace 写操作的 WAR依赖。 - 使用 inplace op 的 write token 表示其内部读写操作完成。 - 创建 hidden function 的 incast tensor 时,将原始 tensor 的 read/write token 复制到实际参与计算的本地 tensor。 - 更新 inplace token 相关 UT 的预期 IR。 ## 修改效果 修复以下依赖场景: - 普通读之后执行 inplace 写时,写操作正确等待此前的读 token。 - 连续 inplace 写之间保留正确的 WAW 依赖。 - 通过 alias 读取或写入时,依赖能够基于共享 storage 正确传播。 - 拆分 root/hidden function 后,token 元数据不会丢失。 See merge request: cann/pypto!5766 | 2 months ago | |
feat(IR): Fix io text dumper and loader's symbolic scalar and attribute Co-authored-by: Jie Yin<yinjie27@huawei.com> # message auto-generated for no-merge-commit merge: !5644 merge pil-ir-normalize into master feat(IR): Fix io text dumper and loader's symbolic scalar and attribute Created-by: yinjie27_ Commit-by: Jie Yin Merged-by: cann-robot Description: feat(IR): Fix io text dumper and loader's symbolic scalar and attribute See merge request: cann/pypto!5644 | 3 months ago | |
refactor(ir): fix CodeCheck warnings with hex literals and comment cleanup Co-authored-by: h9718w<wangchaoyuan10@huawei.com> # message auto-generated for no-merge-commit merge: !6327 merge cpp-cleanup into master refactor(ir): fix CodeCheck warnings with hex literals and comment cleanup Created-by: h9718w Commit-by: h9718w Merged-by: cann-robot Description: 修复 CodeCheck 扫描报告的告警,纯重构、不改变行为: 1. 魔法数字改为十六进制字面量:memory / out_elementwise / sanitizer_pass 中参数个数与尺寸校验的 2/3 统一写为 0x2/0x3 2. 参数索引补充 NOLINT 注释:out_elementwise 的 lhs/rhs 索引、printer 的 "::" 分隔符长度 3. 表达式加括号明确优先级:printer / io_text_dumper 中 AnyCast(...) 调用统一加括号 4. 注释清理:merge_stmts_pass 删除空注释行并补全算法描述、dead_code_elimination 注释措辞改写 See merge request: cann/pypto!6327 | 2 months ago | |
feat(IR): Fix io text dumper and loader's symbolic scalar and attribute Co-authored-by: Jie Yin<yinjie27@huawei.com> # message auto-generated for no-merge-commit merge: !5644 merge pil-ir-normalize into master feat(IR): Fix io text dumper and loader's symbolic scalar and attribute Created-by: yinjie27_ Commit-by: Jie Yin Merged-by: cann-robot Description: feat(IR): Fix io text dumper and loader's symbolic scalar and attribute See merge request: cann/pypto!5644 | 3 months ago | |
fix(ir): Fix raw tensor not correct after merge_stmt_pass Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !6015 merge rawmagic into master fix(ir): Fix raw tensor not correct after merge_stmt_pass Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Related Issue: #2559 See merge request: cann/pypto!6015 | 2 months ago | |
fix(ir): Fix raw tensor not correct after merge_stmt_pass Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !6015 merge rawmagic into master fix(ir): Fix raw tensor not correct after merge_stmt_pass Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Related Issue: #2559 See merge request: cann/pypto!6015 | 2 months ago | |
feat(pypto-pro): Refactor ssa & control flow Co-authored-by: poorwill<wangbing110@huawei.com> # message auto-generated for no-merge-commit merge: !6160 merge master into master feat(pypto-pro): Refactor ssa & control flow Created-by: wangbing110 Commit-by: poorwill Merged-by: cann-robot Description: feat(pypto-pro): Refactor ssa & control flow See merge request: cann/pypto!6160 | 2 months ago | |
fix(pypto_pro):delete unuse tensor ops Co-authored-by: huanyongben<huanyongben1@hisilicon.com> # message auto-generated for no-merge-commit merge: !6593 merge master into master fix(pypto_pro):delete unuse tensor ops Created-by: huanyongben Commit-by: huanyongben Merged-by: cann-robot Description: 删除废弃的tensor op相关代码 See merge request: cann/pypto!6593 | 2 months ago | |
feat(ir): Add block ir support Co-authored-by: wuzhongxin<wuzhongxin1@huawei.com> # message auto-generated for no-merge-commit merge: !3271 merge new_ir into master feat(ir): Add block ir support Created-by: wuzhongxin Commit-by: wuzhongxin Merged-by: cann-robot Description: add block ir See merge request: cann/pypto!3271 | 6 months ago | |
fix(machine): fix mismatch and incomplete error descriptions in machine and misc files Co-authored-by: chai-hw<chaizhengtong@huawei.com> # message auto-generated for no-merge-commit merge: !5806 merge pyptolog_fix3 into master fix(machine): fix mismatch and incomplete error descriptions in machine and misc files Created-by: chai-hw Commit-by: chai-hw Merged-by: cann-robot Description: machine 日志内容整改 See merge request: cann/pypto!5806 | 2 months ago | |
refactor(ir): fix CodeCheck warnings with hex literals and comment cleanup Co-authored-by: h9718w<wangchaoyuan10@huawei.com> # message auto-generated for no-merge-commit merge: !6327 merge cpp-cleanup into master refactor(ir): fix CodeCheck warnings with hex literals and comment cleanup Created-by: h9718w Commit-by: h9718w Merged-by: cann-robot Description: 修复 CodeCheck 扫描报告的告警,纯重构、不改变行为: 1. 魔法数字改为十六进制字面量:memory / out_elementwise / sanitizer_pass 中参数个数与尺寸校验的 2/3 统一写为 0x2/0x3 2. 参数索引补充 NOLINT 注释:out_elementwise 的 lhs/rhs 索引、printer 的 "::" 分隔符长度 3. 表达式加括号明确优先级:printer / io_text_dumper 中 AnyCast(...) 调用统一加括号 4. 注释清理:merge_stmts_pass 删除空注释行并补全算法描述、dead_code_elimination 注释措辞改写 See merge request: cann/pypto!6327 | 2 months ago | |
feat(ir): merge redundant producer results in token cleanup Co-authored-by: zhaojunhan<zhaojunhan1@huawei.com> # message auto-generated for no-merge-commit merge: !6115 merge merge_danglin into master feat(ir): merge redundant producer results in token cleanup Created-by: zhaojunhan Commit-by: zhaojunhan Merged-by: cann-robot Description: ## 背景 开启 AssembleNewLogicalTensor 后,ASSEMBLE 会产生新的 LogicalTensor version。部分后续构图场景中,ATOMIC_RMW 也可能产生同一 RawTensor 的多个结果版本。 当较早版本没有数据消费者,而后续兼容版本仍被使用时,保留多个结果 tensor 会造成冗余的 LogicalTensor 版本和数据依赖。 ## 修改内容 - 在 RemoveRedundantTokenPass 中新增 dangling producer result 合并逻辑。 - 在同一 SeqStmts 内,按 RawTensor 对单输出 TensorOp 结果分组。 - 将无数据消费者的较早结果,合并到后方第一个有数据消费者且 LogicalTensor 描述兼容的结果。 - 支持普通 TensorOp、ASSEMBLE 及 ATOMIC_RMW 输出结果的合并。 - 仅向后合并,不跨 If、For、While 的 SeqStmts 边界,避免引入反向依赖。 - 合并阶段不以写区或 token 作为门槛,也不主动删除 token;后续冗余 token 删除与未使用 token 清理继续负责 token 优化。 - 新增 atomic 多版本结果合并 UT,并更新重叠写场景的预期。 See merge request: cann/pypto!6115 | 2 months ago | |
feat(pypto_pro): Support L0C to L1 Co-authored-by: fa<yangzf993@163.com> # message auto-generated for no-merge-commit merge: !5821 merge l0ctol1 into master feat(pypto_pro): Support L0C to L1 Created-by: fafafafafa Commit-by: fa Merged-by: cann-robot Description: PR 应该避免没有描述信息,描述信息的最重要的作用是描述修改意图,应该清晰明了。例如:标题中包含了 fix 标签,如果没有描述信息,就需要Review人员猜测PR具体修复了哪些内容,或者怀疑修改的必要性。如果PR和特定的Issue相关,可以单独包含一行 Related Issue: 放到描述信息最后。 下面是一个典型的PR描述信息: The origin issue template brings too many noise, it's not suitable for git message. eg: comments are not removed, labels are redundant as the PR tile already contains the tag. The guide gives a clear suggestion on how to write the PR body. Related Issue: #1234,#5678 更多描述信息见:[Commit Message 规范](../docs/zh/contribute/pull-request.md#commit-message) See merge request: cann/pypto!5821 | 2 months ago | |
fix(ir): Select merged valid_shape by branch condition Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5840 merge fix/phi-shape into master fix(ir): Select merged valid_shape by branch condition Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Related Issue: #2559 See merge request: cann/pypto!5840 | 2 months ago | |
feat(IR): Fix io text dumper and loader's symbolic scalar and attribute Co-authored-by: Jie Yin<yinjie27@huawei.com> # message auto-generated for no-merge-commit merge: !5644 merge pil-ir-normalize into master feat(IR): Fix io text dumper and loader's symbolic scalar and attribute Created-by: yinjie27_ Commit-by: Jie Yin Merged-by: cann-robot Description: feat(IR): Fix io text dumper and loader's symbolic scalar and attribute See merge request: cann/pypto!5644 | 3 months ago |
| Files | Last commit | Last update |
|---|---|---|
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 3 months ago | ||
| 2 months ago | ||
| 3 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 6 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 3 months ago |