| Files | Last commit | Last update |
|---|---|---|
fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Co-authored-by: HuYiSheng01<hys123456aaa@163.com> # message auto-generated for no-merge-commit merge: !5941 merge fix/issue3-assemble-no-start-offset into master fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Created-by: HuYiSheng01 Commit-by: HuYiSheng01 Merged-by: cann-robot Description: loop 循环中 assemble 写法不带起始 start 偏移量时存在精度问题。典型写法: output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, :h] = left # "[:h]" 不带 start output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, h:] = right Issue 中最小复现(test_coe_issue.py 1)triple-compare 精度 FAILED,IR 偏移证据为 to offset:[0,-64] to dynoffset:[...,-64]。 修复 Tensor._get_assemble_offset 对 slice(None, stop) 的偏移错算,使不带 start 的切片赋值写入正确位置。 按 Python 切片语义,切片起始位置即写入偏移——start 为 None 时 offset 置 0,否则为 start。同步清理不再使用的 stop/axis 局部变量。 此外,IR 文本 dump 能力增强 IRTextDumper::PrintAttrValue 缺少 std::vector<SymbolicScalar> 类型分支,导致 assemble/view 属性中的动态偏移(toOffset、fromOffset、toValidShape 等)序列化为 "Unsupported" 新增缺失分支,复用文件内已有的 VisitScalarExpr::Visit 打印器。[expr, expr] 列表格式符合 attr_value_list 文法,IRTextLoader round-trip 不受影响 新增 assemble_offset/ IR 快照回归测试(复刻 issue kernel 场景,pil.compile + check_snapshot);重渲染 94 个受影响黄金文件(Unsupported → 真实偏移表达式) Related Issue: #3216 See merge request: cann/pypto!5941 | 2 months ago | |
fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Co-authored-by: HuYiSheng01<hys123456aaa@163.com> # message auto-generated for no-merge-commit merge: !5941 merge fix/issue3-assemble-no-start-offset into master fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Created-by: HuYiSheng01 Commit-by: HuYiSheng01 Merged-by: cann-robot Description: loop 循环中 assemble 写法不带起始 start 偏移量时存在精度问题。典型写法: output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, :h] = left # "[:h]" 不带 start output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, h:] = right Issue 中最小复现(test_coe_issue.py 1)triple-compare 精度 FAILED,IR 偏移证据为 to offset:[0,-64] to dynoffset:[...,-64]。 修复 Tensor._get_assemble_offset 对 slice(None, stop) 的偏移错算,使不带 start 的切片赋值写入正确位置。 按 Python 切片语义,切片起始位置即写入偏移——start 为 None 时 offset 置 0,否则为 start。同步清理不再使用的 stop/axis 局部变量。 此外,IR 文本 dump 能力增强 IRTextDumper::PrintAttrValue 缺少 std::vector<SymbolicScalar> 类型分支,导致 assemble/view 属性中的动态偏移(toOffset、fromOffset、toValidShape 等)序列化为 "Unsupported" 新增缺失分支,复用文件内已有的 VisitScalarExpr::Visit 打印器。[expr, expr] 列表格式符合 attr_value_list 文法,IRTextLoader round-trip 不受影响 新增 assemble_offset/ IR 快照回归测试(复刻 issue kernel 场景,pil.compile + check_snapshot);重渲染 94 个受影响黄金文件(Unsupported → 真实偏移表达式) Related Issue: #3216 See merge request: cann/pypto!5941 | 2 months ago | |
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(operator): Make ScatterUpdate update dst inplace and preserve slot symbol Co-authored-by: gaoxingwang<camuel.gao@huawei.com> # message auto-generated for no-merge-commit merge: !6028 merge scatterupdate-inplace into master fix(operator): Make ScatterUpdate update dst inplace and preserve slot symbol Created-by: gaoxingwang Commit-by: gaoxingwang Merged-by: cann-robot Description: fix(operator): Make ScatterUpdate update dst inplace and preserve slot symbol ScatterUpdate returned a new tensor while leaving dst unchanged, which broke inplace semantics and lost dst ARG symbol in codegen when the src slot (nameless inplace-view SSA) took over dst registration. Changes: - Change ScatterUpdate dst parameter to a mutable reference and assign result back to dst so the caller-side tensor reflects the update - Register input names at param-declaration time via the new TensorSlotManager::MarkInputName (called in RootFunctionBuilder::InitDynFunc and RecordFunc::RecordDynFuncInner), so inputNameList keeps the original ARG symbols before any SetSameSlot migration - Keep slot marking and startArgs fill in BuildDynSlotScope unchanged - Register pypto.scatter_update in _patch_methods so inplace slot tracking covers it Related Issues: #3260 See merge request: cann/pypto!6028 | 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 | |
fix(ir): Fix store python object in pypto.loop Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5245 merge ir into master fix(ir): Fix store python object in pypto.loop Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Pyhton object which can't translate to irnode, should be execlude from iter_args and yield values Related Issue: #2559 See merge request: cann/pypto!5245 | 3 months ago | |
feat(IR): Check or render the func builder Co-authored-by: Jie Yin<yinjie27@huawei.com> # message auto-generated for no-merge-commit merge: !5746 merge ir-compile-assert into master feat(IR): Check or render the func builder Created-by: yinjie27_ Commit-by: Jie Yin Merged-by: cann-robot Description: feat(IR): Check or render the func builder See merge request: cann/pypto!5746 | 3 months ago | |
fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Co-authored-by: HuYiSheng01<hys123456aaa@163.com> # message auto-generated for no-merge-commit merge: !5941 merge fix/issue3-assemble-no-start-offset into master fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Created-by: HuYiSheng01 Commit-by: HuYiSheng01 Merged-by: cann-robot Description: loop 循环中 assemble 写法不带起始 start 偏移量时存在精度问题。典型写法: output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, :h] = left # "[:h]" 不带 start output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, h:] = right Issue 中最小复现(test_coe_issue.py 1)triple-compare 精度 FAILED,IR 偏移证据为 to offset:[0,-64] to dynoffset:[...,-64]。 修复 Tensor._get_assemble_offset 对 slice(None, stop) 的偏移错算,使不带 start 的切片赋值写入正确位置。 按 Python 切片语义,切片起始位置即写入偏移——start 为 None 时 offset 置 0,否则为 start。同步清理不再使用的 stop/axis 局部变量。 此外,IR 文本 dump 能力增强 IRTextDumper::PrintAttrValue 缺少 std::vector<SymbolicScalar> 类型分支,导致 assemble/view 属性中的动态偏移(toOffset、fromOffset、toValidShape 等)序列化为 "Unsupported" 新增缺失分支,复用文件内已有的 VisitScalarExpr::Visit 打印器。[expr, expr] 列表格式符合 attr_value_list 文法,IRTextLoader round-trip 不受影响 新增 assemble_offset/ IR 快照回归测试(复刻 issue kernel 场景,pil.compile + check_snapshot);重渲染 94 个受影响黄金文件(Unsupported → 真实偏移表达式) Related Issue: #3216 See merge request: cann/pypto!5941 | 2 months ago | |
fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Co-authored-by: HuYiSheng01<hys123456aaa@163.com> # message auto-generated for no-merge-commit merge: !5941 merge fix/issue3-assemble-no-start-offset into master fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Created-by: HuYiSheng01 Commit-by: HuYiSheng01 Merged-by: cann-robot Description: loop 循环中 assemble 写法不带起始 start 偏移量时存在精度问题。典型写法: output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, :h] = left # "[:h]" 不带 start output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, h:] = right Issue 中最小复现(test_coe_issue.py 1)triple-compare 精度 FAILED,IR 偏移证据为 to offset:[0,-64] to dynoffset:[...,-64]。 修复 Tensor._get_assemble_offset 对 slice(None, stop) 的偏移错算,使不带 start 的切片赋值写入正确位置。 按 Python 切片语义,切片起始位置即写入偏移——start 为 None 时 offset 置 0,否则为 start。同步清理不再使用的 stop/axis 局部变量。 此外,IR 文本 dump 能力增强 IRTextDumper::PrintAttrValue 缺少 std::vector<SymbolicScalar> 类型分支,导致 assemble/view 属性中的动态偏移(toOffset、fromOffset、toValidShape 等)序列化为 "Unsupported" 新增缺失分支,复用文件内已有的 VisitScalarExpr::Visit 打印器。[expr, expr] 列表格式符合 attr_value_list 文法,IRTextLoader round-trip 不受影响 新增 assemble_offset/ IR 快照回归测试(复刻 issue kernel 场景,pil.compile + check_snapshot);重渲染 94 个受影响黄金文件(Unsupported → 真实偏移表达式) Related Issue: #3216 See merge request: cann/pypto!5941 | 2 months ago | |
fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Co-authored-by: HuYiSheng01<hys123456aaa@163.com> # message auto-generated for no-merge-commit merge: !5941 merge fix/issue3-assemble-no-start-offset into master fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Created-by: HuYiSheng01 Commit-by: HuYiSheng01 Merged-by: cann-robot Description: loop 循环中 assemble 写法不带起始 start 偏移量时存在精度问题。典型写法: output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, :h] = left # "[:h]" 不带 start output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, h:] = right Issue 中最小复现(test_coe_issue.py 1)triple-compare 精度 FAILED,IR 偏移证据为 to offset:[0,-64] to dynoffset:[...,-64]。 修复 Tensor._get_assemble_offset 对 slice(None, stop) 的偏移错算,使不带 start 的切片赋值写入正确位置。 按 Python 切片语义,切片起始位置即写入偏移——start 为 None 时 offset 置 0,否则为 start。同步清理不再使用的 stop/axis 局部变量。 此外,IR 文本 dump 能力增强 IRTextDumper::PrintAttrValue 缺少 std::vector<SymbolicScalar> 类型分支,导致 assemble/view 属性中的动态偏移(toOffset、fromOffset、toValidShape 等)序列化为 "Unsupported" 新增缺失分支,复用文件内已有的 VisitScalarExpr::Visit 打印器。[expr, expr] 列表格式符合 attr_value_list 文法,IRTextLoader round-trip 不受影响 新增 assemble_offset/ IR 快照回归测试(复刻 issue kernel 场景,pil.compile + check_snapshot);重渲染 94 个受影响黄金文件(Unsupported → 真实偏移表达式) Related Issue: #3216 See merge request: cann/pypto!5941 | 2 months ago | |
fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Co-authored-by: HuYiSheng01<hys123456aaa@163.com> # message auto-generated for no-merge-commit merge: !5941 merge fix/issue3-assemble-no-start-offset into master fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Created-by: HuYiSheng01 Commit-by: HuYiSheng01 Merged-by: cann-robot Description: loop 循环中 assemble 写法不带起始 start 偏移量时存在精度问题。典型写法: output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, :h] = left # "[:h]" 不带 start output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, h:] = right Issue 中最小复现(test_coe_issue.py 1)triple-compare 精度 FAILED,IR 偏移证据为 to offset:[0,-64] to dynoffset:[...,-64]。 修复 Tensor._get_assemble_offset 对 slice(None, stop) 的偏移错算,使不带 start 的切片赋值写入正确位置。 按 Python 切片语义,切片起始位置即写入偏移——start 为 None 时 offset 置 0,否则为 start。同步清理不再使用的 stop/axis 局部变量。 此外,IR 文本 dump 能力增强 IRTextDumper::PrintAttrValue 缺少 std::vector<SymbolicScalar> 类型分支,导致 assemble/view 属性中的动态偏移(toOffset、fromOffset、toValidShape 等)序列化为 "Unsupported" 新增缺失分支,复用文件内已有的 VisitScalarExpr::Visit 打印器。[expr, expr] 列表格式符合 attr_value_list 文法,IRTextLoader round-trip 不受影响 新增 assemble_offset/ IR 快照回归测试(复刻 issue kernel 场景,pil.compile + check_snapshot);重渲染 94 个受影响黄金文件(Unsupported → 真实偏移表达式) Related Issue: #3216 See merge request: cann/pypto!5941 | 2 months ago | |
fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Co-authored-by: HuYiSheng01<hys123456aaa@163.com> # message auto-generated for no-merge-commit merge: !5941 merge fix/issue3-assemble-no-start-offset into master fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Created-by: HuYiSheng01 Commit-by: HuYiSheng01 Merged-by: cann-robot Description: loop 循环中 assemble 写法不带起始 start 偏移量时存在精度问题。典型写法: output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, :h] = left # "[:h]" 不带 start output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, h:] = right Issue 中最小复现(test_coe_issue.py 1)triple-compare 精度 FAILED,IR 偏移证据为 to offset:[0,-64] to dynoffset:[...,-64]。 修复 Tensor._get_assemble_offset 对 slice(None, stop) 的偏移错算,使不带 start 的切片赋值写入正确位置。 按 Python 切片语义,切片起始位置即写入偏移——start 为 None 时 offset 置 0,否则为 start。同步清理不再使用的 stop/axis 局部变量。 此外,IR 文本 dump 能力增强 IRTextDumper::PrintAttrValue 缺少 std::vector<SymbolicScalar> 类型分支,导致 assemble/view 属性中的动态偏移(toOffset、fromOffset、toValidShape 等)序列化为 "Unsupported" 新增缺失分支,复用文件内已有的 VisitScalarExpr::Visit 打印器。[expr, expr] 列表格式符合 attr_value_list 文法,IRTextLoader round-trip 不受影响 新增 assemble_offset/ IR 快照回归测试(复刻 issue kernel 场景,pil.compile + check_snapshot);重渲染 94 个受影响黄金文件(Unsupported → 真实偏移表达式) Related Issue: #3216 See merge request: cann/pypto!5941 | 2 months ago | |
fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Co-authored-by: HuYiSheng01<hys123456aaa@163.com> # message auto-generated for no-merge-commit merge: !5941 merge fix/issue3-assemble-no-start-offset into master fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Created-by: HuYiSheng01 Commit-by: HuYiSheng01 Merged-by: cann-robot Description: loop 循环中 assemble 写法不带起始 start 偏移量时存在精度问题。典型写法: output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, :h] = left # "[:h]" 不带 start output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, h:] = right Issue 中最小复现(test_coe_issue.py 1)triple-compare 精度 FAILED,IR 偏移证据为 to offset:[0,-64] to dynoffset:[...,-64]。 修复 Tensor._get_assemble_offset 对 slice(None, stop) 的偏移错算,使不带 start 的切片赋值写入正确位置。 按 Python 切片语义,切片起始位置即写入偏移——start 为 None 时 offset 置 0,否则为 start。同步清理不再使用的 stop/axis 局部变量。 此外,IR 文本 dump 能力增强 IRTextDumper::PrintAttrValue 缺少 std::vector<SymbolicScalar> 类型分支,导致 assemble/view 属性中的动态偏移(toOffset、fromOffset、toValidShape 等)序列化为 "Unsupported" 新增缺失分支,复用文件内已有的 VisitScalarExpr::Visit 打印器。[expr, expr] 列表格式符合 attr_value_list 文法,IRTextLoader round-trip 不受影响 新增 assemble_offset/ IR 快照回归测试(复刻 issue kernel 场景,pil.compile + check_snapshot);重渲染 94 个受影响黄金文件(Unsupported → 真实偏移表达式) Related Issue: #3216 See merge request: cann/pypto!5941 | 2 months ago | |
fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Co-authored-by: HuYiSheng01<hys123456aaa@163.com> # message auto-generated for no-merge-commit merge: !5941 merge fix/issue3-assemble-no-start-offset into master fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Created-by: HuYiSheng01 Commit-by: HuYiSheng01 Merged-by: cann-robot Description: loop 循环中 assemble 写法不带起始 start 偏移量时存在精度问题。典型写法: output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, :h] = left # "[:h]" 不带 start output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, h:] = right Issue 中最小复现(test_coe_issue.py 1)triple-compare 精度 FAILED,IR 偏移证据为 to offset:[0,-64] to dynoffset:[...,-64]。 修复 Tensor._get_assemble_offset 对 slice(None, stop) 的偏移错算,使不带 start 的切片赋值写入正确位置。 按 Python 切片语义,切片起始位置即写入偏移——start 为 None 时 offset 置 0,否则为 start。同步清理不再使用的 stop/axis 局部变量。 此外,IR 文本 dump 能力增强 IRTextDumper::PrintAttrValue 缺少 std::vector<SymbolicScalar> 类型分支,导致 assemble/view 属性中的动态偏移(toOffset、fromOffset、toValidShape 等)序列化为 "Unsupported" 新增缺失分支,复用文件内已有的 VisitScalarExpr::Visit 打印器。[expr, expr] 列表格式符合 attr_value_list 文法,IRTextLoader round-trip 不受影响 新增 assemble_offset/ IR 快照回归测试(复刻 issue kernel 场景,pil.compile + check_snapshot);重渲染 94 个受影响黄金文件(Unsupported → 真实偏移表达式) Related Issue: #3216 See merge request: cann/pypto!5941 | 2 months ago | |
fix(interface): Always do RefreshVarDependency when erase operation Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5986 merge vardeps into master fix(interface): Always do RefreshVarDependency when erase operation Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: tokens are bind to operation in tile graph, if operation has been deleted, tokens must be updated also Related Issue: #2559 See merge request: cann/pypto!5986 | 2 months ago | |
fix(ir): Support move Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5657 merge slot-move into master fix(ir): Support move Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Related Issue: #2559 See merge request: cann/pypto!5657 | 3 months ago | |
fix(interface): Always do RefreshVarDependency when erase operation Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5986 merge vardeps into master fix(interface): Always do RefreshVarDependency when erase operation Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: tokens are bind to operation in tile graph, if operation has been deleted, tokens must be updated also Related Issue: #2559 See merge request: cann/pypto!5986 | 2 months ago | |
feat(pass): Add slice contract feature for pass with some cases Co-authored-by: 2501_92924845<niulinkai@huawei.com> # message auto-generated for no-merge-commit merge: !5568 merge slice5close into master feat(pass): Add slice contract feature for pass with some cases Created-by: 2501_92924845 Commit-by: 2501_92924845 Merged-by: cann-robot Description: PR描述 1.背景 历史实现中,OP_VIEW 和 OP_ASSEMBLE 同时承担两类语义: 视图转换语义:描述 tensor 的 shape、offset、dyn offset、dyn valid shape 等逻辑视图关系。 搬运语义:在 tile graph 后段被 GenerateMoveOp 转换为 copy in / copy out 等真实搬运操作。 本需求将这两类语义拆开: OP_VIEW / OP_ASSEMBLE:保留为视图语义,表达逻辑视图关系。 OP_SLICE / OP_CONTRACT:表达搬运语义,分别对应原 copy in 方向和 copy out 方向的 tile 级搬运描述。 在 ExpandFunction 阶段,原先需要展开的 VIEW/ASSEMBLE 会被展开为 tile 级的 SLICE/CONTRACT。后续 tile graph pass 不能再默认 VIEW/ASSEMBLE 一定会生成真实搬运,而需要按新语义区分: 优化、合并、图结构分析类 pass 需要识别 view-like 和 assemble-like 两组 opcode。 内存推导和 move 生成类 pass 应以 SLICE/CONTRACT 作为真实搬运入口。 本设计覆盖 PVC2_OOO 策略中从 MergeViewAssemble 到 GenerateMoveOp 的相关 pass。 2.. 目标与非目标 2.1 目标 支持 ExpandFunction 后图中出现 OP_SLICE/OP_CONTRACT,并保证后续 pass 能正确识别、合并、拆分、分区和生成 move op。 将原来依赖 OP_VIEW/OP_ASSEMBLE 的搬运逻辑迁移到 OP_SLICE/OP_CONTRACT。 保留 OP_VIEW/OP_ASSEMBLE 的视图表达能力,避免把纯视图语义误转成 copy。 保持现有 offset、dyn offset、dyn valid shape、scope、atomic RMW 属性等关键信息在 pass 改写中正确传递。 兼容原有 pass 中 view/assemble 链路优化能力,使其覆盖 slice/contract 场景。 2.2 非目标 不改变用户侧 API 的 view/assemble 表达方式。 不改变 copy op 的最终执行语义。 不在 GenerateMoveOp 中继续把普通 OP_VIEW/OP_ASSEMBLE 当作搬运入口。 不引入新的 attribute 类型;OP_SLICE 复用 ViewOpAttribute,OP_CONTRACT 复用 AssembleOpAttribute。 2.3 相关验证 MergeViewAssemble UT:覆盖 view-view、slice-view、view-slice、assemble-contract 等链路合并,验证合并后 opcode 和 attribute 正确。 SplitReshape UT:覆盖 contract -> reshape -> slice、reduce_acc 前驱跳过、动态 shape 变轴跳过。 SplitLargeFanoutTensor UT:覆盖大 fanout 中 assemble-like producer 和 view-like consumer 的拆分、offset 更新和冗余删除。 AssignMemoryType UT:覆盖 slice/contract 的 original、requirement、convert 改写、LiteNPU reshape 特殊路径。 RemoveRedundantOp UT:覆盖 view/assemble-like perfect match、partial match、multi-contract-single-slice、single-contract-multi-slice。 ProcessAtomic UT:覆盖 AtomicRMW 属性下沉到 contract、offset 累加、VecDup 分支删除。 GraphPartition 与 IntraSubgraphAdapter UT:覆盖跨子图边界插入 slice/contract,以及 legacy view/assemble memory 不一致时的原地改写。 GenerateMoveOp UT:验证 OP_SLICE/OP_CONTRACT 正确生成 copy in/out,且普通 OP_VIEW/OP_ASSEMBLE 不再作为 move 入口。 See merge request: cann/pypto!5568 | 3 months ago | |
fix(ir): fix iter args bug cause outcast infer bug Co-authored-by: seu_chang<liuchang169@huawei.com> # message auto-generated for no-merge-commit merge: !5797 merge master into master fix(ir): fix iter args bug cause outcast infer bug Created-by: seu_chang Commit-by: seu_chang Merged-by: cann-robot Description: 问题根因 canonicalize 中的 liveness 分析对 for 循环 iter args 存在误判:只要 iterVar 与对应 returnVar 共享同一 raw tensor,就无条件 AddLiveUses 认为是原地累加器(accumulator carry)。但当循环体并未真正通过副作用算子写该 tensor 时(phi 只是被动继承了 iterVar 的 raw tensor,属死传递 carry),错误地保活导致 outcast 推导出错。 修复(framework/src/interface/ir/transforms/utils/canonicalize.cpp:66-168) 1. 新增成员 sideEffectResults_:遍历时收集副作用算子(ASSEMBLE / ASSEMBLE_SSA / ATOMIC_RMW)的结果。 2. 重写 ForStmt 的 VisitStmt_ 逻辑:先遍历循环体,再逐个 iter arg 判定——IsSameRawTensor(iterVar, returnVar) 且该 raw tensor 确实被循环体内的副作用算子写过,才 AddLiveUses 保活;否则视为死 carry 不保活。 See merge request: cann/pypto!5797 | 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 | |
fix(ir): Fix liveness not correct in canonicalize pass Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5334 merge shape into master fix(ir): Fix liveness not correct in canonicalize pass Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Related Issue: #2559 See merge request: cann/pypto!5334 | 3 months ago | |
fix(ir): Support move Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5657 merge slot-move into master fix(ir): Support move Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Related Issue: #2559 See merge request: cann/pypto!5657 | 3 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 | |
fix(ir): Support move Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5657 merge slot-move into master fix(ir): Support move Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Related Issue: #2559 See merge request: cann/pypto!5657 | 3 months ago | |
fix(pypto-pro): lower loop target and classify tuple Co-authored-by: poorwill<wangbing110@huawei.com> # message auto-generated for no-merge-commit merge: !6261 merge master into master fix(pypto-pro): lower loop target and classify tuple Created-by: wangbing110 Commit-by: poorwill Merged-by: cann-robot Description: 1. add lower for loop target 2. classify tuple to tuple, named tuple, struct in parser 3. add doc for astype interface See merge request: cann/pypto!6261 | 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 | |
feat(IR): Check or render the func builder Co-authored-by: Jie Yin<yinjie27@huawei.com> # message auto-generated for no-merge-commit merge: !5746 merge ir-compile-assert into master feat(IR): Check or render the func builder Created-by: yinjie27_ Commit-by: Jie Yin Merged-by: cann-robot Description: feat(IR): Check or render the func builder See merge request: cann/pypto!5746 | 3 months ago | |
feat(IR): frontend pass output new format IR Co-authored-by: Jie Yin<yinjie27@huawei.com> # message auto-generated for no-merge-commit merge: !5459 merge normalize-ir-compare into master feat(IR): frontend pass output new format IR Created-by: yinjie27_ Commit-by: Jie Yin Merged-by: cann-robot Description: feat(IR): frontend pass output new format IR See merge request: cann/pypto!5459 | 3 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
feat(ir): Make assemble mark_store controllable via runtime switch Co-authored-by: zhaojunhan<zhaojunhan1@huawei.com> # message auto-generated for no-merge-commit merge: !5591 merge revert_ops into master feat(ir): Make assemble mark_store controllable via runtime switch Created-by: zhaojunhan Commit-by: zhaojunhan Merged-by: cann-robot Description: ## 背景 pil/ops.py 中 assemble 的 Block.mark_store 此前为全局无条件调用,无法按场景关闭,影响 LogicalTensor 版本生成的灵活性。 ## 改动内容 - **开关控制**:ops.py 中 assemble 的 mark_store 改为仅在 assemble_new_logical_tensor() 返回 True 时执行,实现运行时开关 - **新增接口**:builder.cpp / ir.pyi 新增 assemble_new_logical_tensor() getter,与已有的 set_assemble_new_logical_tensor() 配套 - **UT 同步**:run_merge_pass 默认 create_new_logical_tensor=True, 移除测试中冗余的显式传参,重新生成 8 个 merge_pass golden 文件 See merge request: cann/pypto!5591 | 3 months ago | |
fix(ir): Support move Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5657 merge slot-move into master fix(ir): Support move Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Related Issue: #2559 See merge request: cann/pypto!5657 | 3 months ago | |
fix(ir): Support get_tensor_data Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5466 merge tensor_data into master fix(ir): Support get_tensor_data Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Related Issue: #2559 See merge request: cann/pypto!5466 | 3 months ago | |
fix(interface): Optimize redundant tokens with new logical tensors Co-authored-by: zhaojunhan<zhaojunhan1@huawei.com> # message auto-generated for no-merge-commit merge: !5744 merge fix_reshape_inplace_ into master fix(interface): Optimize redundant tokens with new logical tensors Created-by: zhaojunhan Commit-by: zhaojunhan Merged-by: cann-robot Description: ## 问题背景 开启 create_new_logical_tensor=True 后,部分场景会产生不必要的 token 依赖: - inplace reshape 仅建立 storage alias,不产生真实内存读写,但原先会生成 read/write token,影响后续 MergeViewAssemble 和 DCE,可能导致 hidden function 被错误删除。 - 写入区域不相交的多个 assemble 仍被 token 串行化,造成性能劣化。 ## 修改内容 - 将 inplace reshape 设为 token-transparent,不再生成冗余 read/write token。 - 在当前 SCF 块内,删除能够证明访问区域不相交的 token 依赖。 - 第一阶段暂不处理跨 SCF 的 token 分析与转发。 - 补充并更新相关 UT 和 IR 快照。 ## 验证结果 - 相关 token UT 全部通过。 - InterleaveRope 精度无损,性能恢复至约 225.97 μs。 See merge request: cann/pypto!5744 | 3 months ago |
| Files | Last commit | Last update |
|---|---|---|
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 3 months ago | ||
| 2 months ago | ||
| 3 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 2 months ago | ||
| 3 months ago | ||
| 2 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 4 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 3 months ago |