-
Notifications
You must be signed in to change notification settings - Fork 658
[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
Open
ptrendx
wants to merge
26
commits into
NVIDIA:main
Choose a base branch
from
ptrendx:pr_github_build
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
26 commits
Select commit
Hold shift + click to select a range
bc22b05
Add the new CUDA package to the search for version
ptrendx a758953
Move nccl.h behind the cublasmp guard
ptrendx 4c86fb0
Try pytorch build
ptrendx b56daa2
Fix
ptrendx a59b6ab
Fix
ptrendx 32fafa4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] cd7bf8a
Maybe fix?
ptrendx 7e636cc
Fix
ptrendx f033c8b
Test
ptrendx df606be
Fix
ptrendx edbc265
Fix for cuDNN
ptrendx 2e66d4f
Trying without sccache
ptrendx b373a86
Fix
ptrendx 8a48eb7
Maybe inside a clean container?
ptrendx 13abe8f
Test
ptrendx f0714ef
Add packaging missing dependency and ccache
ptrendx 47fa3f1
Fix
ptrendx 5e26ea2
Changed All
ptrendx 68a3c70
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 8cd53db
Add ccache to jax build
ptrendx d250403
Fixes
ptrendx 27218da
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 3949f12
Fix
ptrendx da09ded
Merge branch 'main' into pr_github_build
ptrendx b39e385
Start of custom containers
ptrendx 42c7836
Test with prebuilt containers
ptrendx 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| FROM ubuntu:24.04 | ||
|
|
||
| # Container dependencies | ||
| RUN apt-get update && apt-get install -y git python3 python3-pip ccache | ||
|
|
||
| ENV PIP_BREAK_SYSTEM_PACKAGES=1 | ||
|
|
||
| # Python build dependencies | ||
| RUN pip install cmake ninja pybind11 numpy packaging | ||
|
|
||
| # PyTorch (CUDA 13.0) | ||
| RUN pip install torch --index-url https://download.pytorch.org/whl/cu130 | ||
|
|
||
| # JAX with CUDA 13 support | ||
| RUN pip install "jax[cuda13]" | ||
|
|
||
| # NVIDIA CUDA toolkit wheels | ||
| RUN pip install \ | ||
| "nvidia-cuda-nvcc<13.1" \ | ||
| "nvidia-cuda-cccl<13.1" \ | ||
| "nvidia-cuda-crt<13.1" \ | ||
| "nvidia-nvvm<13.1" \ | ||
| "nvidia-cuda-profiler-api<13.1" \ | ||
| "nvidia-nvml-dev<13.1" | ||
|
|
||
| # Create symlinks for CUDA libraries | ||
| RUN CUDA_PATH=$(python3 -c "import nvidia; print(list(nvidia.__path__)[0] + '/cu13')") && \ | ||
| ln -s $CUDA_PATH/lib/libcudart.so.13 $CUDA_PATH/lib/libcudart.so && \ | ||
| ln -s $CUDA_PATH/lib/libcublas.so.13 $CUDA_PATH/lib/libcublas.so && \ | ||
| ln -s $CUDA_PATH/../nccl/lib/libnccl.so.2 $CUDA_PATH/../nccl/lib/libnccl.so && \ | ||
| ln -s $CUDA_PATH/lib $CUDA_PATH/lib64 |
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,28 @@ | ||
| FROM ubuntu:24.04 | ||
|
|
||
| # Container dependencies | ||
| RUN apt-get update && apt-get install -y git python3 python3-pip ccache | ||
|
|
||
| ENV PIP_BREAK_SYSTEM_PACKAGES=1 | ||
|
|
||
| # Python build dependencies | ||
| RUN pip install cmake ninja pybind11 numpy packaging | ||
|
|
||
| # PyTorch (CUDA 13.0) | ||
| RUN pip install torch --index-url https://download.pytorch.org/whl/cu130 | ||
|
|
||
| # NVIDIA CUDA toolkit wheels | ||
| RUN pip install \ | ||
| "nvidia-cuda-nvcc<13.1" \ | ||
| "nvidia-cuda-cccl<13.1" \ | ||
| "nvidia-cuda-crt<13.1" \ | ||
| "nvidia-nvvm<13.1" \ | ||
| "nvidia-cuda-profiler-api<13.1" \ | ||
| "nvidia-nvml-dev<13.1" | ||
|
|
||
| # Create symlinks for CUDA libraries | ||
| RUN CUDA_PATH=$(python3 -c "import nvidia; print(list(nvidia.__path__)[0] + '/cu13')") && \ | ||
| ln -s $CUDA_PATH/lib/libcudart.so.13 $CUDA_PATH/lib/libcudart.so && \ | ||
| ln -s $CUDA_PATH/lib/libcublas.so.13 $CUDA_PATH/lib/libcublas.so && \ | ||
| ln -s $CUDA_PATH/../nccl/lib/libnccl.so.2 $CUDA_PATH/../nccl/lib/libnccl.so && \ | ||
| ln -s $CUDA_PATH/lib $CUDA_PATH/lib64 | ||
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 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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 libraries | ||||||||||
| # 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 libraries. | ||||||||||
| 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
|
||||||||||
|
|
||||||||||
| 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.") | ||||||||||
|
|
||||||||||
|
|
||||||||||
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.
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.
Missing
libcudnn.sounversioned symlinkThe symlink block creates unversioned aliases for
libcudart,libcublas, andlibnccl(needed for-lcudart,-lcublas,-lncclat link time), but no equivalent symlink forlibcudnn.so. Thelogging.hheader unconditionally includes<cudnn.h>, and the build links against cudnn. If the cudnn pip wheel (typically pulled in as atorchdependency) only ships a versioned filename such aslibcudnn.so.9, the linker will fail to resolve-lcudnnwithout an unversioned symlink.Consider adding a similar symlink for cudnn, e.g.:
The same applies to
Dockerfile.all.