Conversation
|
!test --diff |
|
Review updated until commit 7583433 Description
Changes walkthrough 📝
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
!test --diff |
| const std::vector<IterDomain*>& output_ids_; | ||
| }; | ||
|
|
||
| // Replay a given IterDomain transform expression on the loop domain |
There was a problem hiding this comment.
Unrelated to this PR, but this is a comment I had for a past PR but forgot to add.
| // When the direction is forward, the TensorView transform | ||
| // APIs, e.g., TensorView::split, can be used, which doesn't need | ||
| // to use TensorView::setLoopDomain. | ||
| // to use TensorView::setLoopDomain. This is important as |
There was a problem hiding this comment.
Unrelated to this PR, but this is a comment I had for a past PR but forgot to add.
|
!test --diff |
| FusionGuard fg(fusion_ptr.get()); | ||
|
|
||
| std::vector<int64_t> shape({-1, 100}); | ||
| std::vector<int64_t> shape({-1, 128}); |
There was a problem hiding this comment.
This is a WAR for the other vectorization issue.
There was a problem hiding this comment.
Is the other vectorization issue referring to #3640 ?
jjsjann123
left a comment
There was a problem hiding this comment.
Looks straightforward. Stamping.
| FusionGuard fg(fusion_ptr.get()); | ||
|
|
||
| std::vector<int64_t> shape({-1, 100}); | ||
| std::vector<int64_t> shape({-1, 128}); |
There was a problem hiding this comment.
Is the other vectorization issue referring to #3640 ?
|
I just realized disabling the cancelation does indeed matter for Mistral backward. I'll merge this for correctness and will think about the Mistral case later. |
This is a WAR for an issue with the vectorization by the resize scheduler (unrelated to #3640).
#3693 introduced a reordering optimization for the resize scheduler that attempted to minimize strides in read accesses of fusion inputs by canceling reshapes. It turned out it can result in conflicts with vectorization. The scheduler uses the fusion input as the reference of the vectorization analysis, assuming any reshape is canceled, which is not always the case.
So, in this PR, the vectorization analysis is changed to use the reference output. However, that isn't enough since when a resize is indeed canceled, the analysis should actually be done using the pre-reshape shape.
To workaround that, this PR also adds a flag to disable canceling reshapes that use innermost logical IDs. This should make sure it's always valid to use the fusion output as the reference of the vectorization analysis.
This is an ad-hoc WAR but should be good enough for the RoPE cases. The real problem is a bit inter-twinned here, and I'm not attempting to address it completely in this PR.