-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix pyg-lib build error caused by MKL
- Loading branch information
1 parent
60a55f6
commit 7c95697
Showing
3 changed files
with
22 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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 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 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,18 @@ | ||
import re | ||
|
||
import torch | ||
|
||
|
||
def compatible_mkl_ver(): | ||
torch_config = torch.__config__.show() | ||
with_mkl_blas = 'BLAS_INFO=mkl' in torch_config | ||
if torch.backends.mkl.is_available() and with_mkl_blas: | ||
product_version = '2023.1.0' | ||
pattern = r'oneAPI Math Kernel Library Version [0-9]{4}\.[0-9]+' | ||
match = re.search(pattern, torch_config) | ||
if match: | ||
product_version = match.group(0).split(' ')[-1] | ||
|
||
return product_version | ||
|
||
return None |