Skip to content

[Ascend] Port T.Parallel ST suite (SV/CF/SP) onto pto-dev - #2

Open
peanutchan wants to merge 10 commits into
PTO-ISA:pto-devfrom
peanutchan:feat/st-simtvf-parallel-sv1-sv9
Open

peanutchan wants to merge 10 commits into
PTO-ISA:pto-devfrom
peanutchan:feat/st-simtvf-parallel-sv1-sv9

Conversation

@peanutchan

@peanutchan peanutchan commented Oct 8, 2026 •

Copy link
Copy Markdown

Summary

Ascend SimtVF sensitivity suite at examples/ascend/t_parallel_st_suite on PTO-ISA/tilelang pto-dev.

  • Source tip: Wenbo ST 3828bbcf
  • Base: PTO-ISA pto-dev @ 3d70ede9
  • Method: examples-only tree-copy (not a full rebase)
  • Coverage: 42/42 — SV1–9 / CF1–6 / SP1–6 × Simt + SIMD (PTO-DSL)

Reviewer links

Artifact Link
Deck (pptx) docs/st-deck-v2.pptx · raw download
VF + sensitivity SUMMARY.md
How to run + case list README.md

Primary metric in SUMMARY/deck: total VF cycles (Simt T.Parallel vs best SIMD (PTO-DSL) schedule).


Live VF-mode regress (cann_92b2 + PTOAS nightly 0.67, 2026-10-10)

Four-way ST_VF_MODE switch is on this tip (simt-asc / simt-pto / simd-asc / simd-pto). Live arms:

Knob Value
CANN /mnt/fluxdata/Ascend/cann_92b2/cann-9.2.0-beta.2 (Ascend-cann-toolkit 9.2.0-beta.2)
TileLang tip (PR head) 314834389d0e0472629702827ddf4d0b1aa5f740 on feat/st-simtvf-parallel-sv1-sv9 (base pto-dev @ 3d70ede9)
PTOAS (simt-pto / simd-pto) PTOAS nightly ptoas 0.67 in .camodel_deps_nightly067 — not CANN-bundled PTOAS; not the older camodel ptoas-vmi 0.1.8 (that stack was 0/61 on simt-pto via missing pto.max)
SOC Ascend950PR_9599
ST_VF_MODE Result OUT / notes
simt-asc 56/61 PASS OUT /mnt/fluxdata/happybot/st_out_cann92b2_20261010_104824. MicroAPI wall cleared vs cann_91b3. Residuals: sv4 remat_idx (eval_vec_), sv6/sv7 harness alias rows. VF vs Wenbo: /mnt/fluxdata/happybot/WENBO_VS_CANN92B2_SIMT_ASC_VF_20261010.md
simt-pto 33/61 PASS (nightly 0.67) OUT /mnt/fluxdata/happybot/st_out_nightly067_simt_pto_20261010_170837 · table VF_MODE_PASS_TABLE.txt. Was 0/61 on ptoas-vmi 0.1.8 (pto.max). Remaining FAIL compile: f16→f32 EmitInlineSimtVF (~11), sv4 keep_idx llvm.store (~8), SV9 store arity (~3), eval_vec_ / SP5 / SP3 e8m0. VF vs Wenbo + simt-asc: /mnt/fluxdata/happybot/NIGHTLY067_SIMT_PTO_VS_BASELINES_20261010.md
simd-pto 0/61 PASS OUT /mnt/fluxdata/happybot/st_out_simd_pto_20261010_163238 (and SV1 recheck under nightly067). All FAIL compile. Dominant: Unsupported storage scope in PTO pointer emission: local from ST T.alloc_fragment → RF/local under SimdVF→PTO (codegen_pto.cc). Decision: keep fragment RF as-is (do not rewrite kernels to shared-only); simd-pto needs a TileLang codegen fix for local / SimdVF→PTO. Nightly 0.67 does not unblock SV1 here.
simd-asc TBD Auto-lower regress still pending on same stack

kernels_ptodsl/ (hand-written SIMD PTO-DSL) unchanged — SUMMARY SIMD VF numbers still come from that path.


Test case PASS / FAIL (opsim Ascend950PR_9599)

