| Files | Last commit | Last update |
|---|---|---|
fix(all): Fix spelling errors in source comments and diagnostic messages Co-authored-by: wangmingjun<wangmingjun13@huawei.com> # message auto-generated for no-merge-commit merge: !5392 merge fix/spelling-errors-2908 into master fix(all): Fix spelling errors in source comments and diagnostic messages Created-by: hwwangmingjun Commit-by: wangmingjun Merged-by: cann-robot Description: fix(all): Fix spelling errors in source comments and diagnostic messages 修复源码注释、错误信息和调试日志中多处英文拼写错误,避免阅读诊断输出时产生误解。 Changes: - device_error_code.h:defalut -> default - codegen_vector.cpp:occured/unsupport -> occurred/unsupported - operation_impl.cpp:interger -> integer - device_task_context.cpp:Inital -> Initial - directed_graph_util.h:lenght -> length - tune_sync_for_vf.cpp:falied -> failed(4 处) - graph_utils.h / expand_function.cpp:seperate -> separate - cube_process.cpp:invlid -> invalid - pil2ir.py:funtion -> function - test_dynamic_mm.cpp:intput -> input(4 处) Related Issues: #2908 See merge request: cann/pypto!5392 | 3 months ago | |
fix(pass): Fix isCube marking of view-like ops by operand memory domain in graph partition (9.2.0) Co-authored-by: oahisil<lisihao7@huawei.com> # message auto-generated for no-merge-commit merge: !6506 merge fix_aiv_ub_cross_core_dep_920 into 9.2.0 fix(pass): Fix isCube marking of view-like ops by operand memory domain in graph partition (9.2.0) Created-by: oahisil Commit-by: oahisil Merged-by: cann-robot Description: 修复 OOO 双 AIV 调度下 CV-Mix 算子编译失败,根因为 isCube 属性的语义错误。 ### 根因 isCube 表达 op 的执行核归属。CV-Mix 分图允许 AIC+AIV 合并进同一 SuperNode,旧代码将节点级结论(含任一 AIC 即 true)无差别覆盖节点内**所有** op,产生两类错误: 1. **AIV op 被误标 true**:TaskSplitter 据此将其核类型强制为 AIC, SetAllocInternalSubgraphID 找不到同核 producer/consumer,报 Set UB_ALLOC internal SubgraphID failed。 2. **view 类透明 op(VIEW/RESHAPE/ASSEMBLE,不发射指令)被节点级结论覆盖**:UB 域的 view 被标 true 后归入 AIC 任务,其 AIVCore 被抹成 UNSPECIFIED,作为 tensor 生产者的 ALLOC 池归属锚点断裂——共享该 tensor 的多个消费者被调度器分裂到不同 AIV,构成无法插同步的跨核 UB 访问,InsertSync 报 Sync between AIV0 and AIV1 happened。 ### 修复方案 - **SuperNodeGraphBuilder**:isCube 按 op 自身核类型设置(AIC→true / AIV→false / ANY 非 view→节点结论);**view 类 op 按操作数所在内存域设置**:L1/L0A/L0B/L0C(含经 DDR 落盘的 assemble 链)→ true,UB → false,无明确内存信息 → 节点结论。内存域判定保证 L1_ALLOC 仍能通过 L1/L0 view 链找到同核邻居(避免 Set L1_ALLOC internal SubgraphID failed 回归),同时 UB 域 view 留在向量侧维持 ALLOC 锚点。 - **MixInternalComponentsAnalyzer**:无 isCube 属性的 op(如分图后 merge pass 新建的 L1_TO_L0A/B)按其 opcode 注册核类型推导归属,与 TaskSplitter 推导口径一致,避免纯 AIC 组件误报 inconsistent isCube attribute。 TaskSplitter / InsertSync 不做任何改动。 ### 验证 Ascend950PR(CANN 9.2.0 + pto-isa): - gdr_fwd bt128 编译执行通过(max_abs=3.8e-04 / oor=0/524288) - C++ UT:GraphPartitionTest 58/58(含 TestScopeCase6)、MixInternalComponentsAnalyzer/AddAlloc/InsertSync 48/48、全量 POST_BUILD 通过(排除 2 个上游既有失败 AssignMemoryTypeTest.TestCubeToVec/TestVecToCubeV2,经基线对比确认与本次修改无关) - Python UT:interpreter/test_flash_attention_mha 通过 ### UT - GraphPartitionTest.TestViewIsCubeByOperandMemDomain:CV-mix 混合 SuperNode 内 UB 域 view 标 false、L1/L0B/L0A 域 view 标 true、跨域 assemble 标 true(回归守护) - MixInternalComponentsAnalyzerTest.TestMissingIsCubeDerivedByOpcode:无属性 op 按 opcode 推导,AIC 组件不再误报 - MixInternalComponentsAnalyzerTest.TestMissingIsCubeDerivedByOpcode_VecStillInconsistent:vec 型无属性 op 仍触发一致性检查(严格性守护) See merge request: cann/pypto!6506 | 2 months ago | |
feat(pass): Add common CopyOpAttribute shape dimension check Co-authored-by: Catherie<mayuan33@huawei.com> # message auto-generated for no-merge-commit merge: !5876 merge feat/copyop-shape-dimension-check into master feat(pass): Add common CopyOpAttribute shape dimension check Created-by: Catherie Commit-by: Catherie Merged-by: cann-robot Description: feat(pass): Add common CopyOpAttribute shape dimension check A CopyOpAttribute whose shape and rawShape have different dimensions is malformed. It previously slipped through PreGraph and only surfaced as obscure compile failures in later passes. This PR adds an early shape dimension check so such attributes fail fast with a clear error. Changes: - Add static Checker::CheckShapeForCopyOp as a pass-common check, alongside CheckDynAttrForView and CheckToDynOffsetForAssemble, reusable by all passes - Invoke it at the end of PreGraphProcess::RunOnFunction, after MergeViewAssemble, so attributes produced during the pass are also covered - Add UT CopyOpAttributeShapeRankMismatchIsRejected; full PreGraphTest and checker suites pass (115/115) issue: https://gitcode.com/cann/pypto/issues/3170 See merge request: cann/pypto!5876 | 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: !6181 merge merge_danglin_920 into 9.2.0 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!6181 | 2 months ago | |
style(all): Apply additional clang-format corrections across codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4883 merge style-cpp into master style(all): Apply additional clang-format corrections across codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Apply additional clang-format corrections across codebase See merge request: cann/pypto!4883 | 4 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: !6181 merge merge_danglin_920 into 9.2.0 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!6181 | 2 months ago | |
fix(pass): Modify Mva logic for token and legal Co-authored-by: 2501_92924845<niulinkai@huawei.com> # message auto-generated for no-merge-commit merge: !6492 merge sf0918 into 9.2.0 fix(pass): Modify Mva logic for token and legal Created-by: 2501_92924845 Commit-by: 2501_92924845 Merged-by: cann-robot Description: fix(pass): Modify Mva logic for token and legal See merge request: cann/pypto!6492 | 2 months ago | |
fix(pass): Fix log messages and coverage Co-authored-by: xujiayi1999<xujiayi28@huawei.com> # message auto-generated for no-merge-commit merge: !5807 merge fix-log-rectification into master fix(pass): Fix log messages and coverage Created-by: xujiayi1999 Commit-by: xujiayi1999 Merged-by: cann-robot Description: ### 变更概述 整改 Pass 模块日志中的拼写、语法及文案错误,提升日志准确性和可读性。 ### 主要变更 - 修正 candidate、partial、latest、Tarjan 等拼写错误。 - 修正日志中的语法错误及大小写错误。 - 修正输入/输出 datatype 日志描述。 - 修正 merge_src_dst_buffer 中日志参数传递错误。 - 补充 datatype 不匹配场景 UT,覆盖相关分支。 - 未调整表格中标记为“级别错配”的日志级别,保持本次修改范围聚焦于拼写和语法整改。 See merge request: cann/pypto!5807 | 2 months ago | |
refactor(pass): Resolve oversized functions and cyclomatic complexity Co-authored-by: wsl_qaq<wangshenglin3@huawei.com> # message auto-generated for no-merge-commit merge: !6481 merge tensor-graph-pass-cleancode-920 into 9.2.0 refactor(pass): Resolve oversized functions and cyclomatic complexity Created-by: wsl_qaq Commit-by: wsl_qaq Merged-by: cann-robot Description: cleancode 整改,内容包含: - 超大函数清除: - framework/src/passes/tensor_graph_pass/infer_tensor_format.cpp:InferTensorFormat::ApplyTransDataVecTile() 提取重复代码 - framework/src/passes/tensor_graph_pass/derivation_tile_shape.cpp:将 DerivationTileShape::DerivationReshapeTileShape() 的核心推导逻辑抽为静态函数 DeriveAndCheckReshapeTileShape(),DerivationTileShape::DerivationReshapeTileShape() 内部直接调用这个静态函数 - framework/src/passes/tensor_graph_pass/remove_redundant_reshape.cpp:将 RemoveRedundantReshape::RemoveReshape() 拆分为两个函数 TryCollectRedundantReshape() 和 DeleteRedundantReshapeOps(),前者负责收集冗余 OP_RESHAPE,后者负责删除这些冗余 OP - framework/src/passes/tensor_graph_pass/expand_function.cpp: - 将 ShouldSkipViewAssembleExpand() 内部的逐层遍历 BFS 流程抽离为独立函数,原函数内部直接调用 - 在 ExpandFunction::Expandfunction() 中,将收集跳过展开 op 的逻辑抽为 CollectSkipExpandOps();将"是否不展开"判断抽为静态方法 ShouldKeepOpUnexpanded();并将尾部收尾逻辑抽为 CopyEmuOpAttrsForAdds()、InheritTokenContract()、FinalizeExpansion() 等辅助函数 - 超大圈复杂度清除: - framework/src/passes/tensor_graph_pass/expand_function.cpp:ExpandFunction::Expandfunction() - cpp语言规则不满足清除: - framework/src/passes/block_graph_pass/schedule_ooo/post_schedule/ooo_scheduler.cpp:OoOScheduler::SelectSpillBuffers() 中去除不合理空行 See merge request: cann/pypto!6481 | 2 months ago | |
fix(pass): Fold common dynamic base of split views into reshape copy-in Co-authored-by: hwwangmingjun<wangmingjun13@huawei.com> # message auto-generated for no-merge-commit merge: !6571 merge fix/validshape-dynamic-offset-92-v2 into 9.2.0 fix(pass): Fold common dynamic base of split views into reshape copy-in Created-by: hwwangmingjun Commit-by: hwwangmingjun Merged-by: cann-robot Description: 修复动态 Reshape 场景下 View Offset 折叠错误导致的精度问题 ## 背景 在 ValidShape 动态场景中,动态非对齐 Reshape 会被替换为: RESHAPE_COPY_OUT -> workspace -> RESHAPE_COPY_IN -> 多个 View 当多个 View 由 Split 生成,并且同时包含动态起始地址和静态 tile 偏移时,原有逻辑无法正确识别共同动态基址,导致 RESHAPE_COPY_IN 使用错误的零偏移搬运数据,最终产生精度错误。 ## 问题根因 多个 View 的实际地址形式为: 共同动态基址 + 各自静态 tile 偏移 例如: dynamic_base + [ 0, 0] dynamic_base + [ 0, 32] dynamic_base + [16, 0] dynamic_base + [16, 32] 原逻辑直接比较各 View 的 offset,将: dynamic_base dynamic_base + 16 判定为不同地址,因此放弃 offset 折叠,使 RESHAPE_COPY_IN 保持: from offset = [0, 0] 在后续动态循环中,数据从错误的 GM 地址搬运,导致精度失败。 ## 修改内容 优化 RemoveUnalignedReshape 的 View Offset 折叠逻辑: - 识别多个 View 共享的动态基址; - 计算 View 覆盖的联合搬运区域; - 将动态基址下沉到 RESHAPE_COPY_IN; - 保留各 View 的局部静态 tile 偏移; - 同步更新 copy-in 的 shape 和动态 valid shape。 处理后: RESHAPE_COPY_IN offset = dynamic_base View offset: [ 0, 0] [ 0, 32] [16, 0] [16, 32] RESHAPE_COPY_IN 负责从正确的动态地址搬入完整数据块,各 View 负责选择对应的 tile。 ## 影响范围 该修改适用于以下通用模式: 多个 View 共享动态基址,同时具有不同的静态 tile 偏移 如果无法提取共同动态基址、动态末维 offset 不可表达,或联合区域越界,则保持原图,不执行折叠。 ## 测试验证 新增 UT 覆盖二维 tile View 的共同动态基址折叠场景: framework/tests/ut/passes/src/test_remove_unaligned_reshape_op.cpp 验证以下用例全部通过: 109、111、112、123、130、149、 152、163、165、173、180、183 其中 case 111 的 RESHAPE_COPY_IN 已从错误的零偏移改为使用动态行起始地址,精度恢复正常。 See merge request: cann/pypto!6571 | 2 months ago | |
fix(machine): Correct incorrect format specifiers in the log messages Co-authored-by: W4termy<wangmingyang21@huawei.com> # message auto-generated for no-merge-commit merge: !1363 merge log into master fix(machine): Correct incorrect format specifiers in the log messages Created-by: W4termy Commit-by: W4termy Merged-by: cann-robot Description: 修改使用错误的格式说明符 See merge request: cann/pypto!1363 | 8 months ago |
| Files | Last commit | Last update |
|---|---|---|
| 3 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 4 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 8 months ago |