Skip to content
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

Disable region simplification in --aie-substitute-shim-dma-allocations pass #1755

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

andrej
Copy link
Collaborator

@andrej andrej commented Sep 6, 2024

The pattern rewriter in this pass previously also performed region simplification, which caused an assertion error if the MLIR contained blocks with input arguments, such as generated by:

          %7 = scf.if %6 -> (memref<64x32xf32>) {
            scf.yield %C_L1L2_0_0_buff_0 : memref<64x32xf32>
          } else {
            scf.yield %C_L1L2_0_0_buff_1 : memref<64x32xf32>
          }

This fixes that issue. I don't fully understand why the issue exists with region simplification, but the point of this pass is not to simplify regions anyways, so it is fine to disable.

@fifield
Copy link
Collaborator

fifield commented Sep 6, 2024

Seems like red-flag that the IR is left in a bad state somewhere. Do you have a failing (fixed) test you can add to the PR?

@jgmelber
Copy link
Collaborator

@andrej is this still needed after the dynamic object FIFO implementation landed? @AndraBisca

@andrej
Copy link
Collaborator Author

andrej commented Oct 23, 2024

Oops, forgot about this one. Yes I believe this is still needed. I can work on a test.

@andrej
Copy link
Collaborator Author

andrej commented Nov 19, 2024

@fifield I finally got around to creating a fairly minimal test. I can confirm without this PR, the added test still fails on current MLIR-AIE. Sorry it took so long.

Merging this should allow #1772 to pass.

@fifield
Copy link
Collaborator

fifield commented Nov 19, 2024

@fifield I finally got around to creating a fairly minimal test. I can confirm without this PR, the added test still fails on current MLIR-AIE. Sorry it took so long.

Merging this should allow #1772 to pass.

Thanks, out of curiosity I'd still like to take a look at why it was crashing without the modification.

@fifield
Copy link
Collaborator

fifield commented Nov 19, 2024

@fifield I finally got around to creating a fairly minimal test. I can confirm without this PR, the added test still fails on current MLIR-AIE. Sorry it took so long.
Merging this should allow #1772 to pass.

Thanks, out of curiosity I'd still like to take a look at why it was crashing without the modification.

The error has little to do with the pass changed in this CR. It has to do with a missing terminator at the end of the aie.device. Still investigating, but I'll note that the aie.device verifier implementation is currently return success();

@andrej
Copy link
Collaborator Author

andrej commented Nov 19, 2024

Please let me know if/when you find the root cause and if you'd still be OK with merging this PR even if it doesn't directly address the root cause.

@andrej
Copy link
Collaborator Author

andrej commented Nov 22, 2024

Should we still merge this after #1936? While the error doesn't exist any more after #1936, I think it's kind of weird that this pass by default performs region simplification when what it purports to do is something else. Or is that normal in MLIR/LLVM world?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants