Skip to content

[Inductor XPU GEMM] Step 1/N: Refactor cutlass configuration.#160174

Closed
etaf wants to merge 37 commits intogh/etaf/154/basefrom
gh/etaf/154/head
Closed

[Inductor XPU GEMM] Step 1/N: Refactor cutlass configuration.#160174
etaf wants to merge 37 commits intogh/etaf/154/basefrom
gh/etaf/154/head

Conversation

@etaf
Copy link
Collaborator

@etaf etaf commented Aug 8, 2025

Stack from ghstack (oldest at bottom):

This PR is the first step toward implementing RFC #160175.
Currently, all Cutlass-related Torch Inductor configs are located in torch._inductor.config.cuda. This PR refactors the device-agnostic Cutlass configurations into torch._inductor.config.cutlass, so they can be shared and reused by XPU as well.
The common cutlass configurations are moved from class cuda to class cutlass and the cuda specific configs are still in class cuda.
Besides, to not break the BC, we need to keep the configs moved from class cuda to class cutlass, eg. cuda.cutlass_dir. So we add a wrapper @inherit_fields_from(cutlass) to class cuda and class xpu so they also have configs in class cutlass.

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo @mlazos @chenyang78

@pytorch-bot
Copy link

pytorch-bot bot commented Aug 8, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/160174

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit 654c7ac with merge base af6d994 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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

etaf added a commit that referenced this pull request Aug 8, 2025
@etaf etaf marked this pull request as draft August 8, 2025 06:04
@etaf etaf requested a review from EikanWang August 8, 2025 06:34
@EikanWang EikanWang changed the title [Inductor Intel Cutlass] Step 2/N: Generalize cutlass configuration. [Inductor XPU GEMM] Step 2/N: Generalize cutlass configuration. Aug 8, 2025
…tion."


This PR is the second step toward implementing RFC #160175.
Currently, all Cutlass-related Torch Inductor configs are located in `torch._inductor.config.cuda`. This PR refactors the device-agnostic Cutlass configurations into a separate module, `torch._inductor.config.cutlass`, so they can be shared and reused by XPU as well.


[ghstack-poisoned]
…tion."


This PR is the second step toward implementing RFC #160175.
Currently, all Cutlass-related Torch Inductor configs are located in `torch._inductor.config.cuda`. This PR refactors the device-agnostic Cutlass configurations into a separate module, `torch._inductor.config.cutlass`, so they can be shared and reused by XPU as well.


[ghstack-poisoned]
…tion."


This PR is the second step toward implementing RFC #160175.
Currently, all Cutlass-related Torch Inductor configs are located in `torch._inductor.config.cuda`. This PR refactors the device-agnostic Cutlass configurations into a separate module, `torch._inductor.config.cutlass`, so they can be shared and reused by XPU as well.


[ghstack-poisoned]
…tion."


This PR is the second step toward implementing RFC #160175.
Currently, all Cutlass-related Torch Inductor configs are located in `torch._inductor.config.cuda`. This PR refactors the device-agnostic Cutlass configurations into a separate module, `torch._inductor.config.cutlass`, so they can be shared and reused by XPU as well.


[ghstack-poisoned]
@etaf etaf changed the title [Inductor XPU GEMM] Step 2/N: Generalize cutlass configuration. [Inductor XPU GEMM] Step 1/N: Refactor cutlass configuration. Sep 2, 2025
@etaf etaf marked this pull request as ready for review September 2, 2025 03:11
etaf added 3 commits September 2, 2025 10:58
…on."


This PR is the first step toward implementing RFC #160175.
Currently, all Cutlass-related Torch Inductor configs are located in `torch._inductor.config.cuda`. This PR refactors the device-agnostic Cutlass configurations into `torch._inductor.config.cutlass`, so they can be shared and reused by XPU as well.


cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben mlazos

[ghstack-poisoned]
…on."


This PR is the first step toward implementing RFC #160175.
Currently, all Cutlass-related Torch Inductor configs are located in `torch._inductor.config.cuda`. This PR refactors the device-agnostic Cutlass configurations into `torch._inductor.config.cutlass`, so they can be shared and reused by XPU as well.


cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben mlazos

[ghstack-poisoned]
…on."


This PR is the first step toward implementing RFC #160175.
Currently, all Cutlass-related Torch Inductor configs are located in `torch._inductor.config.cuda`. This PR refactors the device-agnostic Cutlass configurations into `torch._inductor.config.cutlass`, so they can be shared and reused by XPU as well.


cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben mlazos

[ghstack-poisoned]
zhxchen17 added a commit that referenced this pull request Jan 8, 2026
Summary:
Following up a previous change #160174 where we
accidentally include cutlass path to config hash and regressed the cache hit rate, we
want to have some basic test added to pytorch to guard against accidental changes to
configs like this happening again in the future.

One way to solve this is to add a fixture test which compare the latest config hash to
an existing generated result from previous run.

When developer need to update the config, it can simply be done by using
```
EXPECTTEST_ACCEPT=1 pytest test/test_torch_config_hash_fixture.py
```
Test Plan:
pytest test/test_torch_config_hash_fixture.py

Reviewers:

Subscribers:

Tasks:

Tags:
zhxchen17 added a commit that referenced this pull request Jan 8, 2026
Summary:
Following up a previous change #160174 where we
accidentally include cutlass path to config hash and regressed the cache hit rate, we
want to have some basic test added to pytorch to guard against accidental changes to
configs like this happening again in the future.

One way to solve this is to add a fixture test which compare the latest config hash to
an existing generated result from previous run.

When developer need to update the config, it can simply be done by using
```
EXPECTTEST_ACCEPT=1 pytest test/test_torch_config_hash_fixture.py
```
Test Plan:
pytest test/test_torch_config_hash_fixture.py

Reviewers:

Subscribers:

Tasks:

Tags:
zhxchen17 added a commit that referenced this pull request Jan 8, 2026
Summary:
Following up a previous change #160174 where we
accidentally include cutlass path to config hash and regressed the cache hit rate, we
want to have some basic test added to pytorch to guard against accidental changes to
configs like this happening again in the future.

One way to solve this is to add a fixture test which compare the latest config hash to
an existing generated result from previous run.

When developer need to update the config, it can simply be done by using
```
EXPECTTEST_ACCEPT=1 pytest test/test_torch_config_hash_fixture.py
```
Test Plan:
pytest test/test_torch_config_hash_fixture.py

Reviewers:

Subscribers:

Tasks:

Tags:
zhxchen17 added a commit that referenced this pull request Jan 9, 2026
Summary:
Following up a previous change #160174 where we
accidentally include cutlass path to config hash and regressed the cache hit rate, we
want to have some basic test added to pytorch to guard against accidental changes to
configs like this happening again in the future.

One way to solve this is to add detection for common patterns like paths, username
and hostname in the config values.

Test Plan:
pytest test/test_torch_config_hash_determinism.py

Reviewers:

Subscribers:

Tasks:

Tags:
krastogi-in pushed a commit to krastogi-in/pytorch that referenced this pull request Jan 9, 2026
pytorchmergebot pushed a commit that referenced this pull request Jan 9, 2026
Summary:
Following up a previous change #160174 where we
  accidentally include cutlass path to config hash and regressed the cache hit rate, we
  want to have some basic test added to pytorch to guard against accidental changes to
  configs like this happening again in the future.

One way to solve this is to add detection for common patterns like paths, username
and hostname in the config values.

Test Plan:
pytest test/test_torch_config_hash_determinism.py

Reviewers:

Subscribers:

Tasks:

Tags:

Fixes #ISSUE_NUMBER

Pull Request resolved: #171275
Approved by: https://github.com/bobrenjc93, https://github.com/masnesral
etaf added a commit to etaf/pytorch-inductor-xpu that referenced this pull request Jan 12, 2026
hinriksnaer pushed a commit to hinriksnaer/pytorch that referenced this pull request Jan 12, 2026
Summary:
Following up a previous change pytorch#160174 where we
  accidentally include cutlass path to config hash and regressed the cache hit rate, we
  want to have some basic test added to pytorch to guard against accidental changes to
  configs like this happening again in the future.

