You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of #1919, I was trying to move the length calculation into the dma_bd op itself. I realized that the documentation claims that the len is optional, however, for an operation like this:
Upon further inspection, I realized parsing of the dma_bd op is fragile/buggy due to the way the sequence of optional attributes is handled. Iflen but not offset is given, the len will be parsed as the offset. Similarly, if pad_dimensions is specified but dimensions is not, pad_dimensions will be parsed as dimensions. Other combinations of optional attributes results in error such as above.
I think the best way to fix this is to:
Make all optional attributes keyword arguments
Put all optional attribute parsing into a while-loop with condition succeeded(parser.parseOptionalComma()), and then have a switch statement to parse each optional value.
While this is not complex to implement, I believe that this will require updating a large amount of tests. As such, I'm going to leave this as an outstanding TODO and continue calculating the length and providing an offset in a python helper function.
The text was updated successfully, but these errors were encountered:
hunhoffe
changed the title
aie.dma_bd (DMABDOp) parsing of optional values is buggyaie.dma_bd (DMABDOp) parsing of optional values is fragile/buggy
Nov 15, 2024
hunhoffe
changed the title
aie.dma_bd (DMABDOp) parsing of optional values is fragile/buggyaie.dma_bd (DMABDOp) parsing of optional attributes is fragile/buggy
Nov 15, 2024
As part of #1919, I was trying to move the length calculation into the
dma_bd
op itself. I realized that the documentation claims that thelen
is optional, however, for an operation like this:I would get a parsing error like this:
The error originated from this line:
mlir-aie/lib/Dialect/AIE/IR/AIEDialect.cpp
Line 1730 in 232bff6
Upon further inspection, I realized parsing of the
dma_bd
op is fragile/buggy due to the way the sequence of optional attributes is handled. Iflen
but notoffset
is given, thelen
will be parsed as theoffset
. Similarly, ifpad_dimensions
is specified butdimensions
is not,pad_dimensions
will be parsed asdimensions
. Other combinations of optional attributes results in error such as above.I think the best way to fix this is to:
succeeded(parser.parseOptionalComma())
, and then have a switch statement to parse each optional value.While this is not complex to implement, I believe that this will require updating a large amount of tests. As such, I'm going to leave this as an outstanding TODO and continue calculating the length and providing an offset in a python helper function.
The text was updated successfully, but these errors were encountered: