feat(vpto): add sdma_gm_gm async DMA - #1490
Open
kerwinair wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 byinclude/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 A5soft_putpath 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.structplusld_dev/st_devsequences, then substitutes it into downstream users; LLVM emitter patterns forld_dev/st_devand byte-granular UB->GM config are ported onto the shared emitter helpers.PTODSL exposes
pto.dma_session_type(engine),pto.session_initandpto.sdma_gm_gm;@pto.jitcan 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_putchunk tail, endpoint offset, multicore) and an engine-path spike undertest/comm/. All verified on A5.