One way to solve this is to add detection for common patterns like paths, username
and hostname in the config values.

Test Plan:
pytest test/test_torch_config_hash_determinism.py

Reviewers:

Subscribers:

Tasks:

Tags:

Fixes #ISSUE_NUMBER

Pull Request resolved: pytorch#171275
Approved by: https://github.com/bobrenjc93, https://github.com/masnesral
[ghstack-poisoned]
etaf added a commit to etaf/pytorch-inductor-xpu that referenced this pull request Jan 16, 2026
SergeyTyshkevich pushed a commit to SergeyTyshkevich/chart2 that referenced this pull request Jan 19, 2026
@mlazos
Copy link
Contributor

mlazos commented Jan 20, 2026

Hi @etaf, it's tricky and error prone to run this internally so we should land, and I can let you know if it passes internally. Sorry for the delay on this.

@etaf
Copy link
Collaborator Author

etaf commented Jan 21, 2026

Hi @etaf, it's tricky and error prone to run this internally so we should land, and I can let you know if it passes internally. Sorry for the delay on this.

Thanks for your time!

@etaf
Copy link
Collaborator Author

etaf commented Jan 27, 2026

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: Command git -C /home/runner/work/pytorch/pytorch cherry-pick -x 4f4c7a5f740ec736a0b4c8c2c6c51bb52735ecac returned non-zero exit code 1

Auto-merging torch/_inductor/codecache.py
Auto-merging torch/_inductor/config.py
Auto-merging torch/_inductor/select_algorithm.py
Auto-merging torch/_inductor/utils.py
CONFLICT (content): Merge conflict in torch/_inductor/utils.py
error: could not apply 4f4c7a5f740... [Inductor XPU GEMM] Step 1/N: Generalize cutlass configuration.
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Details for Dev Infra team Raised by workflow job

…on."


This PR is the first step toward implementing RFC #160175.
Currently, all Cutlass-related Torch Inductor configs are located in `torch._inductor.config.cuda`. This PR refactors the device-agnostic Cutlass configurations into `torch._inductor.config.cutlass`, so they can be shared and reused by XPU as well.
The common cutlass configurations are moved from `class cuda` to `class cutlass` and the cuda specific configs are still in `class cuda`.
Besides, to not break the BC, we need to keep the configs moved from `class cuda` to `class cutlass`, eg. cuda.cutlass_dir. So we add a wrapper `inherit_fields_from(cutlass)` to `class cuda` and `class xpu` so they also have configs in `class cutlass`.

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo mlazos chenyang78

[ghstack-poisoned]
@etaf
Copy link
Collaborator Author

etaf commented Jan 27, 2026

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

riccardofelluga pushed a commit to riccardofelluga/pytorch that referenced this pull request Jan 27, 2026
…h#160174)

This PR is the first step toward implementing RFC pytorch#160175.
Currently, all Cutlass-related Torch Inductor configs are located in `torch._inductor.config.cuda`. This PR refactors the device-agnostic Cutlass configurations into `torch._inductor.config.cutlass`, so they can be shared and reused by XPU as well.
The common cutlass configurations are moved from `class cuda` to `class cutlass` and the cuda specific configs are still in `class cuda`.
Besides, to not break the BC, we need to keep the configs moved from `class cuda` to `class cutlass`, eg. cuda.cutlass_dir. So we add a wrapper `@inherit_fields_from(cutlass)` to `class cuda` and `class xpu` so they also have configs in `class cutlass`.

Pull Request resolved: pytorch#160174
Approved by: https://github.com/EikanWang, https://github.com/mlazos, https://github.com/jansel
@Shan19900305
Copy link
Contributor

@etaf Will this commit continue to be merged?

@etaf
Copy link
Collaborator Author

etaf commented Feb 9, 2026

@etaf Will this commit continue to be merged?

It has been merged. And the other PR in the stack will also be merged after get review approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants