Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions docs/designs/mix-kernel-mix-backend-compile-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ For example:
```python
@pto.jit(target="a5", entry=False, backend="vpto", mode="explicit")
def scale_row(base_gm: pto.ptr(pto.f32, "gm"), row: pto.i32):
with pto.simd():
with pto.tileop():
...

@pto.jit(target="a5", backend="emitc")
Expand Down Expand Up @@ -168,10 +168,9 @@ kernel. The Vector/Cube execution ownership is a PTOAS responsibility:
the VPTO backend.

This keeps the PTODSL programming model independent of the physical sectioning
rules. PTODSL can still expose helper abstractions such as `@pto.simd`,
`@pto.cube`, `with pto.simd():`, and `with pto.cube():`, but the design does
not require users or the frontend to manually partition every operation into a
final section.
rules. PTODSL exposes logical helper abstractions such as `@pto.tileop` and
`with pto.tileop():`, but the design does not require users or the frontend to
manually partition every operation into a final section.

### PTODSL IR Codegen Shape

Expand Down Expand Up @@ -233,11 +232,10 @@ Python-only structure. This lowering records PTODSL helper structure and call
boundaries; it does not make PTODSL responsible for the final Vector/Cube
section partition.

For `@pto.simd` / `@pto.cube` and inline `with pto.simd():` / `with pto.cube():`
scopes, PTODSL:
For `@pto.tileop` and inline `with pto.tileop():` scopes, PTODSL:

- outlines the subkernel body into a helper `func.func` when needed
- marks the helper with `pto.ptodsl.subkernel_helper`
- marks the helper with canonical `pto.tileop.helper`
- emits a helper call from the caller body

This is the PTODSL-side expression of a logical mixed kernel: the entry or
Expand Down Expand Up @@ -526,4 +524,5 @@ Use this order when debugging mixed compilation:
| `pto.aicore` | `func.func` | Legacy entry marker accepted for compatibility. |
| `pto.internal.non_entry` | `func.func` | Frontend/helper metadata; not used for current entry inference. |
| `pto.ptodsl.logical_name` | `func.func` | Source-level logical name used when assembling wrappers and peer references. |
| `pto.ptodsl.subkernel_helper` | `func.func` | Frontend helper classification: `simd`, `cube`, or `simt`. |
| `pto.tileop.helper` | `func.func` | Canonical tileop-style helper marker emitted for `@pto.tileop` helpers. |
| `pto.ptodsl.subkernel_helper` | `func.func` | Legacy helper role marker retained for compatibility with older/manual IR. |
4 changes: 2 additions & 2 deletions docs/designs/ptodsl-ast-preprocess-control-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ static specialization readable.
## Goals

- Make native Python control-flow syntax usable by default for runtime control
flow in `@pto.jit(...)` kernels and named `@pto.cube` / `@pto.simd` /
`@pto.simt` sub-kernels.
flow in `@pto.jit(...)` kernels and named `@pto.tileop` / `@pto.simt`
sub-kernels.
- Use `ast_rewrite` as the public name for the source rewrite feature.
- Rewrite legal Python `if` / `for range(...)` into existing PTODSL
control-flow surfaces.
Expand Down
346 changes: 346 additions & 0 deletions docs/designs/ptodsl-redesign-of-simd-simt-cube-subkernel.md

Large diffs are not rendered by default.

Loading