-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parametrizable BD chain syntax and new syntax for BD configuration in sequence #1656
Merged
Conversation
This file contains 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
andrej
requested review from
AndraBisca,
stephenneuendorffer,
jgmelber and
fifield
as code owners
August 1, 2024 21:38
fifield
requested changes
Aug 2, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good, most of my comments are style and formatting nits.
andrej
force-pushed
the
parametrizable_bd_chain
branch
from
August 2, 2024 16:59
910955b
to
3a581fa
Compare
fifield
approved these changes
Aug 2, 2024
andrej
force-pushed
the
parametrizable_bd_chain
branch
from
August 5, 2024 21:15
46acde0
to
50db8c5
Compare
andrej
force-pushed
the
parametrizable_bd_chain
branch
2 times, most recently
from
August 5, 2024 22:16
66d9b22
to
4c06939
Compare
andrej
force-pushed
the
parametrizable_bd_chain
branch
from
August 5, 2024 22:30
4c06939
to
31df52d
Compare
jgmelber
approved these changes
Aug 6, 2024
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.
Adds the following ops:
aie.bd_chain
-- Define an abstract sequence ofdma_bd
invocations. Think of this as a 'function definition'.aiex.dma_start_bd_chain
-- Materialize an abstract BD chain with concrete arguments. Think of this as an inlined 'function call'.aiex.dma_configure_task
-- New way of configuring a task (task = buffer descriptor configuration + channel + direction) in the sequence function that reuses the same familiar existing syntax used on the mem tiles and core memory modules.aiex.dma_start_task
-- Push a configured task (see above) to a task queueaiex.dma_await_task
-- Await a task completion token from a previously submitted task.aiex.dma_free_task
-- Inform the compiler that buffer descriptor IDs that are part of a configured task can be reused after this call.dma_await_task
impliesdma_free_task
, but it is still useful to have a freestandingdma_fre_task
to let the programmer express when it is safe to reuse BDs even without an explicit sync (e.g. due to implicit other synchronization).Adds the following passes:
--aie-materialize-bd-chains
: Concretize invocations of previously defined abstract BD chains. Essentially inlines BD chains.--aie-assign-runtime-sequence-bd-ids
: Assign buffer descriptor IDs for BDs configured inside the runtime sequence. Reuses components of the existing--aie-assign-buffer-descriptor-ids
pass but adapted to the runtime sequence which is more complicated since it allows reuse of BD IDs.--aie-dma-tasks-to-npu
: Takes BD configurations expressed in the pre-existing syntax, wrapped in some of the new ops above, and turns them into NPU runtime sequence instructions. Expressing BD configuration using the pre-existing syntax is more powerful than e.g.nd_dma_memcpy_nd
because it allows to express chains of BDs.Discussed in #1610.
Example Use of a BD Chain
Example Use of Syntax Reuse for BD Configuration in the Runtime Sequence
(The more abstract BD chains lower to this in the
--aie-materialize-bd-chains
pass.)There remains a good number of things to do, but the PR is already getting large and this is a good point to merge.
Further to do's:
aiex.dma_start_task
andaiex.start_bd_chain
operations.