Skip to content

[Subview] unify lowering on parent-shape + valid dims (PR344 follow-up)#351

Closed
TaoTao-real wants to merge 2 commits intohw-native-sys:mainfrom
TaoTao-real:codex/pr344-subview-unify-parent-valid
Closed

[Subview] unify lowering on parent-shape + valid dims (PR344 follow-up)#351
TaoTao-real wants to merge 2 commits intohw-native-sys:mainfrom
TaoTao-real:codex/pr344-subview-unify-parent-valid

Conversation

@TaoTao-real
Copy link
Copy Markdown
Contributor

Summary

This PR is a follow-up on top of #344 and keeps the implementation on the same line.
It unifies subview lowering semantics and removes compact/non-compact bifurcation.

What changed

  • Remove compact/non-compact subview split and related attrs.
  • Keep subview result tile shape as parent shape.
  • Represent subview logical size via valid_row/valid_col (default from sizes, explicit valid clamped by size).
  • Mark subview-origin bind with pto.view_semantics = "subview".
  • In EmitC, handle subview-origin tile lowering separately from generic alloc-origin tile rebinding.

Files

  • lib/PTO/Transforms/PTOViewToMemref.cpp
  • lib/PTO/Transforms/PTOToEmitC.cpp
  • lib/PTO/IR/PTO.cpp
  • include/PTO/IR/PTOOps.td
  • docs/PTO_IR_manual.md

Why

This aligns the implementation to the requested model:

  • no compact/non-compact branch in analysis/lowering,
  • preserve parent tile shape in type,
  • use valid dims to describe sub-tile extent,
  • keep codegen distinction by subview semantics instead of memory compactness tags.

Validation

Local

  • runop.sh -t SubView: pass (with expected XFAIL)
  • runop.sh -t Sync: pass (with expected SKIP/XFAIL)

Board (Ascend910, device 2, CI-like params)

  • Command family: test/npu_validation/scripts/run_remote_npu_validation.sh
  • Params: STAGE=run RUN_MODE=npu SOC_VERSION=Ascend910 DEVICE_ID=2
  • PTO_ISA_COMMIT=893e4b00a826231e776539512b5b17f82fc11838
  • SKIP_CASES=mix_kernel,vadd_validshape,vadd_validshape_dynamic,print,storefp,partition5d_a5,partition5d_dynamic_a5,mrgsort_a5,tmatmulk_autosync_a5
  • Result: OK=166 FAIL=0 SKIP=9

@TaoTao-real
Copy link
Copy Markdown
Contributor Author

Superseded by updating PR #344 directly. Closing this duplicate follow-up PR.

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.

1 participant