Status key: PASS = compile + camodel gold OK on recorded tip.
Simt / most SIMD VF: Wenbo tip 3828bbcf (2026-10-07–08). Historical note: Simt oneshots on cann_91b3/92b1 hit missing CANN MicroAPI; cleared on cann_92b2 for simt-asc (see Live VF-mode section above).
Exception (live on this tip): SP4d / SP5d SIMD PASS @ fa8ffeeb (2026-10-08).

SV1–SV9

Case Simt SIMD (PTO-DSL) Notes (★ = best Simt arm / SIMD VF)
SV1 PASS PASS E256 VF 727 → 59
SV2 PASS* PASS *R16×C64 Simt COMPILE_FAIL → C32 ABI fallback PASS; ★ R32×C64 stream 4941 → 172
SV3 PASS PASS ★ split_cm16 10384 → 6469
SV4 PASS PASS ★ remat_idx 1156 → keep_idx 120
SV5 PASS PASS ★ ub_stream 5506 → 16846
SV6 PASS PASS ★ reload 20748 → 16522
SV7 PASS PASS ★ multiwarp_ub G64 11182 → reload 16592
SV8 PASS PASS ★ live 28402 → 31843
SV9 PASS PASS ★ keep 1122 → remat_scores 271

CF1–CF6

Case Simt SIMD (PTO-DSL) Notes
CF1 PASS PASS K8 keep 309 → 105 (K1 Simt-only)
CF2 PASS PASS remat 2041 → 113
CF3 PASS PASS remat_idx 851 → 105
CF4 PASS PASS nested_if ~780 → 70
CF5 PASS PASS div_ulp ~656 → 74
CF6 PASS PASS newton 961 → 129

SP1–SP6

Case Simt SIMD (PTO-DSL) Notes
SP1 PASS PASS ★ remat_pos 17290 → keep_pos/vscatter 31424
SP2 PASS PASS ★ sf0_w0+keep_acc 13738 → 837
SP3 PASS PASS e8m0 11171 → 311
SP4 PASS PASS pad25 13968 → mask 265 (live *d)
SP5 PASS PASS ★ sideband 52001 → 583 (live *d); interleave → 699
SP6 PASS PASS ★ unpack+vselr 7813 → 393

Rollup

Layer Cases Recorded opsim
Simt SV/CF/SP 21 21 PASS (SV2 matched C64 keep COMPILE_FAIL; C32 fallback PASS)
SIMD (PTO-DSL) 21 21 PASS (SP4d/SP5d live on this tip; rest Wenbo-tip baseline)
Product 42 42/42 kernels present

Adaptations (examples only)

  1. import tilelang.language as T → import tilelang.ascend.language as T
  2. common_asc_harness.patch_simtvf_ffi uses stock Ascend 3-arg SimtVF (no missing tilelang.language.vf)
  3. Oneshots accept TILELANG_DEPS override for in-tree libtilelang.so

No broad src/ / compiler patches. ST kernels keep T.alloc_fragment (RF/local) — shared-only rewrite is out of scope; simd-pto unblock is codegen.

Test plan

  • Re-run Simt oneshots on cann_92b2 (MicroAPI DMA symbols present) — simt-asc 56/61 PASS; refresh SUMMARY still optional
  • Live simt-pto on PTOAS nightly 0.67 — 33/61 PASS (was 0/61 on 0.1.8)
  • SIMD SP4d/SP5d opsim on Ascend950PR_9599 (live)
  • Optional: full oneshot_ptodsl_sp1d_sp6d.sh refresh on this tip
  • Board .39 gold=got when reachable
  • Live simd-pto VF-mode regress — 0/61 PASS (local storage scope / SimdVF→PTO; keep alloc_fragment)
  • Live simd-asc VF-mode regress on cann_92b2

