-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[inductor] Make serialized inductor patterns path configurable instead of using … #145243
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
[inductor] Make serialized inductor patterns path configurable instead of using … #145243
Conversation
…fixed path in the inductor module Signed-off-by: kareem <[email protected]>
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/145243
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 5b635b7 with merge base a4fdae5 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Signed-off-by: kareem <[email protected]>
|
@pytorchbot release notes: inductor |
|
❌ 🤖 pytorchbot command failed: Try |
|
@pytorchbot label "release notes: inductor" |
|
One question is why we need other pattern paths instead of the default one? Can you elaborate on the issue we encounter? |
To reuse the same patteren matcher module for some other backend devices, and with different decmposition and generate custom patterens. This path is tightly coupled with the inductor module. |
aorenste
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.
Looks generally fine to me - just a couple small things that should either be fixed or discussed.
Signed-off-by: kareem <[email protected]>
| return f"{file_template}{formatted_imports}" | ||
|
|
||
| if not SERIALIZED_PATTERN_PATH.is_dir(): | ||
| if not TORCHINDUCTOR_SERIALIZED_PATTERN_PATH.is_dir(): |
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.
Please revert renaming this variable. When I asked to rename the envvar I was just talking about the external-facing string (as you did above), not the internal name. We're already in inductor - no need to churn the codebase unnecessarily.
|
@aorenste can you pls review? |
|
Hi @aorenste, could you review this PR again ? |
Signed-off-by: kareem <[email protected]>
|
@aorenste resolved review comments can you pls review and get this merged |
aorenste
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.
@kareemshaik80 You have not addressed all the feedback comments.
In particular you keep fixing one problem and reverting the fix for another:
- The environment variable should be "TORCHINDUCTOR_SERIALIZED_PATTERN_PATH". In the latest version this is correct - torch/_inductor/config.py[133]
- The variable SERIALIZED_PATTERN_PATH should not be renamed. This was fixed in a previous version but was re-broken in the latest version - torch/_inductor/pattern_matcher.py[1648]
* Added support for configurable serialized_path in inductor pattern_matcher upstream PR: pytorch#145243 small fix for upstream PR is also included here Reference: https://stackoverflow.com/questions/67631/how-can-i-import-a-module-dynamically-given-the-full-path Change-Id: I1a029de3c142bdb9eb1fe7268751e19376ce5c23 * Modified serialized_path Change-Id: I1a029de3c142bdb9eb1fe7268751e19376ce5c23 * Modified serialized_path after solved merge conflict Change-Id: I60459f6212c6432d003e2966be9a2bdd03047a40
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
* Added support for configurable serialized_path in inductor pattern_matcher upstream PR: pytorch#145243 small fix for upstream PR is also included here Reference: https://stackoverflow.com/questions/67631/how-can-i-import-a-module-dynamically-given-the-full-path Change-Id: I1a029de3c142bdb9eb1fe7268751e19376ce5c23 * Modified serialized_path Change-Id: I1a029de3c142bdb9eb1fe7268751e19376ce5c23 * Modified serialized_path after solved merge conflict Change-Id: I60459f6212c6432d003e2966be9a2bdd03047a40
…fixed path in the inductor module
Fixes 145242
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang @aakhundov