Skip to content

feat(vpto): add sdma_gm_gm async DMA - #1490

Open
kerwinair wants to merge 1 commit into
hw-native-sys:masterfrom
kerwinair:feat/vpto-sdma-gm-gm-expand
Open

feat(vpto): add sdma_gm_gm async DMA#1490
kerwinair wants to merge 1 commit into
hw-native-sys:masterfrom
kerwinair:feat/vpto-sdma-gm-gm-expand

Conversation

@kerwinair

Copy link
Copy Markdown

Introduce the async communication micro-instructions on the VPTO path:

  • !pto.dma_session<engine>: an opaque, engine-parameterised session type (sdma/urma/rdma) declared in ODS with CAPI and Python bindings.
  • pto.session_init %template_gm -> !pto.dma_session<sdma>: materialises the device-side session from a host-built template in GM. The physical layout is pinned by include/PTO/Support/AsyncSessionABI.h (10 fields, width table); per-endpoint offsets are plain pointer arithmetic on the caller side rather than a session field.
  • pto.sdma_gm_gm %dst, %src, %session {block_bytes, channel_idx, soft_put} -> !pto.ptr<i64, gm>: posts a GM->GM transfer and returns the channel record address, whose live head/tail words expose completion (*head == *tail). The A5 soft_put path writes synchronously and returns a null record. A2/A3 and A5 SQE layouts are both emitted.
  • vpto-expand-wrapper-ops: an ordered walk lowers the opaque session to a !pto.struct plus ld_dev/st_dev sequences, then substitutes it into downstream users; LLVM emitter patterns for ld_dev/st_dev and byte-granular UB->GM config are ported onto the shared emitter helpers.

PTODSL exposes pto.dma_session_type(engine), pto.session_init and pto.sdma_gm_gm; @pto.jit can link host C++ into the kernel library so the host-side session template builder (test/comm/AsyncWorkspaceShim.cpp) is usable from Python tests.

Docs: docs/isa/micro-isa/19-async-comm.md, PTODSL user guide sections 4/7.

Tests: lit coverage for roundtrip, expansion, and A2/A3/A5 SQE emission (split per CHECK-LABEL so function-pass dump order cannot flake); PTODSL unit tests and docs-as-test fragments; ST cases under test/vpto/cases/async-comm/ (soft_put chunk tail, endpoint offset, multicore) and an engine-path spike under test/comm/. All verified on A5.

Introduce the async communication micro-instructions on the VPTO path:

- `!pto.dma_session<engine>`: an opaque, engine-parameterised session type
  (`sdma`/`urma`/`rdma`) declared in ODS with CAPI and Python bindings.
- `pto.session_init %template_gm -> !pto.dma_session<sdma>`: materialises the
  device-side session from a host-built template in GM. The physical layout is
  pinned by `include/PTO/Support/AsyncSessionABI.h` (10 fields, width table);
  per-endpoint offsets are plain pointer arithmetic on the caller side rather
  than a session field.
- `pto.sdma_gm_gm %dst, %src, %session {block_bytes, channel_idx, soft_put}
  -> !pto.ptr<i64, gm>`: posts a GM->GM transfer and returns the channel
  record address, whose live head/tail words expose completion
  (`*head == *tail`). The A5 `soft_put` path writes synchronously and returns
  a null record. A2/A3 and A5 SQE layouts are both emitted.
- `vpto-expand-wrapper-ops`: an ordered walk lowers the opaque session to a
  `!pto.struct` plus `ld_dev`/`st_dev` sequences, then substitutes it into
  downstream users; LLVM emitter patterns for `ld_dev`/`st_dev` and
  byte-granular UB->GM config are ported onto the shared emitter helpers.

PTODSL exposes `pto.dma_session_type(engine)`, `pto.session_init` and
`pto.sdma_gm_gm`; `@pto.jit` can link host C++ into the kernel library so
the host-side session template builder (`test/comm/AsyncWorkspaceShim.cpp`)
is usable from Python tests.

Docs: `docs/isa/micro-isa/19-async-comm.md`, PTODSL user guide sections 4/7.

Tests: lit coverage for roundtrip, expansion, and A2/A3/A5 SQE emission
(split per CHECK-LABEL so function-pass dump order cannot flake); PTODSL
unit tests and docs-as-test fragments; ST cases under
`test/vpto/cases/async-comm/` (`soft_put` chunk tail, endpoint offset,
multicore) and an engine-path spike under `test/comm/`. All verified on A5.
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