Skip to content

[Inductor Cutlass backend] GEMM size threshold for Cutlass backend usage - #121491

Closed
kadeng wants to merge 17 commits into
gh/kadeng/41/basefrom
gh/kadeng/41/head
Closed

kadeng wants to merge 17 commits into
gh/kadeng/41/basefrom
gh/kadeng/41/head

Conversation

@kadeng

@kadeng kadeng commented Mar 8, 2024 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Test plan:
CI
Additional unit test in test_cutlass_backend.py

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @muchulee8 @aakhundov @ColinPeppler @amjames @desertfire @chauhang

Adds a configurable GEMM size threshold for the usage of Cutlass GEMM Kernels

Test plan:
CI
Additional unit test in test_cutlass_backend.py

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Mar 8, 2024 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ You can merge normally! (3 Unrelated Failures)

As of commit 73c21fa with merge base 365e89a (image):

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

UNSTABLE - The following job failed but was likely due to flakiness present on trunk and has been marked as unstable:

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

kadeng added 2 commits March 8, 2024 15:44
… backend usage"

Adds a configurable GEMM size threshold for the usage of Cutlass GEMM Kernels

Test plan:
CI
Additional unit test in test_cutlass_backend.py

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler amjames desertfire chauhang

[ghstack-poisoned]
… backend usage"

Adds a configurable GEMM size threshold for the usage of Cutlass GEMM Kernels

Test plan:
CI
Additional unit test in test_cutlass_backend.py

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler amjames desertfire chauhang

[ghstack-poisoned]
@kadeng kadeng added the topic: not user facing topic category label Mar 8, 2024
… backend usage"

Adds a configurable GEMM size threshold for the usage of Cutlass GEMM Kernels

Test plan:
CI
Additional unit test in test_cutlass_backend.py

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler amjames desertfire chauhang

[ghstack-poisoned]
kadeng added 2 commits March 11, 2024 14:50
… backend usage"


 * Adds a configurable GEMM size threshold for the usage of Cutlass GEMM Kernels **_inductor.config.cutlass_backend_min_gemm_size**

 * During GEMM algorithm choice generation: **if no viable choices can be generated using the configured backends, the ATen backend will be used as a fallback backend**, even if it is not enabled in **_inductor.config.max_autotune_gemm_backends**

Test plan:
CI
Additional unit test in test_cutlass_backend.py

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler amjames desertfire chauhang

[ghstack-poisoned]
… backend usage"


 * Adds a configurable GEMM size threshold for the usage of Cutlass GEMM Kernels **_inductor.config.cutlass_backend_min_gemm_size**

 * During GEMM algorithm choice generation: **if no viable choices can be generated using the configured backends, the ATen backend will be used as a fallback backend**, even if it is not enabled in **_inductor.config.max_autotune_gemm_backends**

Test plan:
CI
Additional unit test in test_cutlass_backend.py

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler amjames desertfire chauhang

[ghstack-poisoned]
@kadeng
kadeng marked this pull request as ready for review March 12, 2024 10:33
… backend usage"


 * Adds a configurable GEMM size threshold for the usage of Cutlass GEMM Kernels **_inductor.config.cutlass_backend_min_gemm_size**

 * During GEMM algorithm choice generation: **if no viable choices can be generated using the configured backends, the ATen backend will be used as a fallback backend**, even if it is not enabled in **_inductor.config.max_autotune_gemm_backends**

Test plan:
CI
Additional unit test in test_cutlass_backend.py

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler amjames desertfire chauhang

[ghstack-poisoned]
@kadeng
kadeng requested review from aakhundov, cpuhrsch, eellison, ipiszy and jansel and removed request for jansel March 13, 2024 12:28
Comment thread torch/_inductor/utils.py Outdated
Comment on lines +982 to +986
try:
# this fails if it's dynamic
gemm_size = int(m * n * k)
except Exception:
pass

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than erroring you can use V.graph.sizevars.size_hint.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed that here. I think I should also use it in the PR above it in this stack ( about tolerating dynamic shapes ) to determine GEMM dimensions.

… backend usage"


 * Adds a configurable GEMM size threshold for the usage of Cutlass GEMM Kernels **_inductor.config.cutlass_backend_min_gemm_size**

 * During GEMM algorithm choice generation: **if no viable choices can be generated using the configured backends, the ATen backend will be used as a fallback backend**, even if it is not enabled in **_inductor.config.max_autotune_gemm_backends**

Test plan:
CI
Additional unit test in test_cutlass_backend.py

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler amjames desertfire chauhang

