-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[WIP] Various bugs in passes #6906
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
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5489397
add a regression test for fusing dynamic take
7f0d780
disable fusion for take to pass dynamic test
ae0bc8c
add a regression tests for the const_int_bound arithmetic simplifier
f270770
fix const int bound regression test
b7fd002
add a tests for fold_scale_axis with a let
09816fc
prevent fold_scale_axis from folding across let
1f9d81f
fix tests
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -243,7 +243,18 @@ class ForwardPrep : private ExprVisitor { | |
} | ||
} | ||
// Visitor pattern override. | ||
void VisitExpr_(const LetNode* call) { LOG(FATAL) << "FoldScaleAxis only accept dataflow-form"; } | ||
void VisitExpr_(const LetNode* op) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @kevinthesun This might be of interest to you |
||
ExprVisitor::VisitExpr_(op); | ||
// do pass through condition | ||
// by assigning NullValue<Message> | ||
// it means fuse signal cannot pass | ||
// through into these subexpressions. | ||
auto flazy = [this, op]() { | ||
this->Update(op->value, NullValue<Message>()); | ||
this->Update(op->body, NullValue<Message>()); | ||
}; | ||
flist_.push_back(flazy); | ||
} | ||
|
||
void VisitExpr_(const FunctionNode* op) { | ||
ExprVisitor::VisitExpr_(op); | ||
|
This file contains hidden or bidirectional Unicode text that may
9E7A
be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I hope we could come up with a way to avoid this. This would hurt performance on hummingbird workload and possibly other models.
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.
For example, maybe we can use
annotation.stop_fusion
when we encounter take + dynamic, solving this problem at the frontend.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.
Good thing I have a typo in CI.
I'm not sure I see a clean way to do this in the frontends, it demands we already have infer_type run to check for dynamic inputs.
Maybe we write a pass that selectively stops fusion on certain ops under certain conditions?
Uh oh!
There was an error while loading. Please reload this page.
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.
Yes a new pass that inserts
stop_fusion
sounds good. I can work on this. We can maketake
opaque for now until I have that new pass ready (ortake
compute being fixed).Anyway I think graph runtime shouldn't be affected by the issue of
take
+ dynamic, sotake
should be injective eventually.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.
@mbrookhart Can you add
TODO(masahi)
there?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.
@masahi want to request changes so this doesn't merge while we chat about it?
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.
sure done. But I think it is good to go after adding a comment on why we make this change temporary
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.
I think the other option is to edit the relay take function that creates the op. We could remove the normalization that causes this problem from the take kernel in topi, and do in it relay with select/shape_of, but that might end up causing some performance degradation, it's hard to predict.