-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
Remove add_mul_fusion
rewrite
#1243
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -896,16 +896,16 @@ def print_profile(cls, stream, prof, level=0): | |
print(blanc, " time_toposort", prof[7], file=stream) | ||
|
||
|
||
fuse_seqopt = SequenceDB() | ||
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. Also, should we get rid of it if we have only a single rewrite now? |
||
if config.tensor__local_elemwise_fusion: | ||
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. I haven't thought enough about this just yet, but it really looks like we need to consider removing this option entirely, because, unless we redesign the whole approach to fusion/ I could see a place for a distinct node-based fusion rewrite, but I really don't think it would/should operate anything like a graph-based rewrite (e.g. it seems like there would be way too much unnecessary graph walking). In general, the idea of a node-based fusion rewrite sounds appealing, because it could be a lot simpler than the/a graph-based one, but I don't know which types of graphs the former would miss that the latter wouldn't. |
||
# Must be after gpu(48.5) and before AddDestroyHandler(49.5) | ||
fuse_seqopt = SequenceDB() | ||
fuse_seqopt.register( | ||
"composite_elemwise_fusion", | ||
FusionOptimizer(local_elemwise_fusion), | ||
"fast_run", | ||
"fusion", | ||
position=1, | ||
) | ||
# Position before AddDestroyHandler(49.5) | ||
compile.optdb.register( # type: ignore | ||
"elemwise_fusion", | ||
fuse_seqopt, | ||
|
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.
This was potentially buggy, as
fuse_seqopt
was always being imported by the other module, even though it's creation was conditional on a config flag.