Skip to content

[Inductor cutlass backend] Add bmm support - #121734

Closed
kadeng wants to merge 19 commits into
gh/kadeng/44/basefrom
gh/kadeng/44/head
Closed

kadeng wants to merge 19 commits into
gh/kadeng/44/basefrom
gh/kadeng/44/head

Conversation

Add support for bmm ( batch matrix multiply ) op through the Cutlass backend.

Test Plan:
 * CI
 * Added test in test_cutlass_backend.py

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Mar 12, 2024 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 3 New Failures

As of commit 03a0703 with merge base 365e89a (image):

NEW FAILURES - The following jobs have failed:

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

Add support for bmm ( batch matrix multiply ) op through the Cutlass backend.

Test Plan:
 * CI
 * Added 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]
Add support for bmm ( batch matrix multiply ) op through the Cutlass backend.

Test Plan:
 * CI
 * Added 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 8 commits March 19, 2024 22:36
Add support for bmm ( batch matrix multiply ) op through the Cutlass backend.

Test Plan:
 * CI
 * Added 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]
Add support for bmm ( batch matrix multiply ) op through the Cutlass backend.

Test Plan:
 * CI
 * Added 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]
Add support for bmm ( batch matrix multiply ) op through the Cutlass backend.

Test Plan:
 * CI
 * Added 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]
Add support for bmm ( batch matrix multiply ) op through the Cutlass backend.

Test Plan:
 * CI
 * Added 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]
…ckend] Add bmm support"

Add support for bmm ( batch matrix multiply ) op through the Cutlass backend.

Test Plan:
 * CI
 * Added 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]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Comment thread torch/_inductor/kernel/bmm.py Outdated
use_aten = True

if use_aten:
choices.extend([aten_bmm.bind((mat1, mat2), layout)])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
choices.extend([aten_bmm.bind((mat1, mat2), layout)])
choices.extend((aten_bmm.bind((mat1, mat2), layout)))

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.

Yep, this is also a bit overkill anyway as it's only a single value to append. I replaced it with a call to append

[ghstack-poisoned]
[ghstack-poisoned]
@kadeng

kadeng commented Apr 23, 2024

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge --ignore-current

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Apr 23, 2024
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged while ignoring the following 3 checks: pull / linux-focal-py3.11-clang10 / test (default, 3, 3, linux.2xlarge), pull / linux-focal-py3.11-clang10 / test (crossref, 2, 2, linux.2xlarge), pull / linux-jammy-py3.10-clang15-asan / test (default, 4, 6, linux.4xlarge)

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

kadeng commented Apr 24, 2024

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge -f "Failing profiler tests are known to be broken"

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

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 pushed a commit that referenced this pull request Apr 24, 2024
This diff disables Cutlass backend EVT epilogue fusions. It does not yet contain the removal of most of the underlying implementation.

Pull Request resolved: #124107
Approved by: https://github.com/jansel
ghstack dependencies: #121497, #123930, #123932, #121734
pytorchmergebot pushed a commit that referenced this pull request Apr 24, 2024
…est setup (#124574)

The diff #122661 introduces a new automatic cache refresh mechanism during all inductor-derived test cases.

But this refresh mechanism seems not to work properly across process boundaries, specifically when using  autotune_in_subproc, which many tests in test_cutlass_backend.py rely on.

Solution: Set the env var INDUCTOR_TEST_DISABLE_FRESH_CACHE=1
early during test setup within test_cutlass_backend.py

Test Plan:
This is a change to unit tests only.

Pull Request resolved: #124574
Approved by: https://github.com/aakhundov
ghstack dependencies: #121497, #123930, #123932, #121734, #124107
pytorchmergebot pushed a commit that referenced this pull request Apr 24, 2024
…emm_choices (#124575)

Clean up CUTLASSGemmTemplate.add_cutlass_gemm_choices, removing code that became unneccessary by removing EVT-based epilogue fusion.

Test Plan:
Already covered by test_cutlass_backend.py

Pull Request resolved: #124575
Approved by: https://github.com/jansel
ghstack dependencies: #121497, #123930, #123932, #121734, #124107, #124574
petrex pushed a commit to petrex/pytorch that referenced this pull request May 3, 2024
Add support for bmm ( batch matrix multiply ) op through the Cutlass backend.

Test Plan:
 * CI
 * Added test in test_cutlass_backend.py

Pull Request resolved: pytorch#121734
Approved by: https://github.com/eellison
ghstack dependencies: pytorch#121497, pytorch#123930, pytorch#123932
petrex pushed a commit to petrex/pytorch that referenced this pull request May 3, 2024
This diff disables Cutlass backend EVT epilogue fusions. It does not yet contain the removal of most of the underlying implementation.

Pull Request resolved: pytorch#124107
Approved by: https://github.com/jansel
ghstack dependencies: pytorch#121497, pytorch#123930, pytorch#123932, pytorch#121734
pytorch-bot Bot pushed a commit that referenced this pull request May 3, 2024
…est setup (#124574)

The diff #122661 introduces a new automatic cache refresh mechanism during all inductor-derived test cases.

But this refresh mechanism seems not to work properly across process boundaries, specifically when using  autotune_in_subproc, which many tests in test_cutlass_backend.py rely on.

Solution: Set the env var INDUCTOR_TEST_DISABLE_FRESH_CACHE=1
early during test setup within test_cutlass_backend.py

Test Plan:
This is a change to unit tests only.

Pull Request resolved: #124574
Approved by: https://github.com/aakhundov
ghstack dependencies: #121497, #123930, #123932, #121734, #124107
petrex pushed a commit to petrex/pytorch that referenced this pull request May 3, 2024
…emm_choices (pytorch#124575)

Clean up CUTLASSGemmTemplate.add_cutlass_gemm_choices, removing code that became unneccessary by removing EVT-based epilogue fusion.

Test Plan:
Already covered by test_cutlass_backend.py

Pull Request resolved: pytorch#124575
Approved by: https://github.com/jansel
ghstack dependencies: pytorch#121497, pytorch#123930, pytorch#123932, pytorch#121734, pytorch#124107, pytorch#124574
@github-actions
github-actions Bot deleted the gh/kadeng/44/head branch June 2, 2024 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants