-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[TIR][Compute-at] Enable complex floordiv/floormod expressions in compute_at #14854
[TIR][Compute-at] Enable complex floordiv/floormod expressions in compute_at #14854
Conversation
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
…pute_at Right now, compute_at is not able to handle movement of blocks if the indices of tensors contain complex floordiv/floormod operations. For ex. if a layout of tensor contains (width % 2) // 2, compute_at fails with an error. This change is to handle complex expressions.
73813d6
to
3371722
Compare
cc @Hzfengsy , @junrushao , @quic-sanirudh , @shingjan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I'll prefer if someone else also reviews this as I'm not too familiar with arith pattern matching.
Thank you @wrongtest-intellif for the review. Currently, I'm working on fixing your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @wrongtest-intellif for the review comments. Apologies for replying late. I have fixed the review comments.
22c41d5
to
fff360b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @wrongtest-intellif for sharing more details. Sorry for coming back late but I was trying to fix your review comments and finding an appropriate test case to verify the LOC changed. I have updated the PR with new changes. Request you to please review the PR for any additional feedback.
17090e9
to
c2e7c5e
Compare
Hi @wrongtest-intellif , Could you please review this PR ? |
c2e7c5e
to
34ba225
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @wrongtest-intellif for the comments. I have fixed them. Please review the PR for any more feedback.
b2db447
to
5b4f145
Compare
- Merge conditions for floordiv and floormods respectively to handle recursion - Update test case to handle non-bijective index map - Update new_required to be in between [required_min, +inf]
5b4f145
to
dec82f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, now it looks good to me.
@tvm-bot rerun |
Right now,
compute_at
is not able to handle movement of blocks if the indices of tensors contain complex floordiv/floormod operations. For ex. if a layout of tensor contains(width % 2) // 2
,compute_at
fails with an error.Check failed: (dom_var.defined()) is false: ValueError: BufferRegion pattern match failed: v2 % T.int64(2) // T.int64(2)
This change is to handle complex expressions in
compute_at
.