| Files | Last commit | Last update |
|---|---|---|
feat(dist): Support distribute for pypto_pro Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !7250 merge dist3 into master feat(dist): Support distribute for pypto_pro Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: distributed communication (dist) support (UBMEM&URMA) Adds kernel-side distributed communication capability across the device/machine/IR/codegen/frontend/Python-binding stack: - device: add device-side distributed runtime header pypto_distribute.h (windows, channels, transfers), plus pypto_panic/pypto_assert helpers and DIST_CHECK macros - machine: add WindowContext host runtime and pybind dist module, with a DistributeContext interface - IR: add WindowType and the dist.* op definitions (dist_ops.cpp/py) - codegen: lower dist.* ops to CCE (backend_cce_ops.cpp, backend_cce_block_out_ops.cpp, cce_codegen.cpp); fix line wrapping of the set_ctrl_spr atomic-op-type error message - frontend: expose pld.* APIs (windows/channels/transfers) inside kernels; add pl.tensor_view for no-copy GM tensor sub-views - runtime: resolve dist include paths and sanitizer traps for kernels at compile time - parser: drop stale design references from parser docs - tests: add pld.* frontend dispatch UTs, window ST (test_window.py), and tensor_view parsing/CCE codegen UTs See merge request: cann/pypto!7250 | 29 days ago | |
feat(pass): Enable VF fusion for ROWSUMLINE op Co-authored-by: Catherie<mayuan33@huawei.com> # message auto-generated for no-merge-commit merge: !6860 merge feat/vf-fuse-rowsumline into master feat(pass): Enable VF fusion for ROWSUMLINE op Created-by: Catherie Commit-by: Catherie Merged-by: cann-robot Description: feat(pass): Enable VF fusion for ROWSUMLINE op ROWSUMLINE 是与 ROWSUM_SINGLE / ROWMAX_SINGLE / ROWMIN_SINGLE / ROWPROD_SINGLE 同类的 AIV 行规约算子,后四者已在 SUPPORT_VF_FUSE_OPS 中,放开后 ROWSUMLINE 即可加入 VF 融合 loop 组。 VF 融合的 loop body 每次迭代只处理各 operand 的最后 2 维切片,因此 ROWSUMLINE 仅当 reduce 轴落在最后 2 维内时可融合;若 reduce 轴位于 leading 维,规约需要跨迭代累加,融合后结果是错的。对可融合情形,现有 TRowSumLine tile 模板天然兼容 2 维 loop 张量(axis 归一化到 5 维坐标系下恒为 3),无需修改模板。 变更内容: - SUPPORT_VF_FUSE_OPS 中增加 Opcode::OP_ROWSUMLINE,使 ROWSUMLINE 可编入 VF 融合 loop 组 - 注册 loop body tensor 时跳过 ROWSUMLINE 复用的 tmp buffer(ID1),与 _SINGLE 系列 reduce 算子保持一致 - LoopaxesProc 中按 reduce 轴做编组门控:携带 reduce AXIS 属性的算子,仅当轴落在输入 tensor 最后 2 维内时才允许加入 VF 组,否则断组走原有全维生成路径 ## 附带修复:ASan UTest 退出阶段崩溃 ### 问题描述 现象:ASan UT(Cpp-Clang-1x/2x/3x)所有用例 [ PASSED ],但每个进程在退出阶段崩溃,CI 失败: text Tracer caught signal 11: addr=0x43xxx ==xxxx==LeakSanitizer has encountered a fatal error. → 进程退出码 1 根因链(CANN 库 × 进程退出时序): text 每个 UT 进程 ├─ 静态初始化:两条路径 dlopen CANN 库 │ ① REGISTER_BACKEND_OP → BackendCCE → CreateSoC → CannRuntime → libruntime.so │ ② platform 查询 → CannHostRuntime → libprofapi/libruntime/libascendcl │ └─ 退出(glibc atexit 按注册逆序执行): ① TU 静态析构 + _dl_fini(运行所有已加载 .so 的析构,含 CANN 库) ← 先执行 ② LeakSanitizer 退出检查(ASan preinit 期注册,最后执行) ← 后执行 └─ CANN 库在退出链遗留的失效状态(线程/TLS)→ tracer SIGSEGV 触发源为 CI 环境 nightly CANN 包内容变化。无 NPU 构建机上 SoC 查询本就恒定失败并回退默认值,这两条加载路径在 UT 中属无收益的风险源。 ### 修改逻辑 思路:UTest 构建下双端均不加载 CANN 运行时(编译期裁剪),非 UTest 构建行为不变。 | 提交 | 文件 | 改动 | 作用 | |---|---|---|---| | edde29027 | cann_runtime.cpp | 构造函数加载逻辑包进 #ifdef BUILD_WITH_CANN | 堵路径①:tile_fwk_interface 在 UTest 构建本就不定义该宏(interface/CMakeLists.txt 既有设计),原代码未判断宏、无条件 dlopen,补上判断即编译期裁剪 | | 8e18b71b1 | cann_host_runtime/CMakeLists.txt | BUILD_WITH_CANN 定义加 NOT ENABLE_UTEST 条件 | 堵路径②:源码本有 #ifdef BUILD_WITH_CANN,但该目标无条件定义宏,UT 构建仍会加载;对齐 adapter 既有门控模式 | | 27a8ae3c8 | executable.py | 枚举失败时打印被捕获的子进程 stdout/stderr | 纯诊断:此前 check=True 子进程失败时输出被吞,CI 日志看不到真实报错 | 为什么两条都要堵:只堵单边会被另一条路径复活——此前仅门控 CannRuntime 的版本,1x/2x/3x 仍复现退出崩溃(CannHostRuntime 路径存活)。 行为影响:UTest 构建 = 不加载 + 走默认规格(与无 NPU 构建机现状等价);非 UTest 且 BUILD_WITH_CANN=ON = 加载照旧;BUILD_WITH_CANN=OFF = 原先也是加载失败回退默认值,仅少两条告警。 ## 验证 pypto-gym mhc_sinkhorn / mhc_pre 全部用例通过(同时覆盖可融合的 row_sum 与不可融合的 col_sum 场景,含 bs8/bs64/bs128/bs1024 的 golden 精度对比),pypto ST 用例回归通过。 Related Issues: cann/pypto#3550 See merge request: cann/pypto!6860 | 1 month ago | |
fix(codegen): Hide CCE split functions from runtime kernel registration Co-authored-by: KaiqiJin<jinkaiqi@huawei.com> # message auto-generated for no-merge-commit merge: !7420 merge master into master fix(codegen): Hide CCE split functions from runtime kernel registration Created-by: KaiqiJin Commit-by: KaiqiJin Merged-by: cann-robot Description: Declaration 接口扩展: Declaration 新增 bool isPart 参数,据此在 extern "C" __aicore__ 与 void 之间插入 __attribute__((visibility("hidden"))),使内部拆分函数不再作为可见符号暴露。 拆分子函数声明与定义隐藏: PlanCceSplit 中生成 part 包装体及 plan.header 声明时传入 isPart=true,使所有 _partNNNN 函数的声明和定义均带隐藏可见性。 ELF 可见性兜底: 在 plan.header 中为每个 part 追加 asm(".hidden <part.name>");,以应对编译器可能丢弃 aicore 函数可见性属性的情况。 入口函数保持可见: plan.entry 以 isPart=false 生成,原始 kernel 函数签名保持不变,仍可被运行时注册为入口,并继续调用各 part。 新增单元测试: InternalPartsAreHiddenAndEntryRemainsVisible 校验 header 与 part 源码中存在隐藏属性及 asm(".hidden ..."),且 plan.entry 中不含 visibility 标记、part 调用参数保持一致。 See merge request: cann/pypto!7420 | 20 days ago | |
feat(Operation): Add pypto.conv_backward_filter and its 2D implementation on A2/A3 Co-authored-by: Zehai<wangzehai3@huawei.com> Co-authored-by: hongyiliu111<liuhongyi1@huawei.com> Co-authored-by: yuxin5<yuxin5@huawei.com> Co-authored-by: xutianlong1<xutianlong1@huawei.com> Co-authored-by: zhouxuan78<zhouxuan78@huawei.com> # message auto-generated for no-merge-commit merge: !6752 merge dev into master feat(Operation): Add pypto.conv_backward_filter and its 2D implementation on A2/A3 Created-by: yuxin5 Commit-by: Zehai;yuxin5;zhouxuan78;xutianlong1;royccc;hongyiliu111 Merged-by: cann-robot Description: feat(Operation): Add pypto.conv_backward_filter and its 2D implementation on A2/A3 Add pypto.conv_backward_filter interface to compute the gradient of convolution with respect to the weight tensor, and implement its 2D support spanning the frontend interface, backend operation implementation and MTE codegen Changes: - Add pypto.conv_backward_filter frontend interface with parameter validation - Implement ConvBackwardFilter 2D backend operation and codegen - Add UT/ST test cases for the 2D implementation See merge request: cann/pypto!6752 | 1 month ago | |
fix(pass): Keep INDEX_ADD token deps on the tile op Co-authored-by: zhaojunhan<zhaojunhan1@huawei.com> # message auto-generated for no-merge-commit merge: !7487 merge fix_index_add_expand_token into master fix(pass): Keep INDEX_ADD token deps on the tile op Created-by: zhaojunhan Commit-by: zhaojunhan Merged-by: cann-robot Description: expand funciton时,将 index_add 的token 直接连接到实际 tile op上。而不是SLICE/CONTRACT上。 因为index_add的输出tensor是gm类型,后续CONTRACT会被删掉,导致依赖丢失。 See merge request: cann/pypto!7487 | 18 days ago | |
fix(machine): degrade EMULATION to DEVICE_RT under DRCO and keep swimlane complete Co-authored-by: rongziran<rongziran@huawei.com> # message auto-generated for no-merge-commit merge: !7456 merge fix-drco-emulation-degrade into master fix(machine): degrade EMULATION to DEVICE_RT under DRCO and keep swimlane complete Created-by: rongziran Commit-by: rongziran 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!7456 | 18 days ago | |
perf(reduce_copy): Allow two-stage N:M merge via direct path and bounded serial loss Co-authored-by: bytecode<dubingjia1@huawei.com> # message auto-generated for no-merge-commit merge: !7429 merge perf/reduce-copy-nm-two-stage into master perf(reduce_copy): Allow two-stage N:M merge via direct path and bounded serial loss Created-by: bytecode Commit-by: bytecode Merged-by: cann-robot Description: #3793 ## 问题 CheckMergeBenefitByStructuralPattern 对 N:M 结构一票否决(tensor 层双侧多 root 直接 return false、root 层 N:1+1:N 共存直接 return false),具备 UB2L1/L0C2UB 特殊通路资格的完整两阶段候选被拒绝,跨子图数据仍走 DDR 往返。 ## 修复 - CheckMergeBenefitByStructuralPattern:tensor 层 N:M 不再立即拒绝,改为建全量 root 级方向边,延迟到 root 层整体评估 - CheckTwoStageNmBenefit(新增):整体 N:M 时组内须为严格两层完全二部结构(双侧各 >=2 root、无中间/孤立 root、每个 prod->cons 均有调度依赖且带 root 对级直连证据,缺一即拒),两侧并行损失 sum−max <= 8 x 对侧 max(系数沿用 kSerialLossRatio)时放行 - hinge 护栏循环:仅当 hinge 端点及其全部分支都属于两阶段结构时豁免该条目,组外 hinge 与混入结构外分支的条目仍走原有 kHingeBranchThreshold + 串行损失护栏 ## 涉及文件 - reduce_copy.cpp:新增 CheckTwoStageNmBenefit 两阶段收益评估(直连证据 root 对绑定 + hinge 逐条豁免),N:M 拒绝路径改为直连门+损失约束放行 - reduce_copy.h:新增 CheckTwoStageNmBenefit 声明 - test_reduce_copy.cpp:新增 6 个 TwoStageNm 用例(放行正路径 / 缺调度依赖 / 单侧超预算 / 部分直连拒绝 / 结构内 hinge 豁免 / 组外扇出拦截),全量 ReduceCopyTest 85/85 通过 See merge request: cann/pypto!7429 | 18 days ago | |
feat(kirin9050): Support matmul macro instruction with pre-stage quant/dequant Co-authored-by: m0_71310678<lizhexun2@huawei.com> # message auto-generated for no-merge-commit merge: !7126 merge kirin9050-matmul-mergepr into master feat(kirin9050): Support matmul macro instruction with pre-stage quant/dequant Created-by: m0_71310678 Commit-by: m0_71310678 Merged-by: cann-robot Description: feat(kirin9050): Support matmul macro instruction with pre-stage quant/dequant Support Kirin9050 matmul macro instruction bring-up: - macro matmul codegen/tileop (attrs, quant, inplace, infer), decoupled from generic path - route quant_pre through macro matmul; GEMV routing and fp16/int8 K-slice clamps - L1->GM TSTORE direct store, l12ub/ub2l1 support - rework matmul quant UT ids, shapes and tile-split coverage (Q16.16 semantics) Changes: - Add Kirin9050 (NCH) LiteNPU platform support and matmul macro instruction codegen/tileop - Add l12ub/ub2l1 data path and per-channel quant_pre routing through macro matmul - Add Kirin9030/Kirin9050/KirinX90 codegen UT coverage for matmul, attention and other single operations See merge request: cann/pypto!7126 | 1 month ago | |
fix: Correct lrelu arguments, source location cleanup, directory retention and argsort docs Co-authored-by: Aiden<linking_sky@outlook.com> # message auto-generated for no-merge-commit merge: !7206 merge fix/consolidate-four-prs into master fix: Correct lrelu arguments, source location cleanup, directory retention and argsort docs Created-by: linking_sky Commit-by: Aiden Merged-by: cann-robot Description: ## 描述 Tensor.lrelu 多声明了一个 other 参数,调用 pypto.lrelu 时传入多余参数,导致默认调用和显式传入斜率时失败。pypto.lrelu 的输入参数名 other 与文档中的 input、注释中的 a 不一致,使用 input= 关键字调用会失败。 op_wrapper 和 source_location 在被包装函数抛出异常时未清理源码位置状态,导致后续算子使用错误的源码位置。 RemoveOldDirectories 按目录修改时间升序排序后删除超出保留数量的目录,实际保留旧目录、删除新目录。 argsort 文档中的 descending 默认值为 True,与实际实现的 False 不一致。 ## 修复 移除 Tensor.lrelu 中多余的 other 参数,正确传递当前张量和 negative_slope。将 pypto.lrelu 的输入参数名统一为 input,同步更新实现和注释。 在 op_wrapper 和 source_location 中使用 try/finally,确保异常发生后仍清理源码位置状态。 将历史目录按修改时间降序排序,保留最新目录,并补充目录保留顺序、保留数量边界及前缀过滤测试。 修正 argsort 文档中的默认值,明确默认按升序返回索引,并同步更新 docstring。 ## 测试 - Tensor.lrelu 通过 A3 环境测试,验证默认调用、位置参数、关键字参数和 native graph。 ### 关联ISSUE ISSUE:[#3685](https://gitcode.com/cann/pypto/issues/3685) See merge request: cann/pypto!7206 | 1 month ago | |
refactor(operator): Remove tile_fwk_operator library and associated tests. Co-authored-by: chai-hw<chaizhengtong@huawei.com> # message auto-generated for no-merge-commit merge: !5704 merge delete_test into master refactor(operator): Remove tile_fwk_operator library and associated tests. Created-by: chai-hw Commit-by: chai-hw Merged-by: cann-robot Description: 整改库上代码,删除 framework/src/operator python/tests/st/operator/glm python/tests/st/operator/test_page_attention.py 以及相关涉及文件 See merge request: cann/pypto!5704 | 3 months ago |
| Files | Last commit | Last update |
|---|---|---|
| 29 days ago | ||
| 1 month ago | ||
| 20 days ago | ||
| 1 month ago | ||
| 18 days ago | ||
| 18 days ago | ||
| 18 days ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 3 months ago |