Skip to content

Commit

Permalink
Fix static linkage of nccl
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarkovtsev committed Feb 4, 2025
1 parent fa2a8de commit 36d984f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .ci/manywheel/build_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ else
USE_RCCL=1
USE_NCCL=1
USE_KINETO=1

pushd third_party/nccl/nccl
mkdir -p headers/include
cd src
BUILDDIR=$(readlink -f ../headers) make $(readlink -f ../headers/include/nccl.h) $(readlink -f ../headers/include/nccl_net.h)
popd
fi

echo "Calling setup.py bdist at $(date)"
Expand Down
11 changes: 5 additions & 6 deletions .ci/manywheel/build_cuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -ex
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P ))"

export TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
export NCCL_ROOT_DIR=/usr/local/cuda
export NCCL_ROOT_DIR=/pytorch/third_party/nccl/nccl/headers
export TH_BINARY_BUILD=1
export USE_STATIC_CUDNN=1
export USE_STATIC_NCCL=1
Expand Down Expand Up @@ -199,8 +199,8 @@ if [[ $CUDA_VERSION == "12.4" || $CUDA_VERSION == "12.6" ]]; then
export ATEN_STATIC_CUDA=0
export USE_CUDA_STATIC_LINK=0
export USE_CUPTI_SO=1
export NCCL_INCLUDE_DIR="/usr/local/cuda/include/"
export NCCL_LIB_DIR="/usr/local/cuda/lib64/"
export NCCL_INCLUDE_DIR="/pytorch/third_party/nccl/nccl/headers/include"
#export NCCL_LIB_DIR="/usr/local/cuda/lib64/"
fi
elif [[ $CUDA_VERSION == "11.8" ]]; then
export USE_STATIC_CUDNN=0
Expand Down Expand Up @@ -255,7 +255,6 @@ elif [[ $CUDA_VERSION == "11.8" ]]; then
'$ORIGIN/../../nvidia/curand/lib'
'$ORIGIN/../../nvidia/cusolver/lib'
'$ORIGIN/../../nvidia/cusparse/lib'
'$ORIGIN/../../nvidia/nccl/lib'
'$ORIGIN/../../nvidia/nvtx/lib'
)
CUDA_RPATHS=$(IFS=: ; echo "${CUDA_RPATHS[*]}")
Expand All @@ -267,8 +266,8 @@ elif [[ $CUDA_VERSION == "11.8" ]]; then
export ATEN_STATIC_CUDA=0
export USE_CUDA_STATIC_LINK=0
export USE_CUPTI_SO=1
export NCCL_INCLUDE_DIR="/usr/local/cuda/include/"
export NCCL_LIB_DIR="/usr/local/cuda/lib64/"
export NCCL_INCLUDE_DIR="/pytorch/third_party/nccl/nccl/headers/include/"
#export NCCL_LIB_DIR="/usr/local/cuda/lib64/"
fi
else
echo "Unknown cuda version $CUDA_VERSION"
Expand Down
2 changes: 1 addition & 1 deletion third_party/nccl/nccl
Submodule nccl updated from ab2b89 to d06aab

0 comments on commit 36d984f

Please sign in to comment.