PTODSL New Kernel Surface Design #401
Zhendong404
started this conversation in
General
Replies: 1 comment
Why need to specify
Only two modes # inserts set/wait barrier, no need for user to write
@jit(compile_pass={"auto_sync": True})
def my_kernel():
# if only few options, then flatten the args
@jit(auto_sync=True)
def my_kernel():If some APIs are not allowed in auto-sync mode (for example is
This is good, we should reduce redundant decorators, unless they are absolutely necessary. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem
The current kernel story exposes too many layers:
Tile Ops, the hardware unit, plus an orchestration layer.
with occasional custom compute, not low-level DMA and sync.
custom SIMD code while still expecting the compiler to manage staging and
sync.
@pto.ukernelsuggests explicit MTE/sync is the default authoring model.
Design Summary
One entry point (
@pto.jit), two modes. The distinction is what the compilersees:
basic: the compiler sees tile-level atomic semantics —tile.load,tile.store, and compute-unit calls as indivisible units. This enablesscheduling, fusion, and memory planning optimizations.
advance: the user writes explicit DMA and sync. The compiler treats theseas opaque user-ordered operations and does not optimize across them.
No separate public
@pto.ukernel.Basic Mode
Default mode. The compiler sees tile-level atomic semantics:
tile.load,tile.store, and compute-unit calls are indivisible units. This contractenables the compiler to perform scheduling, fusion, and memory planning
optimizations.
Allowed: Tile Ops, named
@pto.simd/@pto.simt/@pto.cubesub-kernels,inline
with pto.simd():scopes, scalar ops.Not allowed: MTE Ops, explicit DMA scheduling.
Parameter contract: compute-unit sub-kernel boundaries prefer
Tile + scalar.Example
Advance Mode
Expert mode. User writes explicit DMA, barriers, and pipe ordering for maximum
flexibility. The compiler treats these as opaque user-ordered operations and
does not optimize across them.
Allowed: everything in
basicplus MTE Ops, explicit sync, mixedTile+MTE scheduling.
Synchronization contract: user owns correctness in regions with explicit
MTE/sync. Rule: presence of user-authored MTE or sync = user-managed
orchestration. The compiler doesn't silently "fix" expert scheduling.
Parameter contract: broader PTODSL-traceable values allowed beyond
Tile + scalar, but still constrained to values the tracer can reason about.Example
Boundary Summary
basicadvance@pto.jit@pto.jitTile + scalarBoth modes support named
@pto.simd/@pto.simt/@pto.cubesub-kernels andinline
with pto.simd():scopes equally. The distinction is tile-atomicsemantics vs. raw flexibility, not reuse vs. inline.
All reactions