Skip to content

fix(vpto): lower MTE store atomics through CTRL - #569

Open
peanutchan wants to merge 2 commits into
mouliangyu:feature-vmifrom
peanutchan:peanutchan/store-atomic-cfg
Open

fix(vpto): lower MTE store atomics through CTRL#569
peanutchan wants to merge 2 commits into
mouliangyu:feature-vmifrom
peanutchan:peanutchan/store-atomic-cfg

Conversation

@peanutchan

@peanutchan peanutchan commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • expose CCE-style pto.set_atomic_{dtype,op,none} ops in the explicit PTODSL surface
  • expand those ops through ordered get_ctrl/set_ctrl updates that match the existing L0C→GM FIXP atomic encoding (CTRL[8:6] dtype, CTRL[10:9] op)
  • make get_ctrl non-pure so CSE cannot reuse a stale CTRL across intervening set_ctrl
  • keep pto.set_store_atomic_cfg for the scalar ST_ATOMIC_CFG path; MTE UB→GM atomics do not use it
  • add lit coverage for atomic CTRL expansion and extend the PTODSL compile probe

Why

TileLang PR #75 now emits pto.set_atomic_* around UB→GM copies. Direct llvm.hivm.SET.ATOMIC.* is not selectable by bisheng; CCE set_atomic_* lowers to CTRL bit updates, which is also how L0C→GM FIXP atomics already work in PTOAS.

Verified on camodel opsim for int32/float32 add/max/min/none.

Test plan

  • python ptodsl/tests/test_jit_compile.py
  • ptoas --pto-arch=a5 --pto-backend=vpto --emit-vpto --mlir-print-ir-after=vpto-expand-wrapper-ops test/lit/vpto/store_atomic_ctrl_expand.pto
  • rebuilt ptoas_runtime_staging and Python bindings
  • TileLang store-atomic compile + camodel opsim for int32/float32 add/max/min/none

peanutchan and others added 2 commits July 25, 2026 10:51
Add the minimal PTODSL and VPTO lowering needed for TileLang UB-to-GM atomic add, max, and min copies.

Co-authored-by: Cursor <cursoragent@cursor.com>
Expose CCE-style atomic configuration operations and preserve ordered CTRL reads so dtype and operation state reaches asynchronous MTE stores.

Co-authored-by: Cursor <cursoragent@cursor.com>
@peanutchan peanutchan changed the title feat(ptodsl): expose store atomic configuration fix(vpto): lower MTE store atomics through CTRL Jul 25, 2026
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