[ttl] Pipe verification; implement recv post -> send post -> send wait -> recv wait protocol (#608)#614
Open
brnorris03 wants to merge 32 commits into
Open
[ttl] Pipe verification; implement recv post -> send post -> send wait -> recv wait protocol (#608)#614brnorris03 wants to merge 32 commits into
brnorris03 wants to merge 32 commits into
Conversation
- Update tt-metal/tt-mlir versions and version checks. - Create and validate the toolchain Python venv before tt-metal configure. - Build tt-metal with source-local runtime roots and explicit firmware precompile. - Install uplifted tt-metal runtime artifacts, descriptors, ttnn extensions, and precompiled firmware. - Add build/install regression coverage.
16cf0bf to
40f7aeb
Compare
6d26d3e to
490fcb7
Compare
490fcb7 to
2b6df80
Compare
Allocate pipe synchronization state from a shared runtime layout instead of deriving semaphore IDs directly from the PipeNet ID. Receiver completion semaphores remain per PipeNet. Sender-ready and mailbox semaphores are allocated per pipe on each source core, so distinct pipes from the same source do not alias. Receive-post mailbox staging is allocated per NOC data-movement thread to avoid BRISC/NCRISC races before the remote SRAM write consumes the staged address. Update lowering tests and PipeNet documentation to match the posted-receive protocol and the implemented semaphore layout.
Make pipe receive expansion validate before mutating IR, remove stale post-expansion receive-copy handling, and tighten internal pipe receive op verification. Stabilize PipeGraph slot assignment by sorting on the complete pipe key, improve duplicate receiver diagnostics, and stop PipeNet guard verification after unknown PipeNet references. Add regression coverage for internal receive op verifier diagnostics and update invalid guard expectations for the cleaner unknown-PipeNet diagnostic.
zoecarver
approved these changes
May 22, 2026
Contributor
zoecarver
left a comment
There was a problem hiding this comment.
Happy to see the compiler-inserted reserves going away :)
zoecarver
reviewed
May 22, 2026
| LogicalResult | ||
| matchAndRewrite(PipeRecvPostOp op, OpAdaptor adaptor, | ||
| ConversionPatternRewriter &rewriter) const override { | ||
| return lowerPipeRecvPost(op, adaptor.getPipe(), op.getDst(), |
Contributor
There was a problem hiding this comment.
Should this be adaptor.getDst?
Contributor
Author
There was a problem hiding this comment.
Good catch! Updated both PipeRecvPostLowering and PipeRecvWaitLowering.
Contributor
Author
There was a problem hiding this comment.
Actually, we do need op here -- adaptor no longer has the attributes which I still need -- ttl.cb_reserve, ttl.attach_cb, and slice offset.
zoecarver
reviewed
May 22, 2026
| int64_t cbIndex; | ||
| }; | ||
|
|
||
| CopyOp findDefiningCopy(Value value) { |
Contributor
There was a problem hiding this comment.
Filter pip copies like findPipeReceiveCopy does?
Contributor
Author
There was a problem hiding this comment.
Agreed! Extracted the filter and reused it, also made the helper return optional.
- Reject non-uniform multicast receive addresses until per-destination addresses are supported - Diagnose semaphore id over-allocation before TTKernel emission - Add tests
This was referenced May 23, 2026
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.
Problem description
The PipeNet spec currently describes pipe transfer as if data is held in a logical in-transit buffer between the sender and receiver. The runtime protocol does not have such a separate buffer: the sender must write directly into a receiver-owned DFB slot. That means the receiver has to reserve a destination slot and publish its address before the sender can perform the transfer.
The previous lowering did not make that synchronization contract explicit. It treated pipe receives as a sender-side implementation detail, which let the compiler accept syntactically valid same-thread schedules that could deadlock at runtime. In addition, the previous implementation also regressed true unicast loops by adding synthetic DFB producer operations that were not balanced with the user's reserve/wait structure; this breaks the tt-lang contract with users that users are completely responsible for the data movement associated with pipes.
What's changed
ttl.copy(pipe, dst)lowers to the receive post/address publication, and waiting on that copy waits for transfer completion.docs/development/PipeNets.md.ttl.copy(pipe, dst).ttl.waiton a pipe receive handle under an unanalyzable coordinate-dependent guard is rejected.Tests
Fixes #608.