-
Notifications
You must be signed in to change notification settings - Fork 110
Add fusion_type compile option for controlling the fusion logic #1765
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
Conversation
This reverts commit f2d7152.
|
This pull request is ready for review. I'm keeping the draft mode to prevent accidental merges into the wrong base branch. |
for more information, see https://pre-commit.ci
|
Please make it a boolean option. Thank you. |
Sure, I can make it. How would you prefer this option to be named and what default value would you like to see? In the future, we may need to extend the option to disable horizontal merges like it's explored in #1361. Do you want a boolean option for each fusion type with a separate check that there are no 2+ options enabled at the same time? |
|
I think we are having similar discussions for just about any option.
My concern about the algorithm you prefer to be the default with the dynamo frontend is that it appears to reoder operations without regard to memory requirements and just happens to produce a happier outcome on some models and seems to be producing very high memory requirements in some checkpointing cases for us. As such it would be preferable if the non-dynamo-frontend codepath to use the consecutive merging exclusively until it is amended by a memory-aware reordering of operations. Whether to capture this in a boolean option set by the dynamo frontend call to the jit or just hardcode based on the frontend option is OK. I understand that your vision for the dynamo frontend is different from that, so if you deal with that however you want, it will be fine. |
|
I understand your concerns about the default choice for ThunderFX being suboptimal for certain types of computations. We are aware of the limitations.
It's done so in the current PR. I'm sorry I don't get your request. I thought you were asking instead of "fusion_type=string" something like "enable_dataflow_fusion=True" (which is still a keyword argument to the |
|
Let's leave it as is then. |
t-vi
left a comment
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 @IvanYashchuk
This PR adds an option for choosing a fusion type (requested in #1763 (comment)). Currently, there are two fusion types:
"dataflow"- fusions are formed based on dataflow and merged horizontally and vertically,"consecutive"- fusions are formed if two symbols are fusible preserving the input order (added in fuse only consecutive symbols #1608).thunder.dynamo.thunderfxandthunder.jithave different defaults,thunderfxuses the "dataflow" fusion type (as it was before f2d7152) andjituses the "consecutive" fusion type introduced in f2d7152.