Skip to content

feat(ptodsl): redesign tileop simt/simd/cube subkernel surface#867

Draft
jimmychou0 wants to merge 3 commits into
hw-native-sys:mainfrom
jimmychou0:ptodsl-tileop-simt-redesign
Draft

feat(ptodsl): redesign tileop simt/simd/cube subkernel surface#867
jimmychou0 wants to merge 3 commits into
hw-native-sys:mainfrom
jimmychou0:ptodsl-tileop-simt-redesign

Conversation

@jimmychou0

@jimmychou0 jimmychou0 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • redesign the PTODSL tileop / simd / cube subkernel surface so decorated helpers stay naked tileop helpers while inline scopes preserve explicit vector/cube sections
  • add backend support for tileop helper summary inference, contract verification, section materialization, memory planning, and sync/normalization integration
  • support scalar-return tileop helpers, refresh PTODSL docs/tests, align low-precision lit expectations, and fix PTODSL regression target dependencies

Validation

  • ninja -C build-local-vpto check-pto
  • python -m unittest discover -s ptodsl/tests -p 'test_*.py' under the PTOAS build environment
  • ninja -C build-local-vpto check-dsl

Refs #859

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@jimmychou0 jimmychou0 force-pushed the ptodsl-tileop-simt-redesign branch from cef0751 to fab48f5 Compare June 26, 2026 07:49
@jimmychou0 jimmychou0 changed the title feat(ptodsl): add tileop subkernel surface feat(ptodsl): redesign tileop simt/simd/cube subkernel surface Jun 26, 2026
@jimmychou0 jimmychou0 force-pushed the ptodsl-tileop-simt-redesign branch 7 times, most recently from db7b13d to 7c39285 Compare June 27, 2026 08:08
}

def PTOMaterializeTileOpSections
: Pass<"pto-materialize-tileop-sections", "func::FuncOp"> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NormalizeUncoveredTileSections pass和这个pass是相同功能,建议直接在NormalizeUncoveredTileSections中加逻辑处理

- **helper 内禁止 `alloc_tile`/`reserve_buffer`/`TAlloc`/任何需 PlanMemory 为 callee-local 规划的 op;内部 tile buffer 必须来自 caller operand。内部 vreg/mask/scalar 临时可存但不跨边界。**
- body 允许 tload/tstore、vector ops、scalar(PIPE_S) ops、cube ops、`pipe_barrier` 同步。
- 不允许 host tensor/TensorSpec/vreg/mask/pipe_handle 跨边界;不允许 SIMT-only op。
- **tileop 不能在另一 tileop/section 内调用**(避免 inline 后嵌套 section,`VPTOSplitCVModule:113-118` 禁嵌套 section)。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里感觉可以在inline时做特殊处理,或者让VPTOSplitCVModule适配下,按理说同类section嵌套也是合理的

@reedhecre

reedhecre commented Jun 29, 2026

Copy link
Copy Markdown

Codex Review

该评论由 review 机器人自动更新。

  • PR: feat(ptodsl): redesign tileop simt/simd/cube subkernel surface #867 feat(ptodsl): redesign tileop simt/simd/cube subkernel surface
  • Author: jimmychou0
  • Base/Head: main / ptodsl-tileop-simt-redesign
  • Head SHA: d935dae8851c
  • Trigger: PR 有新提交
  • Generated At: 2026-07-10T04:40:51Z
  • Previous Head SHA: acc832876bfc
  • Status: failed at codex-review (exit=1)

Summary

Review failed at stage codex-review: exit=1

Findings

未生成结构化 findings,因为 review 过程提前失败。

Log Tail

 .../pto/tload_tprefetch_low_precision_a5_valid.pto |   8 +-
 test/lit/pto/tstore_low_precision_a5_valid.pto     |   6 +-
 .../vpto/section_sugar_single_kind_vpto_llvm.pto   |  31 +
 .../tileop_helper_normalize_uncovered_skip.pto     |  60 ++
 test/lit/vpto/tileop_materialize_sections.pto      |  57 ++
 .../tileop_materialize_sections_control_flow.pto   |  48 ++
 ...eop_materialize_sections_control_flow_mixed.pto |  62 ++
 test/lit/vpto/tileop_materialize_sections_cube.pto |  64 ++
 test/lit/vpto/tileop_summary_attrs.pto             |  55 ++
 test/lit/vpto/tileop_summary_attrs_subview.pto     |  43 +
 .../tileop_verify_contract_alloc_tile_invalid.pto  |  42 +
 ...eop_verify_contract_memref_boundary_invalid.pto |  27 +
 .../tileop_verify_contract_nested_call_invalid.pto |  60 ++
 .../tileop_verify_contract_no_primary_invalid.pto  |  41 +
 ...tileop_verify_contract_ptr_boundary_invalid.pto |  27 +
 .../vpto/tileop_verify_contract_result_invalid.pto |  29 +
 .../tileop_verify_contract_simt_only_invalid.pto   |  38 +
 test/samples/TPushTPop/ptodsl/local_c2v/kernel.py  |   4 +-
 test/tilelib-st/a5/tmatmul/case.py                 |   4 +-
 tools/ptoas/ptoas.cpp                              |   5 +
 79 files changed, 4508 insertions(+), 453 deletions(-)
