-
Notifications
You must be signed in to change notification settings - Fork 31
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
[AssignChannels] Prioritize channel assignment for control packets #1106
Conversation
ChannelAssignmentMode mode) { | ||
std::optional<uint8_t> channel; | ||
switch (mode) { | ||
// Select the first available channel for circuit flow. |
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.
I would prefer the docs inside the case statements for readability.
if (!assignedProducerChannels.count(i)) { | ||
lastRetrievedProducerChannel = i; | ||
return i; | ||
// Select the first available channel for packet flow. |
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.
I would prefer the docs inside the the case statements for readability.
i = (lastRetrievedProducerChannel + offset) % numProducerChannels; | ||
} else { | ||
assert(false && "Unsupported ChannelAssignmentMode"); | ||
std::optional<uint8_t> getAndAssignProducerDMAChannel( |
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.
I think we create a .cpp file and add the definitions there.
%channel_0 = amdaie.channel(%tile_0_0, 0, port_type = CTRL, direction = S2MM) | ||
%3 = amdaie.logicalobjectfifo.placeholder{%tile_0_0} : !amdaie.logicalobjectfifo<memref<?xi32>> | ||
%4 = amdaie.logicalobjectfifo.placeholder{%tile_0_0} : !amdaie.logicalobjectfifo<memref<?xi32>> | ||
%5 = amdaie.connection(%4 {%channel_0}, %3 {%channel}) {connection_type = #amdaie<connection_type Packet>} : (!amdaie.logicalobjectfifo<memref<?xi32>>, !amdaie.logicalobjectfifo<memref<?xi32>>) |
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.
Could you add a test as well with a pre-existing circuit connection or update this one to include both?
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.
Added the test at:
iree-amd-aie/compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/test/assign_channels.mlir
Line 127 in e11585c
func.func @previously_assigned_circuit(%arg0: memref<1x1x8x16xi32, 1>, %arg1: memref<8x16xi32>) { |
2f5cfa4
to
e11585c
Compare
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.
LGTM
Changes in this PR:
AssignChannels
pass, followed by control flow channel assignment with theGenerateControlOverla
y pass. This PR reverses the order, ensuring that control flow channels are assigned before data flow channels.ChannelGenerator
, packet flow channels were not explicitly marked as assigned (so that they can be reused), while only circuit flow channels were tracked. However, this could result in a packet flow channel later being mistakenly reused by another circuit flow. Now, both circuit and packet flows track their assigned channels and store them separately. This ensures that circuit flow channels remain exclusive, while packet flow channels can be reused but only by other packet flows.