peanutchan and others added 3 commits October 8, 2026 17:45
Tree-copy examples/ascend/st_simtvf_parallel from Wenbo tip 3828bbcf onto
PTO-ISA pto-dev (3d70ede). Adapt imports to tilelang.ascend.language and
harness SimtVF FFI; document CANN MicroAPI opsim blocker on pto-b10.
Co-authored-by: peanutchan <peanutchan@users.noreply.github.com>
@peanutchan peanutchan changed the title [Ascend] Port SimtVF ST suite (SV/CF/SP) onto pto-dev [Ascend] Port T.Parallel ST suite (SV/CF/SP) onto pto-dev Oct 8, 2026
cursoragent and others added 3 commits October 8, 2026 10:28
SP4d walks every expert row and zeros pad holes with a full-lane vsel.
SP5d sideband gathers V and Sf; interleave gathers one Pack slot then
splits the scale tail. Oneshot, README, and SUMMARY now list 21+21.
VF numbers for the new twins stay TODO.

Co-authored-by: peanutchan <peanutchan@users.noreply.github.com>
SP4d pad25 VF=265 (1.98us); SP5d sideband VF=583 (1.87us),
interleave VF=699 (1.94us). All PASS maxabs=0 on tip fa8ffee.
@KurrinQu KurrinQu mentioned this pull request Oct 8, 2026
2 tasks
out_ub = T.alloc_shared((E,), "float32")
T.copy(A, s)
T.copy(Thresh, thr_ub)
with T.SimtVF(threads=threads):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

目前kernels是SimtVF形态,我们最终验证的路径是SimdVF→PTO,入库前是否需要调整成SimdVF?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

同意最终验证路径是 SimdVF→PTO,但入库前不打算把整套 T.Parallel ST 直接改成只留 SimdVF。

计划是:同一套 T.Parallel case 通过环境变量切换 T.SimtVF / T.SimdVF(例如 ST_VF_MODE=simt|simd),再跑 regress 汇总各 case PASS/FAIL(哪些 SimdVF 已通、哪些还挂)。现有 kernels_ptodsl/*d(手写 PTO-DSL)仍保留,作为 sensitivity 对照,不是替代这条开关路径。

正在往本 PR 分支落地。


```bash
# Env (typical pto-b10 paths)
export ASCEND_HOME_PATH=/mnt/fluxdata/Ascend/cann_91b3/cann-9.1.0-beta.3

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

环境变量,目前固定是本地路径,入库前是否参数化更好一些

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

已参数化:oneshot / harness 通过 PY、ASCEND_HOME_PATH、TILELANG_DEPS 等环境变量取值,未设置则直接报错退出(见 tip 1006caa)。

README 里仍有一段 pto-b10 示例绝对路径;按你的意见会再清掉,只保留占位符说明,不再写死 /mnt/fluxdata/Ascend/...。

peanutchan and others added 4 commits October 9, 2026 12:45
Oneshots and harnesses take PY, ASCEND_HOME_PATH, and the existing
dependency prefixes from the environment so a reviewer can run the
suite without editing pto-b10 lab paths.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: peanutchan <peanutchan@users.noreply.github.com>
Keep one T.Parallel source for the Ascend ST kernels and choose the
VF frame from ST_VF_MODE. Add a simt/simd PASS/FAIL regress and drop
checked-in lab absolute paths from the suite README.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: peanutchan <peanutchan@users.noreply.github.com>
ST_VF_MODE now chooses SimtVF or SimdVF and compile target ascend or pto.
simt and simd stay as aliases for the ascend modes. The VF-mode regress
runs all four by default and records PASS/FAIL, including a PTO compile
failure, without remapping that compile to ascend.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: peanutchan <peanutchan@users.noreply.github.com>
Document tested versions and live VF-mode rollup (simt-asc 56/61,
simt-pto 33/61, simd-pto 0/61; keep alloc_fragment). README + SUMMARY
only; no kernel changes.
jimmychou0 added a commit to jimmychou0/tilelang that referenced this pull request Oct 12, 2026
Per review: the example came in only as an import dependency of
test_simdvf_vecadd_pto_run.py from the ported vectorize commit.
Element-wise device coverage stays with the self-contained
test_vectorize_parallel_pto_run.py (vecadd 1D/2D, tail masks, casts,
auto-schedule kept enabled); the element-wise example from PR PTO-ISA#2
(t_parallel_st_suite sv1) becomes the canonical showcase once that
suite lands.
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