===== END STAGE clone rc=0 @ 2026-07-10 12:40:42 =====

===== STAGE codex-review @ 2026-07-10 12:40:42 =====
set -euo pipefail
cd '/tmp/ptoas-pr-review-monitor/runs/20260710_124034_pr867/repo'
'codex' exec -C '/tmp/ptoas-pr-review-monitor/runs/20260710_124034_pr867/repo' -s read-only -c 'model_provider="codereview"' -c 'model="gpt-5.4"' -c 'model_reasoning_effort="xhigh"' --output-schema '/tmp/ptoas-pr-review-monitor/runs/20260710_124034_pr867/review_schema.json' -o '/tmp/ptoas-pr-review-monitor/runs/20260710_124034_pr867/codex_last_message.json' --color never - < '/tmp/ptoas-pr-review-monitor/runs/20260710_124034_pr867/review_prompt.txt'
[monitor] stage timeout: 1800s
OpenAI Codex v0.115.0 (research preview)
--------
workdir: /tmp/ptoas-pr-review-monitor/runs/20260710_124034_pr867/repo
model: gpt-5.4
provider: codereview
approval: never
sandbox: read-only
reasoning effort: xhigh
reasoning summaries: none
session id: 019f4a53-f1d6-7251-811f-ffd8b1b8ca7b
--------
user
你现在在审查 GitHub PR。

仓库:hw-native-sys/PTOAS
PR:#867 feat(ptodsl): redesign tileop simt/simd/cube subkernel surface
作者:jimmychou0
base branch:origin/main
head branch:HEAD(当前已 checkout 到 PR head)

要求:
1. 只审查这个 PR 相对 origin/main 的改动,必要时可以看上下文文件。
2. 重点找真实的 correctness / regression / contract mismatch / CI / runtime / compatibility 问题。
3. 不要提纯风格建议,不要提低价值猜测。
4. 严格按优先级输出:
   - P1:高概率会导致错误结果、编译/运行失败、严重回归、发布阻断
   - P2:重要缺陷、行为回归、遗漏校验/测试、较大兼容性问题
   - P3:次要但明确可改的问题
5. 如果没有问题,summary 直接写:未检查到 PR #867 存在问题,并返回 findings=[]。
6. 如果有问题,summary 简洁概括,findings 里每条都要给出:
   - severity
   - title
   - body(说明为什么是问题,尽量具体)
   - file(尽量给相对路径)
   - line(能确定就填整数,否则 null)

建议先查看:
- git status --short
- git diff --stat origin/main...HEAD
- git diff --unified=80 origin/main...HEAD

最终输出必须严格匹配 JSON schema。

mcp startup: no servers
Reconnecting... 1/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18ce4585e240bb7-LAS, request id: 6435243a-76bf-4e94-ae8e-ce7626cd6304)
Reconnecting... 2/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18ce45baf0c8e7d-LAX, request id: 6f108804-75d2-41e7-9dad-81246e77c4b9)
Reconnecting... 3/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18ce45faa915bf3-LAX, request id: 5fcd38c1-e95c-4c57-b453-6f620e305f1b)
Reconnecting... 4/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18ce46648c47e62-LAX, request id: 7afe4d57-6f35-4125-b2d2-9bb05afee174)
Reconnecting... 5/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18ce470fdd423de-LAX, request id: 9491922a-e408-4a34-aaac-d7fec7cc83e0)
ERROR: unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18ce487beed19db-LAX, request id: ef2cfe91-7128-4c1e-8073-6ec688046719
Warning: no last agent message; wrote empty content to /tmp/ptoas-pr-review-monitor/runs/20260710_124034_pr867/codex_last_message.json
===== END STAGE codex-review rc=1 @ 2026-07-10 12:40:51 =====

@jimmychou0 jimmychou0 force-pushed the ptodsl-tileop-simt-redesign branch from 876a11e to 37901ae Compare July 7, 2026 06:43
@jimmychou0 jimmychou0 force-pushed the ptodsl-tileop-simt-redesign branch from 37901ae to 10474e7 Compare July 8, 2026 02:55
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.

3 participants