| Files | Last commit | Last update |
|---|---|---|
feat(pypto_pro): Upload for ssa Co-authored-by: liuyu<liuyu205@hisilicon.com> # message auto-generated for no-merge-commit merge: !6854 merge master_st into master feat(pypto_pro): Upload for ssa Created-by: liuyu205 Commit-by: liuyu Merged-by: cann-robot Description: Upload for ssa See merge request: cann/pypto!6854 | 24 days ago | |
fix(pypto-pro): Fix tiletype in IR and keep camelCase code style Co-authored-by: poorwill<wangbing110@huawei.com> # message auto-generated for no-merge-commit merge: !7348 merge vf_fusion into master fix(pypto-pro): Fix tiletype in IR and keep camelCase code style Created-by: wangbing110 Commit-by: poorwill Merged-by: cann-robot Description: fix(pypto-pro): Fix tiletype in IR and keep camelCase code style See merge request: cann/pypto!7348 | 25 days ago | |
feat(pypto-pro): Add insert sync pass Co-authored-by: poorwill<wangbing110@huawei.com> # message auto-generated for no-merge-commit merge: !7055 merge master into master feat(pypto-pro): Add insert sync pass Created-by: wangbing110 Commit-by: poorwill Merged-by: cann-robot Description: feat(pypto-pro): Add insert sync pass See merge request: cann/pypto!7055 | 1 month ago | |
feat(ir): Infer read and write tokens in tensor graphs Co-authored-by: zhaojunhan<zhaojunhan1@huawei.com> # message auto-generated for no-merge-commit merge: !5402 merge add_token_0810_2 into master feat(ir): Infer read and write tokens in tensor graphs Created-by: zhaojunhan Commit-by: zhaojunhan Merged-by: cann-robot Description: 为 Tensor Graph 增加前端 Token 推导能力,保证共享同一个 RawTensor 的 LogicalTensor 之间具有正确的内存访问依赖。 主要修改: - 将 TensorOpStmt 的 result_token 从单个 Token 改为 Token 列表 - 适配 IR Builder、Visitor、Mutator、Printer、Verifier、Python Binding 和 DCE 等相关模块 - 增加 NORMAL、READ 和 WRITE 三种 Token 类型 - 为 TensorOp 自动推导 Read Token 和 Write Token - 同一个 RawTensor 连续多次读取时复用最新的 Read Token - 为WAR、WAW、RAW场景建立 Token 依赖 - 支持 Token 状态在 IfStmt 和 ForStmt 控制流中的传递与合并 - SSA 校验允许共享的 Read Token 被重复定义 - 增加顺序执行和控制流场景的 C++、Python 测试 See merge request: cann/pypto!5402 | 3 months ago | |
feat(pypto_pro): Add ConvTile declaration and allocation support Co-authored-by: h9718w<wangchaoyuan10@huawei.com> # message auto-generated for no-merge-commit merge: !7061 merge feat-conv-tile into master feat(pypto_pro): Add ConvTile declaration and allocation support Created-by: h9718w Commit-by: h9718w Merged-by: cann-robot Description: 扩展 pypto_pro 前端支持卷积数据布局(NC1HWC0、NDC1HWC0、FRACTAL_Z、FRACTAL_Z_3D):多维 Tile 不再生成为 2-D 的 pto::Tile,而是生成为 L1 中的 pto::ConvTile,并支持通过 make_tile_group 对 ConvTile 进行声明与分配。 目前该接口只提供 ConvTile 的声明与分配能力,卷积数据搬运路径(GM 装载、im2col 折叠等)不在本次范围内。 主要变更: - IR 枚举、io_text 映射与 Python 绑定新增四个卷积 TensorLayout 取值 - 前端对多维卷积布局 TileType 提前校验:仅限 L1、按布局约束 rank,固定 16 与 C0 规则、dtype 白名单均镜像 pto-isa - 卷积布局由 HardwareInfo.conv_layout 承载,CCE codegen 发射 ConvTile<...>,且不携带 pto::ConvTile 所拒绝的 2-D (rows, cols) 构造实参 - 结构相等、哈希、IR 打印与 io_text 往返对新 conv_layout 字段保持一致 - 新增 parser/codegen 单元测试(全文 .pypto golden 对比)、C++ io_text 往返单元测试以及声明与分配的 NPU 上板系统测试 - 更新 SIMD-API 中 TileType 与 TensorLayout 的卷积布局文档 See merge request: cann/pypto!7061 | 19 days ago | |
refactor(interface): Resolve code style and standard violations. Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !3659 merge review into master refactor(interface): Resolve code style and standard violations. Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: 代码规范处理 See merge request: cann/pypto!3659 | 5 months ago | |
feat(pass):Adapt static to dynamic for kirin Co-authored-by: fangrui_32<fangrui30@h-partners.com> # message auto-generated for no-merge-commit merge: !6986 merge master into master feat(pass):Adapt static to dynamic for kirin Created-by: fangrui_32 Commit-by: fangrui_32 Merged-by: cann-robot Description: Related Issue:[[Requirement|需求建议]: Adapt static to dynamic for kirin](https://gitcode.com/cann/pypto/issues/3597) See merge request: cann/pypto!6986 | 1 month 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 | |
fix(pypto-pro): Fix tiletype in IR and keep camelCase code style Co-authored-by: poorwill<wangbing110@huawei.com> # message auto-generated for no-merge-commit merge: !7348 merge vf_fusion into master fix(pypto-pro): Fix tiletype in IR and keep camelCase code style Created-by: wangbing110 Commit-by: poorwill Merged-by: cann-robot Description: fix(pypto-pro): Fix tiletype in IR and keep camelCase code style See merge request: cann/pypto!7348 | 25 days ago | |
fix(pypto-pro): Fix tiletype in IR and keep camelCase code style Co-authored-by: poorwill<wangbing110@huawei.com> # message auto-generated for no-merge-commit merge: !7348 merge vf_fusion into master fix(pypto-pro): Fix tiletype in IR and keep camelCase code style Created-by: wangbing110 Commit-by: poorwill Merged-by: cann-robot Description: fix(pypto-pro): Fix tiletype in IR and keep camelCase code style See merge request: cann/pypto!7348 | 25 days 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): Fix tiletype in IR and keep camelCase code style Co-authored-by: poorwill<wangbing110@huawei.com> # message auto-generated for no-merge-commit merge: !7348 merge vf_fusion into master fix(pypto-pro): Fix tiletype in IR and keep camelCase code style Created-by: wangbing110 Commit-by: poorwill Merged-by: cann-robot Description: fix(pypto-pro): Fix tiletype in IR and keep camelCase code style See merge request: cann/pypto!7348 | 25 days ago | |
fix(pypto-pro): Fix tiletype in IR and keep camelCase code style Co-authored-by: poorwill<wangbing110@huawei.com> # message auto-generated for no-merge-commit merge: !7348 merge vf_fusion into master fix(pypto-pro): Fix tiletype in IR and keep camelCase code style Created-by: wangbing110 Commit-by: poorwill Merged-by: cann-robot Description: fix(pypto-pro): Fix tiletype in IR and keep camelCase code style See merge request: cann/pypto!7348 | 25 days ago | |
# feat(ir): Add remove_redundant_token_pass Co-authored-by: zhaojunhan<zhaojunhan1@huawei.com> # message auto-generated for no-merge-commit merge: !5463 merge add_token_pass_0815 into master # feat(ir): Add remove_redundant_token_pass Created-by: zhaojunhan Commit-by: zhaojunhan Merged-by: cann-robot Description: ## 背景 InferTokenPass 推导Token依赖时是保守的:只要两个算子之间**可能**存在别名/读写冲突,就会挂一条Token边。这会让IR里残留很多实际不必要的依赖边,过度串行化IR,限制后续调度/代码生成阶段的优化空间。 ## 本次改动 新增RemoveRedundantTokenPass,在InferTokenPass建好保守的Token依赖之后运行,消除输入侧冗余Token依赖,并清理输出侧不再被任何人消费的result_token_。在jit中通过create_new_logical_tensor使能token相关功能。 ## Token删除原则 Pass只处理READ/WRITE两类Token,且在每个SeqStmts作用域内独立、反复删除,直到没有Token可以继续优化为止(跨If/For/While边界的Token当前暂不删除)。删除逻辑分三类,另有一套删除后的依赖补偿机制: ### 一、已有其他依赖路径,当前token可删 若producer到consumer之间,除当前token外已经存在数据依赖或其他token依赖,当前token不再提供额外的执行顺序约束,直接删除。 实现链路:IsReachable()检查是否存在替代依赖路径 → DependsOn()判断数据结果或其他token是否构成依赖 → 确认可达后由TryRemoveOneToken()从consumer.tokens中删除。 ### 二、访问区域互不重叠,token可删 若当前token是READ或WRITE类型,且producer与consumer对同一底层RawTensor的相关访问区域能够证明不重叠,则两者不存在内存冲突,token可删除。 判断规则: - WRITE token:producer的写区域必须与consumer的读、写区域**均**不重叠; - READ token:producer的读区域必须与consumer的写区域不重叠; - 任意一个维度满足lhs.offset + lhs.shape <= rhs.offset或反向关系,即可证明两个多维区域不相交;动态shape/offset无法化简成确定布尔结果时保守地不删除;RawTensor、维数,或token与访问区域数量无法一一对应时也不删除。 - View:读区域取ViewOpAttribute的源offset,shape用view结果的shape;Assemble:写区域取AssembleOpAttribute的目标offset,shape用源tensor的shape。 此外还要求consumer的输出没有被非TensorOpStmt的其他语句直接引用(HasExternalUse()),否则即便访问区域不重叠也保留该token。 (相关实现:GetReadRegions() / GetWriteRegions()提取访问区域,ProveDisjoint()证明区域不重叠,AccessesAreDisjoint()按token类型检查访问冲突。) ### 三、已经没有使用者的结果token,直接清理 前两类优化完成后,TokenUseCollector再遍历整棵IR,收集仍被使用(出现在args_/tokens_中)的token;UnusedResultTokenRemover删除未被使用的result_token_,同时清空LogicalTensor中关联的readToken/writeToken,避免悬空引用。 ### 四、删除后的依赖补偿 第二类(区域不重叠)场景删除token时,还需要维护依赖关系:把producer自身依赖的前驱token补到consumer上,防止依赖链被截断;若consumer的后继节点依赖consumer,则把被删除的token补到后继节点上,维持下游约束。第一类(已有替代路径)场景无需补偿——替代路径本身已经承载了原有的顺序约束。 ### 五、核心原则 只有在token不再提供独立的顺序约束,或者能确定相关内存访问互不冲突时才删除;无法证明安全时一律保留。最后清理所有无使用者的输出token。只有Token列表实际发生变化的TensorOpStmt会被重建,其余语句原样返回。 ## 复杂度 设N为单个SeqStmts内的TensorOp数量,整体复杂度为稀疏图O(N^2)、稠密图最坏O(N^3)。原因:删除调度按consumer正向单遍处理(一次删除只影响当前consumer及其后继,不影响已处理完的前驱,故无需从头重扫),配合一次性构建的ProducerMap把producer查询降到平均常数级、可达性检查只沿真实依赖边传播,三者共同把复杂度从朴素做法(每删一个Token全局重扫 + 反向查producer + 枚举节点对判可达,常见O(N^3)、最坏O(N^4))降低了一个量级。 See merge request: cann/pypto!5463 | 3 months ago | |
fix(sanitizer): Extend acc in-place contract to runtime valid_shape Co-authored-by: zhengyaoff12<zhengyao12@huawei.com> # message auto-generated for no-merge-commit merge: !7391 merge fix/matmul-acc-same-tile into master fix(sanitizer): Extend acc in-place contract to runtime valid_shape Created-by: zhengyaoff12 Commit-by: zhengyaoff12 Merged-by: cann-robot Description: The in-place contract check of matmul_acc/matmul_mx_acc compared only the Acc memref address, so a dst/acc pair that shares the address but differs in runtime valid_shape passed the PHASE_MISMATCH check. Compare the full runtime view identity during sanitizer replay. Changes: - Extend the PhaseAccess wire with the runtime valid_rows/valid_cols of both Acc views - Compare address and valid_shape during replay and report per-field differences - Cover the new checks with IR and replay UTs See merge request: cann/pypto!7391 | 22 days ago | |
fix(pypto-pro): Fix tiletype in IR and keep camelCase code style Co-authored-by: poorwill<wangbing110@huawei.com> # message auto-generated for no-merge-commit merge: !7348 merge vf_fusion into master fix(pypto-pro): Fix tiletype in IR and keep camelCase code style Created-by: wangbing110 Commit-by: poorwill Merged-by: cann-robot Description: fix(pypto-pro): Fix tiletype in IR and keep camelCase code style See merge request: cann/pypto!7348 | 25 days ago |
| Files | Last commit | Last update |
|---|---|---|
| 24 days ago | ||
| 25 days ago | ||
| 1 month ago | ||
| 3 months ago | ||
| 19 days ago | ||
| 5 months ago | ||
| 1 month ago | ||
| 2 months ago | ||
| 25 days ago | ||
| 25 days ago | ||
| 2 months ago | ||
| 25 days ago | ||
| 25 days ago | ||
| 3 months ago | ||
| 22 days ago | ||
| 25 days ago |