| Files | Last commit | Last update |
|---|---|---|
fix(operation): Fix viewK+splitK bug in UB2L1 and gate GM accumulation by K validShape Co-authored-by: li_qingyan<liqingyan10@h-partners.com> # message auto-generated for no-merge-commit merge: !5515 merge feature/ub2L1viewK into master fix(operation): Fix viewK+splitK bug in UB2L1 and gate GM accumulation by K validShape Created-by: li_qingyan Commit-by: li_qingyan Merged-by: cann-robot Description: viewK(K轴valid shape为动态值或部分有效)叠加splitK(enable_split_k=True多核切K)时存在问题: 1. K 循环中每个分块 View 的 shape 始终取完整 kL1Size,仅 validShape 被 [0, kL1Size] 截断。当尾块剩余 K 不足一个完整 tile(或有效 K 已耗尽)时,产生 validK=0 ,如果此时叠加splitK,那么就会出现reduce轴为0的matmul计算,搬出时引入m*n大小的脏数据直接累加在gm上,导致精度错误。 ## 修改内容 1. framework/src/interface/tileop/cube/impl/arch35/copy_ub_to_l1_impl.h 删除UB2L1 多余的TFILLPAD操作。 2. framework/src/interface/operation/cube_operation_impl.cpp 新增IsGmAccumulationEnabled门控,6个入口的GM累加路径决策由enableSplitK直通改为经该函数判定: - 仅当A矩阵K轴valid shape为concrete且不小于静态kSize(K轴完整有效)时走GM累加; - 其余场景打INFO日志并回退普通matmul构图(不报错); - 对dynValidShape/静态shape维度不足2的场景做防护,避免K维索引越界。 3. docs/zh/api/tensor_api/config/pypto-set_cube_tile_shapes.md 多核切K约束补充使能条件:仅支持pypto.view()创建tensor的场景;仅支持b1/b2/m/n轴的loop和loop_unroll;非K轴循环场景下要求K轴valid shape等于K轴view shape。 ## 影响范围 - enable_split_k=True且K轴完整静态:行为不变,仍走GM累加; - enable_split_k=True但viewK(动态K/部分K):原先误入GM累加路径引发异常,现回退普通matmul构图,功能可用; - enable_split_k=False(默认):不受影响。 See merge request: cann/pypto!5515 | 2 months 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 | |
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(operation): Support INT8 output quantization in L0C2UB. Co-authored-by: y00957431<yangrui231@huawei.com> # message auto-generated for no-merge-commit merge: !5485 merge L0C2UB_int8 into master feat(operation): Support INT8 output quantization in L0C2UB. Created-by: yr12318 Commit-by: y00957431 Merged-by: cann-robot Description: feat(operation): Support INT8 output quantization in L0C2UB L0C2UB 原有量化路径仅支持 INT32 到 FP16 的 Fixpipe 转换,而普通 TStore 已经支持将合法的 L0C 累加类型量化输出为 INT8。本次修改参考 TStore 的实现, 补齐 L0C2UB 的 INT8 输出能力,并完善相关系统测试。 主要修改: - 支持所有合法 L0C 累加类型通过 L0C2UB 量化输出 INT8 - 为 TEXTRACT 和 TINSERT 的 PerTensor 场景设置 signed INT8 标志位 - PerChannel INT8 输出时,将 Fixpipe scale tensor 正确传递给 L0C2UB - 增加 INT8 和 FP16 输出的 PerTensor、PerChannel 系统测试 - 覆盖 TEXTRACT、TINSERT,以及 ND、NZ 输入格式 See merge request: cann/pypto!5485 | 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 | |
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(matmul): support GEMV (M=1) via TGEMV + ND data path Co-authored-by: zhuhongyu<zhuhongyu22@h-partners.com> # message auto-generated for no-merge-commit merge: !5563 merge pr/gemv into master feat(matmul): support GEMV (M=1) via TGEMV + ND data path Created-by: Zhu1418539395 Commit-by: zhuhongyu Merged-by: cann-robot Description: ## 功能描述<br> 支持 MatMul 的 GEMV(M=1,矩阵向量乘)场景:当 matmul 的 A 为单行(M=1,非 transA)时,算侧使用 pto::TGEMV(底层 mad 指令,M 硬编码 1),搬运侧 A 全程保持 ND 数据路径(不做 NZ 分形转换),并做 M 轴去 pad / K 对齐差异化,减少 L1/L0A buffer 占用。<br><br> ## 改动内容(按层)<br> **信号判定(op 创建处)**<br> - cube_operation_impl.cpp AddAMulBNode:非 transA 且 M==1 时设 OpAttributeKey::isGemv;transA(M=1)退化为普通 transA matmul。<br><br> **Tile graph pass(对齐/搬运)**<br> - generate_move_op.cpp ProcessUB2L1:GEMV A 来自 UB 时跳过 ND2NZ(A 保持 ND)。<br> - pad_local_buffer.cpp PadMatmul:GEMV 的 L1/L0A/UB2L1 输入按 K 对齐(L1/UB 32B、L0A 512B)、M 轴不打 pad;isUB2L1Scene 的 bank 冲突优化(+=1)对 GEMV 跳过。<br> - merge_view_assemble_utils.*:isGemv/copy_in_mode 白名单继承,跨 VIEW 重建存活。<br><br> **Codegen(指令分发)**<br> - codegen_op_npu.h / codegen_op_litenpu.*:新增虚函数 GetMatmulTileOpName()(LiteNPU 覆写读 isGemv)。<br> - codegen_mte.cpp:GEMV 的 UB→L1 生成 TCopyUB2L1ND2ND、L1→L0A 生成 TExtractL1ToL0ND2ND。<br> - codegen_cube.cpp:算侧读 isGemv 生成 TGEMV。<br><br> **TileLib(指令实现)**<br> - cube_pto.h:新增 TGEMV(#ifdef __LITE_NPU)、TCopyUB2L1ND2ND / TExtractL1ToL0ND2ND wrapper。<br> - mmad_impl.h:TMatmulImpl 加 isGemv 模板参数,GEMV 时 validM=1(M 不打 pad)并分派 pto::TGEMV 系列。<br> - copy_ub_to_l1_impl.h / copy_l1_to_l0_impl.h:GEMV 时 tile 声明 BLayout::RowMajor(+ SLayout::NoneBox),命中 pto-isa TExtractVecToMat/TExtractToAVector 的 ND 搬运分支。<br><br> **平台隔离**<br> - 框架 pass/codegen 层:仅源头 1 处运行时平台判断(LiteNPU)+ codegen 虚函数分派,非 LiteNPU 平台行为不变。<br> - tileop wrapper 层:TGEMV/ND2ND wrapper 用 __LITE_NPU 宏(kernel 编译域可见)。<br><br> ## 测试<br> - python/tests/ut/kirin/common_matmul.py:新增 GEMV 用例 41 个(id 015-055,s8s8 015-027 / FP16 028-055),覆盖 2D/3D/4D batch、bias、a/b_trans、深 K/N、非对齐 K/N、sub-fractal K-tile(tileKAL1>tileKL0)。<br> - common_attention.py / test_kirin9030_attention.py:修复 4input 测试 out shape;attention 复合场景(matmul A 来自 UB,M=1)回归验证。<br><br> ## 验证<br> - GEMV 全量用例(015-055)+ attention 4input 回归通过(kirin9030)。****<br> See merge request: cann/pypto!5563 | 3 months ago | |
feat(operation): Support INT8 output quantization in L0C2UB. Co-authored-by: y00957431<yangrui231@huawei.com> # message auto-generated for no-merge-commit merge: !5485 merge L0C2UB_int8 into master feat(operation): Support INT8 output quantization in L0C2UB. Created-by: yr12318 Commit-by: y00957431 Merged-by: cann-robot Description: feat(operation): Support INT8 output quantization in L0C2UB L0C2UB 原有量化路径仅支持 INT32 到 FP16 的 Fixpipe 转换,而普通 TStore 已经支持将合法的 L0C 累加类型量化输出为 INT8。本次修改参考 TStore 的实现, 补齐 L0C2UB 的 INT8 输出能力,并完善相关系统测试。 主要修改: - 支持所有合法 L0C 累加类型通过 L0C2UB 量化输出 INT8 - 为 TEXTRACT 和 TINSERT 的 PerTensor 场景设置 signed INT8 标志位 - PerChannel INT8 输出时,将 Fixpipe scale tensor 正确传递给 L0C2UB - 增加 INT8 和 FP16 输出的 PerTensor、PerChannel 系统测试 - 覆盖 TEXTRACT、TINSERT,以及 ND、NZ 输入格式 See merge request: cann/pypto!5485 | 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(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 |
| Files | Last commit | Last update |
|---|---|---|
| 2 months ago | ||
| 1 month ago | ||
| 4 months ago | ||
| 2 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 3 months ago | ||
| 2 months ago | ||
| 4 months ago | ||
| 1 month ago |