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

Crash in OptimizeIntArithmetic Pass #19167

Closed
IanWood1 opened this issue Nov 15, 2024 · 0 comments
Closed

Crash in OptimizeIntArithmetic Pass #19167

IanWood1 opened this issue Nov 15, 2024 · 0 comments
Labels
bug 🐞 Something isn't working

Comments

@IanWood1
Copy link
Contributor

IanWood1 commented Nov 15, 2024

What happened?

Running the tests in https://github.com/nod-ai/shark-ai build_tools/integration_tests/llm with 60cf4ab causes a crash in OptimizeIntArithmetic:

iree-compile: /home/ianwood2/iree/third_party/llvm-project/mlir/lib/IR/Types.cpp:134: unsigned int mlir::Type::getIntOrFloatBitWidth() const: Assertion `isIntOrFloat() && "only integers and floats have a bitwidth"' failed.

Steps to reproduce your issue

TODO: will update shortly with a minimal repro

Version information

60cf4ab

Additional context

Initially, I suspected recent changes to OptimizeIntArithmetic 81dd4e6 to be the culprit but iree still crashes with it reverted

Edit: actually there are 2 seperate errors, that commit being one of the causes

@IanWood1 IanWood1 added the bug 🐞 Something isn't working label Nov 15, 2024
IanWood1 added a commit that referenced this issue Nov 18, 2024
This was hard to debug and I haven't yet been able to track down which
op was modified causing the issue nor which pattern was triggering this.
I was encountering the following assert during `Stream` pipeline (but
not global opt):

```shell
APInt.cpp:285: int llvm::APInt::compare(const APInt &) const: Assertion `BitWidth == RHS.BitWidth && "Bit widths must be same for comparison"' failed.
```

It might be worth reverting #19130
instead of this patch since I wasn't able to track this down fully.


2/2 fix for #19167.

Signed-off-by: Ian Wood <[email protected]>
IanWood1 added a commit that referenced this issue Nov 19, 2024
The element type must be an int or float before using
`getIntOrFloatBitWidth`. This adds a check if the element type is an int
or float, otherwise don't adjust innermost tile size. Introduced by
commit
c80fa3b

1/2 fix for #19167.

---------

Signed-off-by: Ian Wood <[email protected]>
Co-authored-by: giacs-epic <[email protected]>
Groverkss pushed a commit to Groverkss/iree that referenced this issue Dec 1, 2024
This was hard to debug and I haven't yet been able to track down which
op was modified causing the issue nor which pattern was triggering this.
I was encountering the following assert during `Stream` pipeline (but
not global opt):

```shell
APInt.cpp:285: int llvm::APInt::compare(const APInt &) const: Assertion `BitWidth == RHS.BitWidth && "Bit widths must be same for comparison"' failed.
```

It might be worth reverting iree-org#19130
instead of this patch since I wasn't able to track this down fully.


2/2 fix for iree-org#19167.

Signed-off-by: Ian Wood <[email protected]>
Groverkss pushed a commit to Groverkss/iree that referenced this issue Dec 1, 2024
The element type must be an int or float before using
`getIntOrFloatBitWidth`. This adds a check if the element type is an int
or float, otherwise don't adjust innermost tile size. Introduced by
commit
iree-org@c80fa3b

1/2 fix for iree-org#19167.

---------

Signed-off-by: Ian Wood <[email protected]>
Co-authored-by: giacs-epic <[email protected]>
giacs-epic pushed a commit to giacs-epic/iree that referenced this issue Dec 4, 2024
This was hard to debug and I haven't yet been able to track down which
op was modified causing the issue nor which pattern was triggering this.
I was encountering the following assert during `Stream` pipeline (but
not global opt):

```shell
APInt.cpp:285: int llvm::APInt::compare(const APInt &) const: Assertion `BitWidth == RHS.BitWidth && "Bit widths must be same for comparison"' failed.
```

It might be worth reverting iree-org#19130
instead of this patch since I wasn't able to track this down fully.

2/2 fix for iree-org#19167.

Signed-off-by: Ian Wood <[email protected]>
Signed-off-by: Giacomo Serafini <[email protected]>
giacs-epic added a commit to giacs-epic/iree that referenced this issue Dec 4, 2024
The element type must be an int or float before using
`getIntOrFloatBitWidth`. This adds a check if the element type is an int
or float, otherwise don't adjust innermost tile size. Introduced by
commit
iree-org@c80fa3b

1/2 fix for iree-org#19167.

---------

Signed-off-by: Ian Wood <[email protected]>
Co-authored-by: giacs-epic <[email protected]>
Signed-off-by: Giacomo Serafini <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant