-
Notifications
You must be signed in to change notification settings - Fork 662
[CI] Refactor CI build on GitHub #2723
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
base: main
Are you sure you want to change the base?
Changes from 24 commits
bc22b05
a758953
4c86fb0
b56daa2
a59b6ab
32fafa4
cd7bf8a
7e636cc
f033c8b
df606be
edbc265
2e66d4f
b373a86
8a48eb7
13abe8f
f0714ef
47fa3f1
5e26ea2
68a3c70
8cd53db
d250403
27218da
3949f12
da09ded
b39e385
42c7836
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -251,6 +251,33 @@ def get_cuda_include_dirs() -> Tuple[str, str]: | |||||||||
| ] | ||||||||||
|
|
||||||||||
|
|
||||||||||
| @functools.lru_cache(maxsize=None) | ||||||||||
| def get_cuda_library_dirs() -> Tuple[str, str]: | ||||||||||
| """Returns the CUDA library directory.""" | ||||||||||
|
|
||||||||||
| force_wheels = bool(int(os.getenv("NVTE_BUILD_USE_NVIDIA_WHEELS", "0"))) | ||||||||||
| # If cuda is installed via toolkit, all necessary headers | ||||||||||
| # are bundled inside the top level cuda directory. | ||||||||||
| if not force_wheels and cuda_toolkit_include_path() is not None: | ||||||||||
| return [] | ||||||||||
|
|
||||||||||
| # Use pip wheels to include all headers. | ||||||||||
| try: | ||||||||||
| import nvidia | ||||||||||
| except ModuleNotFoundError as e: | ||||||||||
| raise RuntimeError("CUDA not found.") | ||||||||||
|
|
||||||||||
| if nvidia.__file__ is not None: | ||||||||||
| cuda_root = Path(nvidia.__file__).parent | ||||||||||
| else: | ||||||||||
| cuda_root = Path(nvidia.__path__[0]) # namespace | ||||||||||
| return [ | ||||||||||
| subdir / "lib" | ||||||||||
| for subdir in cuda_root.iterdir() | ||||||||||
| if subdir.is_dir() and (subdir / "lib").is_dir() | ||||||||||
| ] | ||||||||||
|
|
||||||||||
|
|
||||||||||
| @functools.lru_cache(maxsize=None) | ||||||||||
| def cuda_archs() -> str: | ||||||||||
| archs = os.getenv("NVTE_CUDA_ARCHS") | ||||||||||
|
|
@@ -292,6 +319,13 @@ def cuda_version() -> Tuple[int, ...]: | |||||||||
| version_str = get_version("nvidia-cuda-runtime-cu12") | ||||||||||
| version_tuple = tuple(int(part) for part in version_str.split(".") if part.isdigit()) | ||||||||||
| return version_tuple | ||||||||||
| except: | ||||||||||
| pass | ||||||||||
|
Comment on lines
+322
to
+323
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bare The bare
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree with this suggestion |
||||||||||
|
|
||||||||||
| try: | ||||||||||
| version_str = get_version("nvidia-cuda-runtime") | ||||||||||
| version_tuple = tuple(int(part) for part in version_str.split(".") if part.isdigit()) | ||||||||||
| return version_tuple | ||||||||||
| except importlib.metadata.PackageNotFoundError: | ||||||||||
| raise RuntimeError("Could neither find NVCC executable nor CUDA runtime Python package.") | ||||||||||
|
|
||||||||||
|
|
||||||||||
Uh oh!
There was an error while loading. Please reload this page.