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

Integrate llvm 1_20_2025 #19740

Merged
merged 6 commits into from
Jan 20, 2025

Conversation

nirvedhmeshram
Copy link
Contributor

@nirvedhmeshram nirvedhmeshram commented Jan 20, 2025

Reverts

RISC-V backend

Python related changes

NVPTX changes

MLIR API changes (this change is breaking something in HLO)

TOSA (tosa.tile operation is changed and torch-mlir needs to catch up)

Updates to Torch-MLIR

floating type changes to be upstreamed
https://github.com/iree-org/torch-mlir/tree/fix_forward_iree_llvm_integrate_2025

style change

  • The .get and .is functions are deprecated and hence replaces with cast and isa function in this PR.

Signed-off-by: Nirvedh Meshram <[email protected]>
Copy link
Contributor

@pashu123 pashu123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Signed-off-by: Nirvedh Meshram <[email protected]>
Signed-off-by: Nirvedh Meshram <[email protected]>
Comment on lines 197 to 198
// CHECK: arith.maxnumf
// CHECK: arith.maxnumf
// CHECK: vector.broadcast %{{.*}} : f32 to vector<4xf32>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened here?

Copy link
Contributor Author

@nirvedhmeshram nirvedhmeshram Jan 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure, that maxnumf is not present in IR, overall a lot of reduction codegen seems changed. I wonder if its something with valuebound interface like this commit
llvm/llvm-project#122804
I will flag this on discord.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think whats happening here can be explained by this commit
llvm/llvm-project#118952
I believe that we were using -INF in softmax decompostion when we wanted NAN, with NAN, I think there is some simplification as you would simply pick the other argument hence needing one less maxnumf after folding..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets check what happens to correctness with this... Might need to revert it. I missed it, but I dont think using NAN make sense. Should be -INF.

Copy link
Contributor Author

@nirvedhmeshram nirvedhmeshram Jan 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI is not finding any errors, I believe there are softmax dispactches checked into the regression tests so I think this works. I think there is some discussion on this here
llvm/llvm-project#114595
NaN is safe with maxnumf but should we have used maximumf and kept using -INF would be something to decide. Also should maxnumf fold the same for -INF is also something to think over.

Signed-off-by: Nirvedh Meshram <[email protected]>
Signed-off-by: Nirvedh Meshram <[email protected]>
@nirvedhmeshram
Copy link
Contributor Author

@MaheshRavishankar @kuhar let me know if you think I should land this? the only not discussed topic are the SPIRV test changes, seems like some value bounds improvements to me in them, but I don't read those shuffle ops too well.

@MaheshRavishankar
Copy link
Contributor

If tests pass, land it

@nirvedhmeshram nirvedhmeshram merged commit 4a7af87 into iree-org:main Jan 20, 2025
35 of 37 checks passed
@ScottTodd
Copy link
Member

drive by nits for PR/branch naming:

Pushing to the shared repository with a branch name matching integrates/*, like integrates/llvm-20240501 (https://iree.dev/developers/general/contributing/#branch-naming) is recommended, so others can more easily push to the branch without needing to use your fork. The M_DD_YYYY in the PR title and branch name could also be confusing, prefer ISO 8601 dates :P https://xkcd.com/1179/

If you use megabump (https://github.com/iree-org/megabump), the branch name will be generated for you: https://github.com/iree-org/megabump/blob/37cbfaf83374f51d6d02528745711d9d7d515a69/scripts/start_integrate#L16

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.

5 participants