Repository navigation
feat(bazel): run the DPC++ device code on NVIDIA GPUs through oneMath #3834
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
Open
Alexandr-Solovev
wants to merge
9
commits into
uxlfoundation:main
Choose a base branch
from
Alexandr-Solovev:dev/asolovev_onemath_nvidia
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3d48971
feat(bazel): run the DPC++ device code on NVIDIA GPUs through oneMath
Alexandr-Solovev 0d1edce
fix(bazel): correct what a real oneMath install exposes
Alexandr-Solovev 430fd77
feat(make): build the oneMath device backend from Make too
Alexandr-Solovev 4b44dc0
fix(onemath): route the PCA syevd flags through the backend alias
Alexandr-Solovev 4b1e49d
feat(onemath): make the oneMath configuration build and run as a whole
Alexandr-Solovev f175ae3
feat(onemath): run the oneMath backend's tests and deselect what it c…
Alexandr-Solovev f387f6d
style(onemath): re-wrap the blas calls clang-format realigns after th…
Alexandr-Solovev 7fcdc29
docs(onemath): record the RNG engines that work and the test-suite re…
Alexandr-Solovev e2c92df
review(onemath): drop the unused runtime staging of the backend libra…
Alexandr-Solovev 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
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
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
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,60 @@ | ||
| /******************************************************************************* | ||
| * Copyright contributors to the oneDAL project | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| *******************************************************************************/ | ||
|
|
||
| #pragma once | ||
|
|
||
| /// Single point where the SYCL math library behind oneDAL's device primitives | ||
| /// is chosen. | ||
| /// | ||
| /// Two libraries implement the same oneMKL DPC++ interface that the BLAS, | ||
| /// LAPACK, sparse BLAS and RNG primitives are written against: | ||
| /// | ||
| /// * oneMKL (`<oneapi/mkl.hpp>`, namespace `oneapi::mkl`) — the default. Its | ||
| /// device backend targets Intel GPUs only. | ||
| /// * oneMath (`<oneapi/math.hpp>`, namespace `oneapi::math`) — the | ||
| /// open-source implementation of the same specification. Besides the Intel | ||
| /// backends it dispatches to cuBLAS, cuSOLVER, cuSPARSE and cuRAND, so the | ||
| /// unmodified oneDAL device sources also run on NVIDIA GPUs once the | ||
| /// compiler is asked for an `nvptx64-nvidia-cuda` target. | ||
| /// | ||
| /// Both are reached through the `oneapi::dal::backend::math` alias, so the | ||
| /// ~150 `mkl::` call sites stay untouched and the decision is made once, at | ||
| /// build time, by defining `ONEDAL_MATH_BACKEND_ONEMATH`. With Bazel that | ||
| /// define arrives from the `@onemath//:onemath_dpc` dependency selected by | ||
| /// `--dpc_math_backend=onemath`. | ||
| /// | ||
| /// This header intentionally contains no oneDAL types, so it can be included | ||
| /// from `dal/detail` as well as from `dal/backend/primitives`. | ||
|
|
||
| #ifdef ONEDAL_DATA_PARALLEL | ||
|
|
||
| #ifdef ONEDAL_MATH_BACKEND_ONEMATH | ||
| #include <oneapi/math.hpp> | ||
| #else | ||
| #include <oneapi/mkl.hpp> | ||
| #endif | ||
|
|
||
| namespace oneapi::dal::backend { | ||
|
|
||
| #ifdef ONEDAL_MATH_BACKEND_ONEMATH | ||
| namespace math = ::oneapi::math; | ||
| #else | ||
| namespace math = ::oneapi::mkl; | ||
| #endif | ||
|
|
||
| } // namespace oneapi::dal::backend | ||
|
|
||
| #endif // ONEDAL_DATA_PARALLEL | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed by the later commits on this branch (0d1edce … 7fcdc29), which validate against a real oneMath build (commit
3273ca2,mklcpu/mklgpubackends) rather than a shim. UnderONEDAL_MATH_BACKEND_ONEMATH,device_engineexposes onlyphilox4x32x10andmrg32k3a. The sparse BLAS primitives andsparse_matrix_handle_implare guarded and throwunimplemented, and the tests that reach them are deselected viate::device_sparse_blas_supported(). No fully qualifiedoneapi::mklcall is left outsidemath_backend.hpp.dev/bazel/README.mdrecords the supported surface (BLAS, LAPACK, 2 of 5 RNG engines, no sparse BLAS).