-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[Linalg] Add a runtime switch to let pytorch prefer a backend impl in linalg functions on GPU #67980
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
Closed
Closed
[Linalg] Add a runtime switch to let pytorch prefer a backend impl in linalg functions on GPU #67980
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
0c6f207
linalg.cuda_prefer_cusolver flag py/c++ bindings
xwang233 e135ef1
global flag override heuristics
xwang233 400771a
doc and warning
xwang233 abbf65d
format
xwang233 fdf9705
Merge remote-tracking branch 'upstream/master' into linalg-runtime-sw…
xwang233 b9465a5
LinalgBackend py/cpp bindings
xwang233 185d534
remove cuda_prefer_cusolver
xwang233 fecbf34
heuristic and preferred_backend
xwang233 9071e33
Merge remote-tracking branch 'upstream/master' into linalg-runtime-sw…
xwang233 c8af8a8
doc
xwang233 4937c18
lint
xwang233 1e48f00
mypy
xwang233 03aef5e
flake8
xwang233 eac8a5a
warning
xwang233 2a5a233
clang format
xwang233 badba2d
typo
xwang233 c9344b8
add a test
xwang233 96b8896
skipCUDAIfRocm
xwang233 88ff857
override and binding
xwang233 7334ace
doc coverage fix
xwang233 210444f
Merge remote-tracking branch 'upstream/master' into linalg-runtime-sw…
xwang233 1e8e0f8
remove rocm skip
xwang233 569a6b1
doc and warning message updates
xwang233 6ed5cdc
Merge remote-tracking branch 'upstream/master' into linalg-runtime-sw…
xwang233 6fc8349
Merge remote-tracking branch 'upstream/master' into linalg-runtime-sw…
xwang233 9d06197
move c10/core/LinalgBackend.h to ATen
xwang233 6b432f7
remove jit changes
xwang233 4eaf203
undef linalg macro
xwang233 4faf9f0
revert python_arg_parser changes
xwang233 4114dd2
change py bindings to torch.backends.cuda.linalg.preferred_library
xwang233 e3b532e
Merge remote-tracking branch 'upstream/master' into linalg-runtime-sw…
xwang233 c557133
use pybind11 for py/c++ bindings
xwang233 00c7f0f
Merge remote-tracking branch 'upstream/master' into linalg-runtime-sw…
xwang233 a372948
lint
xwang233 6310698
mypy
xwang233 7446e49
wrap test with a try-finally
xwang233 d6d29dc
Merge remote-tracking branch 'upstream/master' into linalg-runtime-sw…
xwang233 70ebdbe
Merge remote-tracking branch 'upstream/master' into linalg-runtime-sw…
xwang233 3a81c30
change warning message
xwang233 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #pragma once | ||
|
|
||
| #include <c10/util/Exception.h> | ||
|
|
||
| #include <ostream> | ||
| #include <string> | ||
|
|
||
| namespace at { | ||
|
|
||
| enum class LinalgBackend : int8_t { Default, Cusolver, Magma }; | ||
|
|
||
| inline std::string LinalgBackendToString(at::LinalgBackend backend) { | ||
| switch (backend) { | ||
| case LinalgBackend::Default: | ||
| return "at::LinalgBackend::Default"; | ||
| case LinalgBackend::Cusolver: | ||
| return "at::LinalgBackend::Cusolver"; | ||
| case LinalgBackend::Magma: | ||
| return "at::LinalgBackend::Magma"; | ||
| default: | ||
| TORCH_CHECK(false, "Unknown linalg backend"); | ||
| } | ||
| } | ||
|
|
||
| inline std::ostream& operator<<( | ||
| std::ostream& stream, | ||
| at::LinalgBackend backend) { | ||
| return stream << LinalgBackendToString(backend); | ||
| } | ||
|
|
||
| } // namespace c10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.