| Files | Last commit | Last update |
|---|---|---|
feat(dist): Do some minor changes to dist feature Co-authored-by: tsungl4<lidongsheng4@huawei.com> Co-authored-by: tsungl4<lidongsheng@huawei.com> # message auto-generated for no-merge-commit merge: !7726 merge channel into master feat(dist): Do some minor changes to dist feature Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Move distributed window channel management onto the HCCL communication object, and rename the "multi-issuer" window concept to "is_shared" to reflect what it actually means: all peers share one local UBC_CTP endpoint, so each AIV owns a private jetty. See merge request: cann/pypto!7726 | 3 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(operation): Quantize -2轴量化直接移除transpose路径 Co-authored-by: 黄志航<huangzhihang3@huawei.com> # message auto-generated for no-merge-commit merge: !7725 merge quantize_axis_expand into master fix(operation): Quantize -2轴量化直接移除transpose路径 Created-by: qq_45040873 Commit-by: 黄志航 Merged-by: cann-robot Description: Quantize -2轴量化直接移除transpose路径,并重写tileOP不走isa TQuant接口 See merge request: cann/pypto!7725 | 3 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 | 29 days ago | |
fix(pypto_pro):fix bug of img2ColConfig and convTile load Co-authored-by: Zehai<wangzehai3@huawei.com> # message auto-generated for no-merge-commit merge: !7805 merge fix_img2colConfig into master fix(pypto_pro):fix bug of img2ColConfig and convTile load Created-by: Zehai Commit-by: Zehai Merged-by: cann-robot Description: 1.修复img2ColConfig中的padding参数的错误 Changes:将padding从编译期常量修改为运行期参数 2.修复convTile load中cin向上cin0对齐的错误 Changes:将cin从向上cin0对齐修改为非cin0对齐 See merge request: cann/pypto!7805 | 23 hours ago | |
fix(machine): TryAllocate dyn-CM on incast when need-alloc flag is set Co-authored-by: songyangyang18<songyangyang18@huawei.com> # message auto-generated for no-merge-commit merge: !7785 merge topo into master fix(machine): TryAllocate dyn-CM on incast when need-alloc flag is set Created-by: songyangyang18 Commit-by: songyangyang18 Merged-by: cann-robot Description: ## 问题 Host Control-Flow Cache 录制装不下、触发 Device **partial continue** 时,动态 Cell Match(dyn-CM)表仍可能挂着 **Host 侧地址**。Device 上若继续按该指针做 stitch / 还池,会出现: - AICPU **SIGSEGV**( PartialUpdateStitchConsumer 解引用空/野表) - 或 freelist / Reloc 异常(如 **507018**) 典型复现:op_combo_matrix case174(op_combo_cv_2v2c_waw_single_conv_s3_tail_eager,stitch_function_max_num=2)。 ## 原因 1. **Fill 清表(预期行为)** Device 启动 FillInputOutputSlot 时,将落在 devProg 镜像外的 Host dyn-CM Data 清成 nullptr,避免把 Host 地址当 Device 指针使用。 2. **表与 assemble tensor 生命周期解耦后的缺口** 引入独立标记 isDynamicCellMatchNeedAlloc 后,TryAllocate **只认 flag**;AllocateAssembleSlot 只负责 tensor,不再顺带分配 dyn-CM。 Fill / continue 在 Data()==nullptr 时置 flag,期望由后续 **outcast Resolve** 调用 TryAllocate 从 Device 池重占槽。 3. **Consumer 可能先于 outcast 分配到达** 单次 root 顺序为:AssignIncast → AssignOutcast(此处才 TryAllocate)→ **Stitch(先 Consumer 读表)** → UpdateSlots。 若 live root **只 incast 读**该 slot,本拍不会走对该 slot 的 outcast Resolve → flag 已置上但 **从未 TryAllocate** → PartialUpdateStitchConsumer 读到 Data()==nullptr → SEGV。 父提交能避开该洞,是因为 AllocateAssembleSlot(incast 常会先触达)内部仍会 TryAllocate;本设计把分配从 assemble 拆出后,调用点未覆盖「纯 consumer 先读」路径。 > 说明:仅在 consumer 对空指针 return 0 **不足以**替代分配——case174 上可消除 SEGV,但精度失败。后续 Prepare / UpdateSlots 填表依赖非空 Data 缓冲。 ## 修复方法 1. **独立 need-alloc 标记(与 assemble NeedAlloc 解耦)** - Fill / MarkPartialUpdateSlots:Data()==nullptr 且需 partial stitch → isDynamicCellMatchNeedAlloc = true - CF-cache continue(Restore + Reloc 之后):同样按 Data()==nullptr 置 flag - TryAllocateDynamicCellMatchForAssembleSlot:**只认 flag**;分配成功后清 flag 2. **分配调用点** - output / assemble **outcast Resolve**:flag 为真时 TryAllocate(既有) - **incast**(AssignIncastAddresses,rtOutcastIter 已有效之后):同样调用一次 flag 门闩的 TryAllocate - 覆盖「consumer 先于任何 outcast Resolve 读表」的洞 - 门闩仍是 flag:无 need-alloc 时为空操作 - 不把「表内容由 outcast producer 填写」的语义改成由 incast 生产;此处只保证 Device 侧表缓冲在 Stitch 前存在,便于后续 Prepare / 填表与安全读表 3. **刻意不做** - continue 后不对 CM.ptr 做 bulk clear(由 TryAllocate 覆盖写入) - UpdateSlots 保持 Prepare-only,不按 CM.ptr 重绑 See merge request: cann/pypto!7785 | 2 days ago | |
fix(dfx): Report cell shape -1 errors earlier in the pass pipeline. Co-authored-by: wangqun23<wangqun23@huawei.com> # message auto-generated for no-merge-commit merge: !7777 merge master into master fix(dfx): Report cell shape -1 errors earlier in the pass pipeline. Created-by: wangqun23 Commit-by: wangqun23 Merged-by: cann-robot Description: ## 背景 当执行用例后报错结果是如下错误时,虽然此报错在machine侧,但最终修改组件多为Pass,沟通成本高。 ASSERT FAILED: ErrCode: F7A007! Enum: DevCommonErr::PARAM_CHECK_FAILED Invalid cell shape for outcastList[0], dimension: 1, expected concrete value, got -1 故而选择将已识别的Pass错误使用postcheck的方式将报错提前到Pass,防止报错在machine。 Related Issue: [#3979](https://gitcode.com/cann/pypto/issues/3979) See merge request: cann/pypto!7777 | 1 day 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 | 29 days 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 | 2 months ago |
| Files | Last commit | Last update |
|---|---|---|
| 3 days ago | ||
| 1 month ago | ||
| 3 days ago | ||
| 29 days ago | ||
| 23 hours ago | ||
| 2 days ago | ||
| 1 day ago | ||
| 1 month ago | ||
| 29 days ago | ||
| 2 months ago |