[ghstack-poisoned]
… backend usage"


 * Adds a configurable GEMM size threshold for the usage of Cutlass GEMM Kernels **_inductor.config.cutlass_backend_min_gemm_size**

 * During GEMM algorithm choice generation: **if no viable choices can be generated using the configured backends, the ATen backend will be used as a fallback backend**, even if it is not enabled in **_inductor.config.max_autotune_gemm_backends**

Test plan:
CI
Additional unit test in test_cutlass_backend.py

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler amjames desertfire chauhang

[ghstack-poisoned]

@jansel jansel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are failing

… backend usage"


 * Adds a configurable GEMM size threshold for the usage of Cutlass GEMM Kernels **_inductor.config.cutlass_backend_min_gemm_size**

 * During GEMM algorithm choice generation: **if no viable choices can be generated using the configured backends, the ATen backend will be used as a fallback backend**, even if it is not enabled in **_inductor.config.max_autotune_gemm_backends**

Test plan:
CI
Additional unit test in test_cutlass_backend.py

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler amjames desertfire chauhang

[ghstack-poisoned]
@pytorchmergebot

Copy link
Copy Markdown
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
Copy Markdown
Collaborator

@kadeng your PR has been successfully reverted.

[ghstack-poisoned]
[ghstack-poisoned]
kadeng added a commit that referenced this pull request Apr 2, 2024
Adds a configurable GEMM size threshold for the usage of Cutlass GEMM Kernels

Test plan:
CI
Additional unit test in test_cutlass_backend.py

ghstack-source-id: 9729b15
Pull Request resolved: #121491
[ghstack-poisoned]
kadeng added a commit that referenced this pull request Apr 3, 2024
Adds a configurable GEMM size threshold for the usage of Cutlass GEMM Kernels

Test plan:
CI
Additional unit test in test_cutlass_backend.py

ghstack-source-id: 4f44e51
Pull Request resolved: #121491
@kadeng

kadeng commented Apr 3, 2024

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge --ignore-current "Current test failures are unrelated ( see parent commit in stack)"

@pytorch-bot

pytorch-bot Bot commented Apr 3, 2024

Copy link
Copy Markdown

❌ 🤖 pytorchbot command failed:

@pytorchbot: error: unrecognized arguments: Current test failures are unrelated ( see parent commit in stack)

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

Try @pytorchbot --help for more info.

@kadeng

kadeng commented Apr 3, 2024

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge --ignore-current -m "Current test failures are unrelated ( see parent commit in stack)"

@pytorch-bot

pytorch-bot Bot commented Apr 3, 2024

Copy link
Copy Markdown

❌ 🤖 pytorchbot command failed:

@pytorchbot: error: unrecognized arguments: -m Current test failures are unrelated ( see parent commit in stack)

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

Try @pytorchbot --help for more info.

@kadeng

kadeng commented Apr 3, 2024

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge --ignore-current

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged while ignoring the following 3 checks: pull / linux-jammy-py3.8-gcc11 / test (docs_test, 1, 1, linux.2xlarge, unstable), rocm / linux-focal-rocm6.0-py3.8 / test (default, 4, 6, linux.rocm.gpu.2), rocm / linux-focal-rocm6.0-py3.8 / test (default, 5, 6, linux.rocm.gpu.2)

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

pytorch-bot Bot pushed a commit that referenced this pull request Apr 22, 2024
…age (#121491)

 * Adds a configurable GEMM size threshold for the usage of Cutlass GEMM Kernels **_inductor.config.cutlass_backend_min_gemm_size**

 * During GEMM algorithm choice generation: **if no viable choices can be generated using the configured backends, the ATen backend will be used as a fallback backend**, even if it is not enabled in **_inductor.config.max_autotune_gemm_backends**

Test plan:
CI
Additional unit test in test_cutlass_backend.py

Pull Request resolved: #121491
Approved by: https://github.com/jansel
ghstack dependencies: #121490
sanketpurandare pushed a commit to sanketpurandare/pytorch that referenced this pull request Apr 22, 2024
…age (pytorch#121491)

 * Adds a configurable GEMM size threshold for the usage of Cutlass GEMM Kernels **_inductor.config.cutlass_backend_min_gemm_size**

 * During GEMM algorithm choice generation: **if no viable choices can be generated using the configured backends, the ATen backend will be used as a fallback backend**, even if it is not enabled in **_inductor.config.max_autotune_gemm_backends**

Test plan:
CI
Additional unit test in test_cutlass_backend.py

Pull Request resolved: pytorch#121491
Approved by: https://github.com/jansel
ghstack dependencies: pytorch#121490
@github-actions
github-actions Bot deleted the gh/kadeng/41/head branch May 4, 2024 01:56
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.

3 participants