Open hunhoffe opened 1 week ago
For dma_bds using the task/chain syntax, each dma_db should have at max 3 sizes and at max 4 strides; this is a condition that is not easy to express clearly when using dimensions
Why only max 3 sizes but 4 strides?
Copying my examples from the review of #1919 on why repeat_count
and the higest-dimension size/wrap aren't the same:
Task repetition: 0 1 2 3 4 5 (repeat count = 6) Highest-dim offset added: 0 2 4 0 2 4 ^ wrap (=3)If the highest-dimension wrap matches the repeat count of the task, the iteration step will be added each repetition:
Task repetition: 0 1 2 3 4 5 (repeat count = 6) Highest-dim offset added: 0 2 4 6 8 10 ^ wrap (=6)In the other extreme, if the wrap is 1, the iteration step never gets added (BD repeated with no offset).
Task repetition: 0 1 2 3 4 5 (repeat count = 6) Highest-dim offset added: 0 0 0 0 0 0 ^ ^ ^ ^ ^ ^ w. w. w. w. w. wrap(=1)
Ah I see what you are saying now. I was having trouble parsing your examples because it's hard to understand "highest dimension" when the highest dimension from the perspective of the hardware and the perspective of the user are not always the same thing.
But I think I understand now. I've edited the issue to remove that point. Thanks for explaining again!
Right now, some operations take
dimensions
and some operations takesizes
andstrides
.For clarity, but also some implementation considerations, I think it would make sense to change to
sizes
/strides
.Some pros for moving to
sizes
/strides
are:dimensions
requires (at least at the python level) bothsizes
/strides
to be default or both not default. It would be nice for a user to take advantage of default values more easily. If a python wrapper function takes these values separately, then python needs to have hard-coded defaults in order to produced validdimensions
, which is not ideal.This came to my attention through comments of @fifield and @andrej in https://github.com/Xilinx/mlir-aie/pull/1919
As this would be a change that touches many things, I'm recording outside of the PR for discussion and so it does not become a blocker to that PR.