Skip to content

Conversation

@kareemshaik80
Copy link
Contributor

@kareemshaik80 kareemshaik80 commented Jan 21, 2025

…fixed path in the inductor module

Signed-off-by: kareem <[email protected]>
@pytorch-bot
Copy link

pytorch-bot bot commented Jan 21, 2025

🔗 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 Failures

As of commit 5b635b7 with merge base a4fdae5 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@kareemshaik80
Copy link
Contributor Author

@pytorchbot release notes: inductor

@pytorch-bot
Copy link

pytorch-bot bot commented Jan 21, 2025

❌ 🤖 pytorchbot command failed:

@pytorchbot: error: argument command: invalid choice: 'release' (choose from 'merge', 'revert', 'rebase', 'label', 'drci', 'cherry-pick', 'close')

usage: @pytorchbot [-h] {merge,revert,rebase,label,drci,cherry-pick,close} ...

Try @pytorchbot --help for more info.

@kareemshaik80 kareemshaik80 changed the title Make serialized inductor patterns path configurable instead of using … [inductor] Make serialized inductor patterns path configurable instead of using … Jan 21, 2025
@mikaylagawarecki mikaylagawarecki added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Jan 23, 2025
@kareemshaik80
Copy link
Contributor Author

@pytorchbot label "release notes: inductor"

@Valentine233
Copy link
Collaborator

One question is why we need other pattern paths instead of the default one? Can you elaborate on the issue we encounter?

@kareemshaik80
Copy link
Contributor Author

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.

@eellison eellison requested a review from aorenste January 27, 2025 18:31
Copy link
Contributor

@aorenste aorenste left a 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.

@eellison eellison removed their request for review January 27, 2025 19:41
return f"{file_template}{formatted_imports}"

if not SERIALIZED_PATTERN_PATH.is_dir():
if not TORCHINDUCTOR_SERIALIZED_PATTERN_PATH.is_dir():
Copy link
Contributor

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.

@kareemshaik80
Copy link
Contributor Author

@aorenste can you pls review?

@pralay-das
Copy link
Contributor

Hi @aorenste, could you review this PR again ?

@kareemshaik80 kareemshaik80 requested a review from aorenste April 23, 2025 04:59
@kareemshaik80
Copy link
Contributor Author

@aorenste resolved review comments can you pls review and get this merged

Copy link
Contributor

@aorenste aorenste left a 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:

  1. The environment variable should be "TORCHINDUCTOR_SERIALIZED_PATTERN_PATH". In the latest version this is correct - torch/_inductor/config.py[133]
  2. 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]

aostrowski-hbn pushed a commit to HabanaAI/pytorch-fork that referenced this pull request May 21, 2025
*  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
@github-actions
Copy link
Contributor

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions bot added the Stale label Jun 23, 2025
@github-actions github-actions bot closed this Jul 23, 2025
jedrzejmyrcha pushed a commit to HabanaAI/pytorch-fork that referenced this pull request Jul 29, 2025
*  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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: inductor open source release notes: inductor Stale triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose configurable path instead of using fixed path in the inductor module for serialized pattern generation

6 participants