| Files | Last commit | Last update |
|---|---|---|
feat(pad): Kirin9030/KirinX90 支持四边 padding 并补齐 lite UT(fill+concat,修复末维=1) Co-authored-by: zhuhongyu<zhuhongyu22@h-partners.com> # message auto-generated for no-merge-commit merge: !6700 merge pad_fill_assemble_pr into master feat(pad): Kirin9030/KirinX90 支持四边 padding 并补齐 lite UT(fill+concat,修复末维=1) Created-by: Zhu1418539395 Commit-by: zhuhongyu Merged-by: cann-robot Description: ## 背景 pad 的通用实现(Python API + 图算子 + tileop + codegen)早已存在,但: - lite(Kirin9030/KirinX90)平台此前只有“未验证”,没有用例; - 原实现只支持右/下 padding,不支持四边(左/上,torch 语义); - 输入末维 == 1 时 pad 结果错误(TD-1)。 本 PR 补齐 lite 上的 pad 验证与用例、让 lite 支持四边 padding,并修复末维 == 1 的问题。 ## 方案 ### 四边 padding( framework/src/interface/operation/vector/pad.cpp) TensorPadOperation 解析四边后按条件分流: - **右下快路径**(padLeft==0 && padTop==0):保持原 OP_PAD → TPad(TFILLPAD_EXPAND)不变,与 master 一致。 - **左/上(fill+concat)**:用 TensorFullOperation 造 pad 值零块,再用 Cat 沿对应维把“零块 + 输入 + 零块”拼成整块输出: - 最后维 W:Cat([zeros_left?, self, zeros_right?], ndim-1); - 倒数第二维 H:Cat([zeros_top?, cur, zeros_bottom?], ndim-2)。 之所以用 Cat 而非“Full 整块填 + 就地 Assemble 覆盖子区间”:后者让**同一张量同时被整块写(OP_VEC_DUP)和子区间写(OP_ASSEMBLE)两个重叠生产者写入**——单算子用例看不出问题,但多个 pad 结果再喂 add 的**融合核里会串写**(框架只对 outcast(函数输出)处理中间量的写冲突)。Cat 是“每块先 Assign 拷贝 + 写到不相交区段”,每个字节仅一个写者,安全。 - **平台隔离**:用 IsLiteNPU 门控,左/上只对 Kirin9030/KirinX90 放开,其他平台维持“仅右下”旧契约。 - **dtype 收窄**:LiteNPU 下限定 DT_FP16/DT_FP32(云侧白名单不变)。 ### TD-1 修复(framework/src/passes/tile_graph_pass/graph_constraint/axis_combine_marker.cpp) OP_PAD 退出合轴(DisableNoneWhiteListTensor)→ PadLocalBuffer 改为补最后一维到 32B;输入末维 == 1 时不再被折成 (1,N) 后按行列语义横写,重新走 OP_PAD 快路径。 ### Python 侧同步 python/pypto/op/other.py docstring、python/src/bindings/operation.cpp pybind 描述、docs/zh/.../pypto-pad.md 补充 LiteNPU 左/上支持说明。 ## 测试 - Python SIM UT:python/tests/ut/kirin/common_pad.py + kirin9030/x90 两个入口;golden 用 torch.nn.functional.pad,判据 cos ≥ 0.9999。 - C++ codegen UT:framework/tests/ut/codegen/src/test_static/test_litenpu/(共享 RunPad driver + 两个 soc 薄壳);test_codegen_common.h 增加 SetNPUArch/savedArch_ 保存与恢复,保证 fixture 目标架构与 socVersion_ 一致。 - 用例共 **48**(1D 4 / 2D 11 / 3D 11 / 4D 19 / ONNX 3),python 与 C++ 同编号一一对应;覆盖右下/左/上/四边、非对齐 offset、末维=1(TD-1 回归)、同块、pad≫输入、tile 逐维切分矩阵,以及真实 ONNX 形状(tiny_fp32_sim.onnx)。 - **本 PR 只放开四边用例 test_pad_044(4D,in (4,2,32,48),pad (5,16,7,8)),其余 47 个先 skip/disabled**:python 用 pytest.mark.skip,C++ 用两个薄壳里的 DISABLED_ 前缀。 ## 验证 - C++ codegen UT:Kirin9030 / KirinX90 通过(各 1 passed + 47 disabled,无 FAILED)。 - Python SIM UT:四边用例 044 通过。 - 静态检查(clang-format / ruff / 行宽 / EOF / codespell 等)通过。 ## 支持范围 - 位置:1D 支持左/右;2D+ 支持最后两维的四边(左/上/右/下)——左/上仅 LiteNPU(Kirin9030/KirinX90),其他平台维持右/下。 - dtype:LiteNPU 仅 fp16/fp32。 - 模式:constant,padding 值非负。 ## 影响面 - Pad 图算子在 LiteNPU 上放开左/上;OP_PAD 不再参与合轴(TD-1 修复)。 - 云侧 / A2 / A3 行为不变(仍拒绝左/上、dtype 白名单不变)。 See merge request: cann/pypto!6700 | 2 months ago | |
refactor(build): Reuse the common compilation options from common cmake. Co-authored-by: Feiteng Zheng<zhengfeiteng1@h-partners.com> # message auto-generated for no-merge-commit merge: !5292 merge 20260728-intf-pub-2 into master refactor(build): Reuse the common compilation options from common cmake. Created-by: zhengfeiteng Commit-by: Feiteng Zheng Merged-by: cann-robot Description: 切换使用 cann/cmake 仓规定的 intf_pub。 - 通过CANN_GLIBCXX_USE_CXX11_ABI属性设置tile_fwk_calculator的_GLIBCXX_USE_CXX11_ABI Related Issue: #2650 See merge request: cann/pypto!5292 | 3 months ago | |
feat(ir): Add block codegen and backend Co-authored-by: wuzhongxin<wuzhongxin1@huawei.com> # message auto-generated for no-merge-commit merge: !3864 merge master into master feat(ir): Add block codegen and backend Created-by: wuzhongxin Commit-by: wuzhongxin Merged-by: cann-robot Description: Add block codegen and backend See merge request: cann/pypto!3864 | 5 months ago | |
feat(distributed): Add Python interface for communication operators. Co-authored-by: mengziyu<mengziyu1@huawei.com> # message auto-generated for no-merge-commit merge: !742 merge master into master feat(distributed): Add Python interface for communication operators. Created-by: mengziyu Commit-by: mengziyu Merged-by: cann-robot Description: 1.通信算子新增python接口 2.提供matmul+allreduce+addrmsnorm融合算子样例 See merge request: cann/pypto!742 | 8 months ago |
| Files | Last commit | Last update |
|---|---|---|
| 2 months ago | ||
| 3 months ago | ||
| 5 months ago | ||
| 8 months ago |