Skip to content

fix(layout): correct row reduction layout inference for rowmin/rowmax/rowsum#212

Merged
zhangstevenunity merged 2 commits into
hw-native-sys:mainfrom
TaoTao-real:codex/row-layout-reduction-fix-clean
Mar 9, 2026
Merged

fix(layout): correct row reduction layout inference for rowmin/rowmax/rowsum#212
zhangstevenunity merged 2 commits into
hw-native-sys:mainfrom
TaoTao-real:codex/row-layout-reduction-fix-clean

Conversation

@TaoTao-real
Copy link
Copy Markdown
Contributor

Summary

  • fix row-reduction layout propagation in InferPTOLayout so rowmin/rowmax/rowsum keep layout-consistent tile/global tensor combinations
  • preserve key tload/tstore attribute information across the layout/view lowering path
  • tighten consumer-preference inference to only apply in safe ambiguous vector cases (avoid over-forcing layout)

Scope

This PR is intentionally scoped to row-layout inference/lowering behavior and does not include the AllocToPointerCast change already tracked separately.

Files

  • lib/PTO/Transforms/InferPTOLayout.cpp
  • lib/PTO/Transforms/PTOViewToMemref.cpp
  • lib/PTO/Transforms/PTOToEmitC.cpp
  • test/samples/runop.sh

Validation

Local generation

  • runop --enablebc -t Rowmin
  • runop --enablebc -t Rowmax
  • runop --enablebc -t Rowsum
  • all generated successfully

Remote board (A3, CI-like script)

  • RUN_ONLY_CASES=rowmin,rowmax,rowsum
  • result: OK=3 FAIL=0 SKIP=0
  • all three cases built + ran + compare passed

Artifacts (local):

  • /private/tmp/rowlayout_pr_clean_3cases_20260307_145409/remote_npu_validation_results.tsv
  • /private/tmp/rowlayout_pr_clean_3cases_20260307_145409/remote_run.log

Risk

  • behavior change is limited to layout inference/lowering decisions
  • no InsertSync/event-allocation logic change in this PR

@zhangstevenunity zhangstevenunity merged commit d2df509 into hw-native-sys:main Mar 9, 2026
9 checks passed
KurrinQu added a commit to KurrinQu/PTOAS that referenced this pull request Apr 27, 2026
… been passed. (hw-native-sys#212)

* trelu tlrelu trandom 算子ST测试已通过,tsel tsels tprelu算子ST测试暂未通过

* trelu tlrelu trandom 算子ST测试已通过

* 针对评论修改trelu和tlrelu算子

* trelu, tlrelu, tprelu, tsel, tsels算子编译与ST测试均已通过

* trelu, tlrelu, tprelu, tsel, tsels算子编译与ST测试均已通过

* 添加license

* 根据评论修改,删除prelu算子后续再提

* 针对tsels ci不通过修改

---------

Co-authored-by: KurrinQu <qukelin1991@163.com>
KurrinQu added a commit to KurrinQu/PTOAS that referenced this pull request Apr 28, 2026
… been passed. (hw-native-sys#212)

* trelu tlrelu trandom 算子ST测试已通过,tsel tsels tprelu算子ST测试暂未通过

* trelu tlrelu trandom 算子ST测试已通过

* 针对评论修改trelu和tlrelu算子

* trelu, tlrelu, tprelu, tsel, tsels算子编译与ST测试均已通过

* trelu, tlrelu, tprelu, tsel, tsels算子编译与ST测试均已通过

* 添加license

* 根据评论修改,删除prelu算子后续再提

* 针对tsels ci不通过修改

---------

Co-authored-by: KurrinQu <qukelin1991@163.com>
Zhendong404 pushed a commit to Zhendong404/PTOAS that referenced this pull request May 1, 2026
… been passed. (hw-native-sys#212)

* trelu tlrelu trandom 算子ST测试已通过,tsel tsels tprelu算子ST测试暂未通过

* trelu tlrelu trandom 算子ST测试已通过

* 针对评论修改trelu和tlrelu算子

* trelu, tlrelu, tprelu, tsel, tsels算子编译与ST测试均已通过

* trelu, tlrelu, tprelu, tsel, tsels算子编译与ST测试均已通过

* 添加license

* 根据评论修改,删除prelu算子后续再提

* 针对tsels ci不通过修改

---------

Co-authored-by: KurrinQu <qukelin1991@163.com>
FangRui0 pushed a commit to FangRui0/PTOAS that referenced this pull request May 14, 2026
… been passed. (hw-native-sys#212)

* trelu tlrelu trandom 算子ST测试已通过,tsel tsels tprelu算子ST测试暂未通过

* trelu tlrelu trandom 算子ST测试已通过

* 针对评论修改trelu和tlrelu算子

* trelu, tlrelu, tprelu, tsel, tsels算子编译与ST测试均已通过

* trelu, tlrelu, tprelu, tsel, tsels算子编译与ST测试均已通过

* 添加license

* 根据评论修改,删除prelu算子后续再提

* 针对tsels ci不通过修改

---------

Co-authored-by: KurrinQu <qukelin1991@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants