From 84ce4b2835848e0743a9bee97158437be81ada71 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 00:32:51 +0100 Subject: [PATCH 01/64] initial commit, corrected docker image, rhe8 --- .../workflows/{main.disabled => main.yaml} | 0 scripts/manylinux2014_x86_64/Dockerfile | 56 +++++++++++-------- 2 files changed, 33 insertions(+), 23 deletions(-) rename .github/workflows/{main.disabled => main.yaml} (100%) diff --git a/.github/workflows/main.disabled b/.github/workflows/main.yaml similarity index 100% rename from .github/workflows/main.disabled rename to .github/workflows/main.yaml diff --git a/scripts/manylinux2014_x86_64/Dockerfile b/scripts/manylinux2014_x86_64/Dockerfile index 44891f4..da0b523 100644 --- a/scripts/manylinux2014_x86_64/Dockerfile +++ b/scripts/manylinux2014_x86_64/Dockerfile @@ -1,26 +1,33 @@ -# Use manylinux docker image as a base -FROM quay.io/pypa/manylinux2014_x86_64 +# Use the official manylinux_2_28_x86_64 base image +FROM quay.io/pypa/manylinux_2_28_x86_64 -# ------------ -# Install cuda -# ------------ +# Set environment variable for CUDA version +ARG CUDA_VER="12-4" -ARG VER="12-4" -ARG ARCH="x86_64" +# Install system dependencies and CUDA +RUN yum install -y yum-utils gcc gcc-c++ make zlib-devel bzip2-devel libffi-devel \ + && yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo \ + && yum install -y \ + cuda-compiler-${CUDA_VER} \ + cuda-libraries-${CUDA_VER} \ + cuda-libraries-devel-${CUDA_VER} \ + && yum clean all \ + && rm -rf /var/cache/yum/* \ + && echo "/usr/local/cuda/lib64" >> /etc/ld.so.conf.d/999_nvidia_cuda.conf -RUN yum install -y yum-utils -RUN yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo -RUN yum -y install cuda-compiler-${VER}.${ARCH} \ - cuda-libraries-${VER}.${ARCH} \ - cuda-libraries-devel-${VER}.${ARCH} -RUN yum clean all -RUN rm -rf /var/cache/yum/* -RUN echo "/usr/local/cuda/lib64" >> /etc/ld.so.conf.d/999_nvidia_cuda.conf +# Install Python 3.11 (if available from the repository) +RUN yum install -y python3.11 python3.11-devel -# ------------------------- -# Set environment variables -# ------------------------- +RUN ln -s /usr/bin/python3 /usr/bin/python +# Install pip for Python 3.11 +RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ + && python get-pip.py \ + && rm get-pip.py + +RUN pip install virtualenv + +# Set environment variables for CUDA ENV PATH="/usr/local/cuda/bin:${PATH}" ENV LD_LIBRARY_PATH="/usr/local/cuda/lib64:${LD_LIBRARY_PATH}" ENV CUDA_HOME=/usr/local/cuda @@ -28,9 +35,12 @@ ENV CUDA_ROOT=/usr/local/cuda ENV CUDA_PATH=/usr/local/cuda ENV CUDADIR=/usr/local/cuda -RUN echo "CUDA_HOME: ${CUDA_HOME}" -# -------- -# Commands -# -------- +# Verify the CUDA installation +RUN echo "CUDA_HOME: ${CUDA_HOME}" && \ + nvcc --version + +# Clean up to reduce image size +RUN yum clean all && rm -rf /var/cache/yum/* -CMD ["/bin/bash"] \ No newline at end of file +# Default command (bash) +CMD ["/bin/bash"] From c991e0a3f27efa2c0e3223ee11cfca86f7eabc67 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 11:46:38 +0100 Subject: [PATCH 02/64] initial wheel commit --- scripts/manylinux2014_x86_64/Dockerfile | 19 ++++++++----------- setup.py | 6 ++++++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/scripts/manylinux2014_x86_64/Dockerfile b/scripts/manylinux2014_x86_64/Dockerfile index da0b523..c823e73 100644 --- a/scripts/manylinux2014_x86_64/Dockerfile +++ b/scripts/manylinux2014_x86_64/Dockerfile @@ -15,17 +15,7 @@ RUN yum install -y yum-utils gcc gcc-c++ make zlib-devel bzip2-devel libffi-deve && rm -rf /var/cache/yum/* \ && echo "/usr/local/cuda/lib64" >> /etc/ld.so.conf.d/999_nvidia_cuda.conf -# Install Python 3.11 (if available from the repository) -RUN yum install -y python3.11 python3.11-devel - -RUN ln -s /usr/bin/python3 /usr/bin/python - -# Install pip for Python 3.11 -RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ - && python get-pip.py \ - && rm get-pip.py - -RUN pip install virtualenv +RUN /opt/python/cp311-cp311/bin/python3.11 -m ensurepip --upgrade # Set environment variables for CUDA ENV PATH="/usr/local/cuda/bin:${PATH}" @@ -39,8 +29,15 @@ ENV CUDADIR=/usr/local/cuda RUN echo "CUDA_HOME: ${CUDA_HOME}" && \ nvcc --version +RUN mkdir envs + +RUN /opt/python/cp311-cp311/bin/pip install torch==2.4.0+cu124 --extra-index-url https://download.pytorch.org/whl/cu124 +RUN /opt/python/cp311-cp311/bin/pip install cmake + # Clean up to reduce image size RUN yum clean all && rm -rf /var/cache/yum/* +RUN mkdir /workspace + # Default command (bash) CMD ["/bin/bash"] diff --git a/setup.py b/setup.py index 40063dc..dd1e2ab 100755 --- a/setup.py +++ b/setup.py @@ -82,6 +82,12 @@ def run(self): cmake_options.append(f"-DCMAKE_C_FLAGS={ARCHFLAGS}") cmake_options.append(f"-DCMAKE_CXX_FLAGS={ARCHFLAGS}") + subprocess.run( + ["cmake --version"], + cwd=build_dir, + check=True, + ) + subprocess.run( ["cmake", source_dir, *cmake_options], cwd=build_dir, From ed3e45648d5dcaf1b60e924ed9cdf11845baf7ab Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 11:47:12 +0100 Subject: [PATCH 03/64] x --- scripts/manylinux2014_x86_64/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/manylinux2014_x86_64/Dockerfile b/scripts/manylinux2014_x86_64/Dockerfile index c823e73..245bea3 100644 --- a/scripts/manylinux2014_x86_64/Dockerfile +++ b/scripts/manylinux2014_x86_64/Dockerfile @@ -25,6 +25,8 @@ ENV CUDA_ROOT=/usr/local/cuda ENV CUDA_PATH=/usr/local/cuda ENV CUDADIR=/usr/local/cuda +RUN dnf install git-all + # Verify the CUDA installation RUN echo "CUDA_HOME: ${CUDA_HOME}" && \ nvcc --version From 612f6dc34877f86278313611b909bc185e4dc6a9 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 11:57:28 +0100 Subject: [PATCH 04/64] updates --- scripts/manylinux2014_x86_64/Dockerfile | 17 ++++++++++------- setup.py | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/manylinux2014_x86_64/Dockerfile b/scripts/manylinux2014_x86_64/Dockerfile index 245bea3..b928522 100644 --- a/scripts/manylinux2014_x86_64/Dockerfile +++ b/scripts/manylinux2014_x86_64/Dockerfile @@ -15,7 +15,12 @@ RUN yum install -y yum-utils gcc gcc-c++ make zlib-devel bzip2-devel libffi-deve && rm -rf /var/cache/yum/* \ && echo "/usr/local/cuda/lib64" >> /etc/ld.so.conf.d/999_nvidia_cuda.conf -RUN /opt/python/cp311-cp311/bin/python3.11 -m ensurepip --upgrade +ENV PATH="/opt/python/cp311-cp311/bin:${PATH}" + +RUN rm -f /opt/python/cp311-cp311/bin/python +RUN ln -s /opt/python/cp311-cp311/bin/python3.11 /opt/python/cp311-cp311/bin/python + +RUN python -m ensurepip --upgrade # Set environment variables for CUDA ENV PATH="/usr/local/cuda/bin:${PATH}" @@ -25,21 +30,19 @@ ENV CUDA_ROOT=/usr/local/cuda ENV CUDA_PATH=/usr/local/cuda ENV CUDADIR=/usr/local/cuda -RUN dnf install git-all +RUN yum install -y git-all # Verify the CUDA installation RUN echo "CUDA_HOME: ${CUDA_HOME}" && \ nvcc --version -RUN mkdir envs +RUN pip install torch==2.4.0+cu124 --extra-index-url https://download.pytorch.org/whl/cu124 +RUN pip install numpy cmake -RUN /opt/python/cp311-cp311/bin/pip install torch==2.4.0+cu124 --extra-index-url https://download.pytorch.org/whl/cu124 -RUN /opt/python/cp311-cp311/bin/pip install cmake +RUN mkdir /workspace # Clean up to reduce image size RUN yum clean all && rm -rf /var/cache/yum/* -RUN mkdir /workspace - # Default command (bash) CMD ["/bin/bash"] diff --git a/setup.py b/setup.py index dd1e2ab..afab000 100755 --- a/setup.py +++ b/setup.py @@ -83,7 +83,7 @@ def run(self): cmake_options.append(f"-DCMAKE_CXX_FLAGS={ARCHFLAGS}") subprocess.run( - ["cmake --version"], + ["cmake", "--version"], cwd=build_dir, check=True, ) From 48035f4a78f4722c143554e461720859e384ae51 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 11:59:26 +0100 Subject: [PATCH 05/64] x --- cuda_mace/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index 945bd21..fdb932b 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -18,6 +18,9 @@ else() message(FATAL_ERROR "Could not find CUDA Compiler. Make sure $CUDA_HOME is set.") endif() +execute_process( + COMMAND ${Python_EXECUTABLE} --version +) execute_process( COMMAND ${Python_EXECUTABLE} -c "import torch.utils; print(torch.utils.cmake_prefix_path)" From 3c27d4033303fcdeaf6d306617edd1456b8bc8cc Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 11:59:56 +0100 Subject: [PATCH 06/64] debug --- cuda_mace/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index fdb932b..d3f99cd 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -18,6 +18,10 @@ else() message(FATAL_ERROR "Could not find CUDA Compiler. Make sure $CUDA_HOME is set.") endif() +execute_process( + COMMAND which ${Python_EXECUTABLE} +) + execute_process( COMMAND ${Python_EXECUTABLE} --version ) From 5f68ee210da3b17e24eb8082f7e8650ec7d311ce Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 12:05:02 +0100 Subject: [PATCH 07/64] update sys path --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index afab000..4c43bf7 100755 --- a/setup.py +++ b/setup.py @@ -68,7 +68,7 @@ def run(self): cmake_options = [ f"-DCMAKE_INSTALL_PREFIX={install_dir}" - #f"-DPYTHON_EXECUTABLE={sys.executable}", + f"-DPYTHON_EXECUTABLE={sys.executable}", ] CUDA_HOME = os.environ.get("CUDA_HOME") From d01a10a3367c543e934b70970c829ad09243a6db Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 12:05:41 +0100 Subject: [PATCH 08/64] x --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4c43bf7..11aa171 100755 --- a/setup.py +++ b/setup.py @@ -66,6 +66,8 @@ def run(self): os.makedirs(build_dir, exist_ok=True) + print(sys.executable) + cmake_options = [ f"-DCMAKE_INSTALL_PREFIX={install_dir}" f"-DPYTHON_EXECUTABLE={sys.executable}", @@ -87,7 +89,7 @@ def run(self): cwd=build_dir, check=True, ) - + subprocess.run( ["cmake", source_dir, *cmake_options], cwd=build_dir, From 75cd8ab68f223f4b72b062da011e0e9a65ff46be Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 12:06:16 +0100 Subject: [PATCH 09/64] x --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 11aa171..5e3e1ec 100755 --- a/setup.py +++ b/setup.py @@ -66,7 +66,7 @@ def run(self): os.makedirs(build_dir, exist_ok=True) - print(sys.executable) + print("sys executeable: ", sys.executable) cmake_options = [ f"-DCMAKE_INSTALL_PREFIX={install_dir}" From 1fad10576df40cbc480ddc95d0406dc2919402e8 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 12:11:13 +0100 Subject: [PATCH 10/64] debug --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 5e3e1ec..9e15013 100755 --- a/setup.py +++ b/setup.py @@ -90,6 +90,7 @@ def run(self): check=True, ) + print (["cmake", source_dir, *cmake_options]) subprocess.run( ["cmake", source_dir, *cmake_options], cwd=build_dir, From 93858070a3476af0330a3f47a19c37a324993b2f Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 12:12:35 +0100 Subject: [PATCH 11/64] debug --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 9e15013..7d8c90d 100755 --- a/setup.py +++ b/setup.py @@ -69,7 +69,7 @@ def run(self): print("sys executeable: ", sys.executable) cmake_options = [ - f"-DCMAKE_INSTALL_PREFIX={install_dir}" + f"-DCMAKE_INSTALL_PREFIX={install_dir}", f"-DPYTHON_EXECUTABLE={sys.executable}", ] @@ -90,7 +90,7 @@ def run(self): check=True, ) - print (["cmake", source_dir, *cmake_options]) + print(["cmake", source_dir, *cmake_options]) subprocess.run( ["cmake", source_dir, *cmake_options], cwd=build_dir, From ba71ae9f365b4629e8b83847a7c75fbae3add265 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 12:15:15 +0100 Subject: [PATCH 12/64] x --- cuda_mace/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index d3f99cd..136bb6f 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10) -project(cuda_mace LANGUAGES CXX CUDA) +project(cuda_mace LANGUAGES CXX CUDA Python) set(LIB_INSTALL_DIR "lib" CACHE PATH "Path relative to CMAKE_INSTALL_PREFIX where to install libraries") set(BIN_INSTALL_DIR "bin" CACHE PATH "Path relative to CMAKE_INSTALL_PREFIX where to install DLL/binaries") From 33d06f6eefd5ad5fb44ec0337a5fc63d8d9a8d4b Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 12:15:45 +0100 Subject: [PATCH 13/64] undo --- cuda_mace/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index 136bb6f..d3f99cd 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10) -project(cuda_mace LANGUAGES CXX CUDA Python) +project(cuda_mace LANGUAGES CXX CUDA) set(LIB_INSTALL_DIR "lib" CACHE PATH "Path relative to CMAKE_INSTALL_PREFIX where to install libraries") set(BIN_INSTALL_DIR "bin" CACHE PATH "Path relative to CMAKE_INSTALL_PREFIX where to install DLL/binaries") From 062aa9085a8617df0981629a3bd3568ea149f3a8 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 12:23:47 +0100 Subject: [PATCH 14/64] x --- scripts/manylinux2014_x86_64/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/manylinux2014_x86_64/Dockerfile b/scripts/manylinux2014_x86_64/Dockerfile index b928522..5865583 100644 --- a/scripts/manylinux2014_x86_64/Dockerfile +++ b/scripts/manylinux2014_x86_64/Dockerfile @@ -36,7 +36,7 @@ RUN yum install -y git-all RUN echo "CUDA_HOME: ${CUDA_HOME}" && \ nvcc --version -RUN pip install torch==2.4.0+cu124 --extra-index-url https://download.pytorch.org/whl/cu124 +RUN pip install torch==2.4.1+cu124 --extra-index-url https://download.pytorch.org/whl/cu124 RUN pip install numpy cmake RUN mkdir /workspace From 0cea7c3ffa65954982af1641e64111ddbe6b09e1 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 13:46:34 +0100 Subject: [PATCH 15/64] updated linear with architecture wrappers. --- cuda_mace/cuda/src/linear_wmma_impl.cu | 31 ++++++++++++++++++++++++- scripts/manylinux2014_x86_64/Dockerfile | 4 +--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/cuda_mace/cuda/src/linear_wmma_impl.cu b/cuda_mace/cuda/src/linear_wmma_impl.cu index f434aca..7d806c0 100644 --- a/cuda_mace/cuda/src/linear_wmma_impl.cu +++ b/cuda_mace/cuda/src/linear_wmma_impl.cu @@ -184,6 +184,8 @@ torch::Tensor linear_wmma(torch::Tensor X, torch::Tensor W) { torch::zeros({NNODES, M, N}, torch::TensorOptions().dtype(X.dtype()).device(X.device())); +#ifdef __CUDA_ARCH__ +#if __CUDA_ARCH__ >= 800 dim3 blockDim; blockDim.x = WARP_SIZE; @@ -239,7 +241,18 @@ torch::Tensor linear_wmma(torch::Tensor X, torch::Tensor W) { for (int l = 0; l < streams.size(); l++) { cudaStreamDestroy(streams[l]); } - +#else + TORCH_CHECK( + false, + "This kernel requires a CUDA architecture with compute capability 8.0 or " + "higher. Please ensure you're targeting a compatible architecture."); +#endif +#else + // Runtime error when not compiling for CUDA (i.e., on CPU) + TORCH_CHECK(false, + "This kernel requires a CUDA device with compute capability 8.0 " + "or higher. CPU compilation is not supported."); +#endif return output; } @@ -399,6 +412,9 @@ torch::Tensor elemental_linear_wmma(torch::Tensor X, torch::Tensor W, torch::zeros({NNODES, M, N}, torch::TensorOptions().dtype(X.dtype()).device(X.device())); +#ifdef __CUDA_ARCH__ +#if __CUDA_ARCH__ >= 800 + dim3 blockDim; // blockDim.y = min(8, find_integer_divisor(N, WMMA_N)); @@ -480,5 +496,18 @@ torch::Tensor elemental_linear_wmma(torch::Tensor X, torch::Tensor W, cudaStreamDestroy(streams[l]); } +#else + TORCH_CHECK( + false, + "This kernel requires a CUDA architecture with compute capability 8.0 or " + "higher. Please ensure you're targeting a compatible architecture."); +#endif +#else + // Runtime error when not compiling for CUDA (i.e., on CPU) + TORCH_CHECK(false, + "This kernel requires a CUDA device with compute capability 8.0 " + "or higher. CPU compilation is not supported."); +#endif + return output; } \ No newline at end of file diff --git a/scripts/manylinux2014_x86_64/Dockerfile b/scripts/manylinux2014_x86_64/Dockerfile index 5865583..f4aab9a 100644 --- a/scripts/manylinux2014_x86_64/Dockerfile +++ b/scripts/manylinux2014_x86_64/Dockerfile @@ -8,9 +8,7 @@ ARG CUDA_VER="12-4" RUN yum install -y yum-utils gcc gcc-c++ make zlib-devel bzip2-devel libffi-devel \ && yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo \ && yum install -y \ - cuda-compiler-${CUDA_VER} \ - cuda-libraries-${CUDA_VER} \ - cuda-libraries-devel-${CUDA_VER} \ + cuda-toolkit-${CUDA_VER} \ && yum clean all \ && rm -rf /var/cache/yum/* \ && echo "/usr/local/cuda/lib64" >> /etc/ld.so.conf.d/999_nvidia_cuda.conf From b983b39d814111cad729a0cffc8aada59bc431bf Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 13:54:28 +0100 Subject: [PATCH 16/64] x --- cuda_mace/cuda/src/linear_wmma_impl.cu | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/cuda_mace/cuda/src/linear_wmma_impl.cu b/cuda_mace/cuda/src/linear_wmma_impl.cu index 7d806c0..e87d06e 100644 --- a/cuda_mace/cuda/src/linear_wmma_impl.cu +++ b/cuda_mace/cuda/src/linear_wmma_impl.cu @@ -32,7 +32,7 @@ __global__ void __launch_bounds__(NWARPS *WARP_SIZE) linear_wmma_kernel(const float *__restrict__ X, const float *__restrict__ W, float *__restrict__ OUT, const int NNODES, const uint M, const uint N, const uint K, const uint L) { - +#if __CUDA_ARCH__ >= 800 const uint cCol = blockIdx.y; extern __shared__ char buffer[]; @@ -171,6 +171,7 @@ __global__ void __launch_bounds__(NWARPS *WARP_SIZE) } } } +#endif } torch::Tensor linear_wmma(torch::Tensor X, torch::Tensor W) { @@ -184,8 +185,6 @@ torch::Tensor linear_wmma(torch::Tensor X, torch::Tensor W) { torch::zeros({NNODES, M, N}, torch::TensorOptions().dtype(X.dtype()).device(X.device())); -#ifdef __CUDA_ARCH__ -#if __CUDA_ARCH__ >= 800 dim3 blockDim; blockDim.x = WARP_SIZE; @@ -241,18 +240,7 @@ torch::Tensor linear_wmma(torch::Tensor X, torch::Tensor W) { for (int l = 0; l < streams.size(); l++) { cudaStreamDestroy(streams[l]); } -#else - TORCH_CHECK( - false, - "This kernel requires a CUDA architecture with compute capability 8.0 or " - "higher. Please ensure you're targeting a compatible architecture."); -#endif -#else - // Runtime error when not compiling for CUDA (i.e., on CPU) - TORCH_CHECK(false, - "This kernel requires a CUDA device with compute capability 8.0 " - "or higher. CPU compilation is not supported."); -#endif + return output; } @@ -264,7 +252,7 @@ __global__ void __launch_bounds__(NWARPS *WARP_SIZE) const int64_t element_id, const int64_t nelements, float *__restrict__ OUT, const int NNODES, const uint M, const uint N, const uint K, const uint L) { - +#if __CUDA_ARCH__ >= 800 const uint cCol = blockIdx.y; extern __shared__ char buffer[]; @@ -398,6 +386,7 @@ __global__ void __launch_bounds__(NWARPS *WARP_SIZE) } } } +#endif } torch::Tensor elemental_linear_wmma(torch::Tensor X, torch::Tensor W, From 222fa75f796db701e846a205e778a99d035a54fa Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 13:56:04 +0100 Subject: [PATCH 17/64] remove unecessary ifdef --- cuda_mace/cuda/src/linear_wmma_impl.cu | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/cuda_mace/cuda/src/linear_wmma_impl.cu b/cuda_mace/cuda/src/linear_wmma_impl.cu index e87d06e..708e1da 100644 --- a/cuda_mace/cuda/src/linear_wmma_impl.cu +++ b/cuda_mace/cuda/src/linear_wmma_impl.cu @@ -252,6 +252,7 @@ __global__ void __launch_bounds__(NWARPS *WARP_SIZE) const int64_t element_id, const int64_t nelements, float *__restrict__ OUT, const int NNODES, const uint M, const uint N, const uint K, const uint L) { + #if __CUDA_ARCH__ >= 800 const uint cCol = blockIdx.y; @@ -401,9 +402,6 @@ torch::Tensor elemental_linear_wmma(torch::Tensor X, torch::Tensor W, torch::zeros({NNODES, M, N}, torch::TensorOptions().dtype(X.dtype()).device(X.device())); -#ifdef __CUDA_ARCH__ -#if __CUDA_ARCH__ >= 800 - dim3 blockDim; // blockDim.y = min(8, find_integer_divisor(N, WMMA_N)); @@ -485,18 +483,5 @@ torch::Tensor elemental_linear_wmma(torch::Tensor X, torch::Tensor W, cudaStreamDestroy(streams[l]); } -#else - TORCH_CHECK( - false, - "This kernel requires a CUDA architecture with compute capability 8.0 or " - "higher. Please ensure you're targeting a compatible architecture."); -#endif -#else - // Runtime error when not compiling for CUDA (i.e., on CPU) - TORCH_CHECK(false, - "This kernel requires a CUDA device with compute capability 8.0 " - "or higher. CPU compilation is not supported."); -#endif - return output; } \ No newline at end of file From be53140bc60777c31ea424cb8448db8dbefc1e4e Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 17:58:27 +0100 Subject: [PATCH 18/64] sed --- cuda_mace/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index d3f99cd..a39d042 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -40,8 +40,11 @@ endif() string(STRIP ${TORCH_CMAKE_PATH_OUTPUT} TORCH_CMAKE_PATH_OUTPUT) set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${TORCH_CMAKE_PATH_OUTPUT}") -find_package(Torch 1.13 REQUIRED) +execute_process( + COMMAND "sed -i -E '/^set\(CUDA_(KNOWN|COMMON|ALL)_GPU_ARCHITECTURES/s/\(.*\)/\(\)/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" +) +find_package(Torch 1.13 REQUIRED) #enable relocatable device code (e.g for cuda_utils.cu) set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -rdc=true -lineinfo") From 20dbdc6ae0e70a0834376d8714c7fc67d6fb1968 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 18:00:02 +0100 Subject: [PATCH 19/64] status --- cuda_mace/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index a39d042..0970164 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -40,6 +40,7 @@ endif() string(STRIP ${TORCH_CMAKE_PATH_OUTPUT} TORCH_CMAKE_PATH_OUTPUT) set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${TORCH_CMAKE_PATH_OUTPUT}") +message (STATUS "TORCH_CMAKE_PATH_OUTPUT: ${TORCH_CMAKE_PATH_OUTPUT}") execute_process( COMMAND "sed -i -E '/^set\(CUDA_(KNOWN|COMMON|ALL)_GPU_ARCHITECTURES/s/\(.*\)/\(\)/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" ) From 52996859ba246417f5db44916e4b89160f40cc42 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 18:04:40 +0100 Subject: [PATCH 20/64] status --- cuda_mace/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index 0970164..17375f4 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -38,9 +38,11 @@ message(FATAL_ERROR "failed to find your pytorch installation, error: ${TORCH_CM endif() string(STRIP ${TORCH_CMAKE_PATH_OUTPUT} TORCH_CMAKE_PATH_OUTPUT) + set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${TORCH_CMAKE_PATH_OUTPUT}") message (STATUS "TORCH_CMAKE_PATH_OUTPUT: ${TORCH_CMAKE_PATH_OUTPUT}") + execute_process( COMMAND "sed -i -E '/^set\(CUDA_(KNOWN|COMMON|ALL)_GPU_ARCHITECTURES/s/\(.*\)/\(\)/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" ) From 5cb23bd9a030d588485d4c837a32e4817ce41fbc Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 18:19:33 +0100 Subject: [PATCH 21/64] update --- cuda_mace/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index 17375f4..f631da9 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -43,8 +43,10 @@ set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${TORCH_CMAKE_PATH_OUTPUT}") message (STATUS "TORCH_CMAKE_PATH_OUTPUT: ${TORCH_CMAKE_PATH_OUTPUT}") +# set(CUDA_ALL_GPU_ARCHITECTURES "3.5" "5.0") + execute_process( - COMMAND "sed -i -E '/^set\(CUDA_(KNOWN|COMMON|ALL)_GPU_ARCHITECTURES/s/\(.*\)/\(\)/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" + COMMAND "sed -i -E 's/set\(CUDA_ALL_GPU_ARCHITECTURES "3\.5" "5\.0"\)/set(CUDA_ALL_GPU_ARCHITECTURES "")/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" ) find_package(Torch 1.13 REQUIRED) From 600337d38d5a85530e20afbcf51685a1ea7922dd Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 18:23:39 +0100 Subject: [PATCH 22/64] update mckaelist. --- cuda_mace/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index f631da9..8b25515 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -46,9 +46,10 @@ message (STATUS "TORCH_CMAKE_PATH_OUTPUT: ${TORCH_CMAKE_PATH_OUTPUT}") # set(CUDA_ALL_GPU_ARCHITECTURES "3.5" "5.0") execute_process( - COMMAND "sed -i -E 's/set\(CUDA_ALL_GPU_ARCHITECTURES "3\.5" "5\.0"\)/set(CUDA_ALL_GPU_ARCHITECTURES "")/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" + COMMAND "sed -i -E 's/set\(CUDA_(ALL|COMMON)_GPU_ARCHITECTURES "3\.5" "5\.0"\)/set(CUDA_ALL_GPU_ARCHITECTURES "")/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" ) + find_package(Torch 1.13 REQUIRED) #enable relocatable device code (e.g for cuda_utils.cu) From 9bc9db99c119d794a1bda50a3d4b25fd4fae447b Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 18:27:56 +0100 Subject: [PATCH 23/64] separated findcuda fixes. --- cuda_mace/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index 8b25515..23bc685 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -46,7 +46,11 @@ message (STATUS "TORCH_CMAKE_PATH_OUTPUT: ${TORCH_CMAKE_PATH_OUTPUT}") # set(CUDA_ALL_GPU_ARCHITECTURES "3.5" "5.0") execute_process( - COMMAND "sed -i -E 's/set\(CUDA_(ALL|COMMON)_GPU_ARCHITECTURES "3\.5" "5\.0"\)/set(CUDA_ALL_GPU_ARCHITECTURES "")/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" + COMMAND "sed -i -E 's/set\(CUDA_ALL_GPU_ARCHITECTURES "3\.5" "5\.0"\)/set(CUDA_ALL_GPU_ARCHITECTURES "")/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" +) + +execute_process( + COMMAND "sed -i -E 's/set\(CUDA_COMMON_GPU_ARCHITECTURES "3\.5" "5\.0"\)/set(CUDA_COMMON_GPU_ARCHITECTURES "")/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" ) From 58c9393f3c2cd1926f46deecc92018b4a933aa4d Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 18:32:51 +0100 Subject: [PATCH 24/64] try again --- cuda_mace/CMakeLists.txt | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index 23bc685..5f92353 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -44,15 +44,34 @@ set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${TORCH_CMAKE_PATH_OUTPUT}") message (STATUS "TORCH_CMAKE_PATH_OUTPUT: ${TORCH_CMAKE_PATH_OUTPUT}") # set(CUDA_ALL_GPU_ARCHITECTURES "3.5" "5.0") - +#TORCH_CMAKE_PATH_OUTPUT: /opt/python/cp311-cp311/lib/python3.11/site-packages/torch/share/cmake execute_process( - COMMAND "sed -i -E 's/set\(CUDA_ALL_GPU_ARCHITECTURES "3\.5" "5\.0"\)/set(CUDA_ALL_GPU_ARCHITECTURES "")/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" + COMMAND sed -i -E s/set\\\(CUDA_COMMON_GPU_ARCHITECTURES\ \"3\\.5\"\ \"5\\.0\"\\\)/set\\\(CUDA_COMMON_GPU_ARCHITECTURES\ \"\"\\\)/ ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error ) +if (NOT ${result} EQUAL 0) + message(FATAL_ERROR "Error running sed: ${error}") +else() + message(STATUS "sed command ran successfully.") +endif() + + execute_process( - COMMAND "sed -i -E 's/set\(CUDA_COMMON_GPU_ARCHITECTURES "3\.5" "5\.0"\)/set(CUDA_COMMON_GPU_ARCHITECTURES "")/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" + COMMAND sed -i -E s/set\\\(CUDA_ALL_GPU_ARCHITECTURES\ \"3\\.5\"\ \"5\\.0\"\\\)/set\\\(CUDA_ALL_GPU_ARCHITECTURES\ \"\"\\\)/ ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error ) +if (NOT ${result} EQUAL 0) + message(FATAL_ERROR "Error running sed: ${error}") +else() + message(STATUS "sed command ran successfully.") +endif() + find_package(Torch 1.13 REQUIRED) From 46166f389663adf2451b9e4b4c3f69c81811bc89 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 18:36:47 +0100 Subject: [PATCH 25/64] update --- cuda_mace/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index 5f92353..040296b 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -46,7 +46,7 @@ message (STATUS "TORCH_CMAKE_PATH_OUTPUT: ${TORCH_CMAKE_PATH_OUTPUT}") # set(CUDA_ALL_GPU_ARCHITECTURES "3.5" "5.0") #TORCH_CMAKE_PATH_OUTPUT: /opt/python/cp311-cp311/lib/python3.11/site-packages/torch/share/cmake execute_process( - COMMAND sed -i -E s/set\\\(CUDA_COMMON_GPU_ARCHITECTURES\ \"3\\.5\"\ \"5\\.0\"\\\)/set\\\(CUDA_COMMON_GPU_ARCHITECTURES\ \"\"\\\)/ ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake + COMMAND sh -c "sed -i -E 's/set\\(CUDA_COMMON_GPU_ARCHITECTURES \"3\\.5\" \"5\\.0\"\\)/set(CUDA_COMMON_GPU_ARCHITECTURES \"\")/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" RESULT_VARIABLE result OUTPUT_VARIABLE output ERROR_VARIABLE error @@ -60,7 +60,7 @@ endif() execute_process( - COMMAND sed -i -E s/set\\\(CUDA_ALL_GPU_ARCHITECTURES\ \"3\\.5\"\ \"5\\.0\"\\\)/set\\\(CUDA_ALL_GPU_ARCHITECTURES\ \"\"\\\)/ ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake + COMMAND sh -c "sed -i -E 's/set\\(CUDA_ALL_GPU_ARCHITECTURES \"3\\.5\" \"5\\.0\"\\)/set(CUDA_ALL_GPU_ARCHITECTURES \"\")/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" RESULT_VARIABLE result OUTPUT_VARIABLE output ERROR_VARIABLE error From 5e4715728cb607c08b17e3f6191ad777f9fd21de Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 21:35:36 +0100 Subject: [PATCH 26/64] update with conditional. --- cuda_mace/CMakeLists.txt | 56 +++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index 040296b..841966e 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -43,35 +43,45 @@ set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${TORCH_CMAKE_PATH_OUTPUT}") message (STATUS "TORCH_CMAKE_PATH_OUTPUT: ${TORCH_CMAKE_PATH_OUTPUT}") -# set(CUDA_ALL_GPU_ARCHITECTURES "3.5" "5.0") -#TORCH_CMAKE_PATH_OUTPUT: /opt/python/cp311-cp311/lib/python3.11/site-packages/torch/share/cmake execute_process( - COMMAND sh -c "sed -i -E 's/set\\(CUDA_COMMON_GPU_ARCHITECTURES \"3\\.5\" \"5\\.0\"\\)/set(CUDA_COMMON_GPU_ARCHITECTURES \"\")/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" - RESULT_VARIABLE result - OUTPUT_VARIABLE output - ERROR_VARIABLE error + COMMAND grep -q "set(CUDA_ALL_GPU_ARCHITECTURES \"3.5\" \"5.0\")" + ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake + RESULT_VARIABLE grep_result + OUTPUT_VARIABLE grep_output + ERROR_VARIABLE grep_error ) +# set(CUDA_ALL_GPU_ARCHITECTURES "3.5" "5.0") +#TORCH_CMAKE_PATH_OUTPUT: /opt/python/cp311-cp311/lib/python3.11/site-packages/torch/share/cmake +if (grep_result EQUAL 0) + execute_process( + COMMAND sh -c "sed -i -E 's/set\\(CUDA_COMMON_GPU_ARCHITECTURES \"3\\.5\" \"5\\.0\"\\)/set(CUDA_COMMON_GPU_ARCHITECTURES \"\")/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error + ) + + if (NOT ${result} EQUAL 0) + message(FATAL_ERROR "Error running sed: ${error}") + else() + message(STATUS "sed command ran successfully.") + endif() + + execute_process( + COMMAND sh -c "sed -i -E 's/set\\(CUDA_ALL_GPU_ARCHITECTURES \"3\\.5\" \"5\\.0\"\\)/set(CUDA_ALL_GPU_ARCHITECTURES \"\")/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error + ) + + if (NOT ${result} EQUAL 0) + message(FATAL_ERROR "Error running sed: ${error}") + else() + message(STATUS "sed command ran successfully.") + endif() -if (NOT ${result} EQUAL 0) - message(FATAL_ERROR "Error running sed: ${error}") -else() - message(STATUS "sed command ran successfully.") endif() -execute_process( - COMMAND sh -c "sed -i -E 's/set\\(CUDA_ALL_GPU_ARCHITECTURES \"3\\.5\" \"5\\.0\"\\)/set(CUDA_ALL_GPU_ARCHITECTURES \"\")/' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" - RESULT_VARIABLE result - OUTPUT_VARIABLE output - ERROR_VARIABLE error -) - -if (NOT ${result} EQUAL 0) - message(FATAL_ERROR "Error running sed: ${error}") -else() - message(STATUS "sed command ran successfully.") -endif() - find_package(Torch 1.13 REQUIRED) From 92554276e43dea6dc19fc5ce5e7267f15cee6b3c Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 22:06:18 +0100 Subject: [PATCH 27/64] dockerfile update. --- cuda_mace/CMakeLists.txt | 3 +-- scripts/manylinux2014_x86_64/Dockerfile | 14 +++++++++++--- .../manylinux2014_x86_64/remove_unused_python.sh | 9 +++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 scripts/manylinux2014_x86_64/remove_unused_python.sh diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index 841966e..6e0ec92 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -44,8 +44,7 @@ set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${TORCH_CMAKE_PATH_OUTPUT}") message (STATUS "TORCH_CMAKE_PATH_OUTPUT: ${TORCH_CMAKE_PATH_OUTPUT}") execute_process( - COMMAND grep -q "set(CUDA_ALL_GPU_ARCHITECTURES \"3.5\" \"5.0\")" - ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake + COMMAND sh -c "grep -q 'set(CUDA_ALL_GPU_ARCHITECTURES \"3.5\" \"5.0\")' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" RESULT_VARIABLE grep_result OUTPUT_VARIABLE grep_output ERROR_VARIABLE grep_error diff --git a/scripts/manylinux2014_x86_64/Dockerfile b/scripts/manylinux2014_x86_64/Dockerfile index f4aab9a..9cc00a4 100644 --- a/scripts/manylinux2014_x86_64/Dockerfile +++ b/scripts/manylinux2014_x86_64/Dockerfile @@ -13,10 +13,10 @@ RUN yum install -y yum-utils gcc gcc-c++ make zlib-devel bzip2-devel libffi-deve && rm -rf /var/cache/yum/* \ && echo "/usr/local/cuda/lib64" >> /etc/ld.so.conf.d/999_nvidia_cuda.conf + # Remove all other Python versions ENV PATH="/opt/python/cp311-cp311/bin:${PATH}" -RUN rm -f /opt/python/cp311-cp311/bin/python -RUN ln -s /opt/python/cp311-cp311/bin/python3.11 /opt/python/cp311-cp311/bin/python +RUN ln -sf /opt/python/cp311-cp311/bin/python3.11 /opt/python/cp311-cp311/bin/python RUN python -m ensurepip --upgrade @@ -38,9 +38,17 @@ RUN pip install torch==2.4.1+cu124 --extra-index-url https://download.pytorch.or RUN pip install numpy cmake RUN mkdir /workspace +RUN mkdir /scripts + +# Add the remove_python.sh script to the container +COPY remove_python.sh /scripts/remove_python.sh +# Make the script executable +RUN chmod +x /scripts/remove_python.sh +# Run the script to remove all Python versions except Python 3.11 +RUN /scripts/remove_python.sh python3.11 # Clean up to reduce image size -RUN yum clean all && rm -rf /var/cache/yum/* +#RUN yum clean all && rm -rf /var/cache/yum/* # Default command (bash) CMD ["/bin/bash"] diff --git a/scripts/manylinux2014_x86_64/remove_unused_python.sh b/scripts/manylinux2014_x86_64/remove_unused_python.sh new file mode 100644 index 0000000..30e4c6f --- /dev/null +++ b/scripts/manylinux2014_x86_64/remove_unused_python.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +#FindPython is weird and doesn't respect $PATH or even CMAKE $Python_Exec variables. +for python in /usr/local/bin/python*; do +if [[ "$python" != *"$1"* ]]; then + echo "Removing $python"; + rm -f "$python"; +fi; +done \ No newline at end of file From 5130e0b89b9df0672b2a1d413c09c144184b8094 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Wed, 27 Nov 2024 22:08:15 +0100 Subject: [PATCH 28/64] updates --- scripts/manylinux2014_x86_64/Dockerfile | 1 - .../{remove_unused_python.sh => remove_python.sh} | 0 setup.py | 6 ++---- 3 files changed, 2 insertions(+), 5 deletions(-) rename scripts/manylinux2014_x86_64/{remove_unused_python.sh => remove_python.sh} (100%) diff --git a/scripts/manylinux2014_x86_64/Dockerfile b/scripts/manylinux2014_x86_64/Dockerfile index 9cc00a4..b33f68c 100644 --- a/scripts/manylinux2014_x86_64/Dockerfile +++ b/scripts/manylinux2014_x86_64/Dockerfile @@ -38,7 +38,6 @@ RUN pip install torch==2.4.1+cu124 --extra-index-url https://download.pytorch.or RUN pip install numpy cmake RUN mkdir /workspace -RUN mkdir /scripts # Add the remove_python.sh script to the container COPY remove_python.sh /scripts/remove_python.sh diff --git a/scripts/manylinux2014_x86_64/remove_unused_python.sh b/scripts/manylinux2014_x86_64/remove_python.sh similarity index 100% rename from scripts/manylinux2014_x86_64/remove_unused_python.sh rename to scripts/manylinux2014_x86_64/remove_python.sh diff --git a/setup.py b/setup.py index 7d8c90d..1441d7b 100755 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ __author__ = "Nicholas J. Browning" __credits__ = "Nicholas J. Browning (2023), https://github.com/nickjbrowning" -__license__ = "MIT" +__license__ = "Academic Software License" __version__ = "0.1" __maintainer__ = "Nicholas J. Browning" __email__ = "nickjbrowning@gmail.com" @@ -66,8 +66,6 @@ def run(self): os.makedirs(build_dir, exist_ok=True) - print("sys executeable: ", sys.executable) - cmake_options = [ f"-DCMAKE_INSTALL_PREFIX={install_dir}", f"-DPYTHON_EXECUTABLE={sys.executable}", @@ -90,7 +88,7 @@ def run(self): check=True, ) - print(["cmake", source_dir, *cmake_options]) + print (["cmake", source_dir, *cmake_options]) subprocess.run( ["cmake", source_dir, *cmake_options], cwd=build_dir, From 0f19345a21c66e8ca94a916b61f4f171ca540bc5 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Thu, 28 Nov 2024 00:00:18 +0100 Subject: [PATCH 29/64] some updates. --- .github/workflows/main.yaml | 17 ++++++++++++++--- cuda_mace/CMakeLists.txt | 4 ---- scripts/manylinux2014_x86_64/Dockerfile | 9 ++++----- ...remove_python.sh => remove_unused_python.sh} | 0 4 files changed, 18 insertions(+), 12 deletions(-) rename scripts/manylinux2014_x86_64/{remove_python.sh => remove_unused_python.sh} (100%) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a2cfbb6..a37e93e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -12,9 +12,9 @@ jobs: strategy: matrix: cibw-arch: ["x86_64"] - cibw-python: ['cp312-*'] + cibw-python: ['cp311-*'] python-version: [3.11] - pytorch-version: [2.4.0, 2.5.0] + pytorch-version: [2.4.1] cuda-version: [12.4.0] cuversion: [124] env: @@ -58,7 +58,18 @@ jobs: CUDA_HOME=/usr/local/cuda PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cu${{ matrix.cuversion }} CIBW_REPAIR_WHEEL_COMMAND_LINUX: | - auditwheel repair --exclude libtorch.so --exclude libtorch_cpu.so --exclude libtorch_cuda.so --exclude libc10.so --exclude libc10_cuda.so -w {dest_dir} {wheel} + auditwheel repair \ + --exclude libtorch.so \ + --exclude libcuda.so \ + --exclude libcuda.so.1 \ + --exclude libc10.so \ + --exclude libtorch_cuda.so \ + --exclude libc10_cuda.so \ + --exclude libtorch_cpu.so \ + --exclude libcudart.so \ + --exclude libnvToolsExt.so \ + --exclude libnvrtc.so \ + -w {dest_dir} {wheel} - name: Upload artifacts uses: actions/upload-artifact@v3 diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index 6e0ec92..53e0fba 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -41,8 +41,6 @@ string(STRIP ${TORCH_CMAKE_PATH_OUTPUT} TORCH_CMAKE_PATH_OUTPUT) set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${TORCH_CMAKE_PATH_OUTPUT}") -message (STATUS "TORCH_CMAKE_PATH_OUTPUT: ${TORCH_CMAKE_PATH_OUTPUT}") - execute_process( COMMAND sh -c "grep -q 'set(CUDA_ALL_GPU_ARCHITECTURES \"3.5\" \"5.0\")' ${TORCH_CMAKE_PATH_OUTPUT}/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake" RESULT_VARIABLE grep_result @@ -80,8 +78,6 @@ if (grep_result EQUAL 0) endif() - - find_package(Torch 1.13 REQUIRED) #enable relocatable device code (e.g for cuda_utils.cu) diff --git a/scripts/manylinux2014_x86_64/Dockerfile b/scripts/manylinux2014_x86_64/Dockerfile index b33f68c..2ff716c 100644 --- a/scripts/manylinux2014_x86_64/Dockerfile +++ b/scripts/manylinux2014_x86_64/Dockerfile @@ -1,5 +1,4 @@ -# Use the official manylinux_2_28_x86_64 base image -FROM quay.io/pypa/manylinux_2_28_x86_64 +FROM quay.io/pypa/manylinux2014_x86_64 # Set environment variable for CUDA version ARG CUDA_VER="12-4" @@ -40,11 +39,11 @@ RUN pip install numpy cmake RUN mkdir /workspace # Add the remove_python.sh script to the container -COPY remove_python.sh /scripts/remove_python.sh +COPY remove_unused_python.sh /scripts/remove_unused_python.sh # Make the script executable -RUN chmod +x /scripts/remove_python.sh +RUN chmod +x /scripts/remove_unused_python.sh # Run the script to remove all Python versions except Python 3.11 -RUN /scripts/remove_python.sh python3.11 +RUN /scripts/remove_unused_python.sh python3.11 # Clean up to reduce image size #RUN yum clean all && rm -rf /var/cache/yum/* diff --git a/scripts/manylinux2014_x86_64/remove_python.sh b/scripts/manylinux2014_x86_64/remove_unused_python.sh similarity index 100% rename from scripts/manylinux2014_x86_64/remove_python.sh rename to scripts/manylinux2014_x86_64/remove_unused_python.sh From b732fc217f44aa34688eeba6a714c324af2fb9fc Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Thu, 28 Nov 2024 15:10:27 +0100 Subject: [PATCH 30/64] update --- .github/workflows/main.yaml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a37e93e..64c1975 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -58,18 +58,7 @@ jobs: CUDA_HOME=/usr/local/cuda PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cu${{ matrix.cuversion }} CIBW_REPAIR_WHEEL_COMMAND_LINUX: | - auditwheel repair \ - --exclude libtorch.so \ - --exclude libcuda.so \ - --exclude libcuda.so.1 \ - --exclude libc10.so \ - --exclude libtorch_cuda.so \ - --exclude libc10_cuda.so \ - --exclude libtorch_cpu.so \ - --exclude libcudart.so \ - --exclude libnvToolsExt.so \ - --exclude libnvrtc.so \ - -w {dest_dir} {wheel} + auditwheel repair --exclude libcuda.so --exclude libcuda.so.1 --exclude libc10.so --exclude libtorch_cuda.so --exclude libc10_cuda.so --exclude libtorch_cpu.so --exclude libcudart.so --exclude libnvToolsExt.so --exclude libnvrtc.so -w {dest_dir} {wheel} - name: Upload artifacts uses: actions/upload-artifact@v3 From c458b263b5c94c3cc3586acb8d26ae3103dc8b40 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Sun, 1 Dec 2024 21:41:19 +0100 Subject: [PATCH 31/64] updates. --- .github/workflows/main.yaml | 8 ++++++-- .../src/invariant_message_passing_wrapper.cpp | 4 ++-- .../jit_wrappers/src/symmetric_contraction_wrapper.cpp | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 64c1975..c1372b7 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -44,11 +44,15 @@ jobs: - name: Build wheels run: | + ls -l /usr/local/cuda + echo "CUDA_HOME=$CUDA_HOME" + echo "CIBW_ENVIRONMENT: $CIBW_ENVIRONMENT" echo "Building wheels with CUDA ${{ matrix.cuversion}} and PyTorch ${{ matrix.pytorch-version }}" - python -m cibuildwheel --platform linux . + CUDA_HOME=/usr/local/cuda python -m cibuildwheel --platform linux . mkdir -p dist cp wheelhouse/*.whl dist/ env: + CUDA_HOME: /usr/local/cuda CIBW_BUILD_VERBOSITY: 3 CIBW_BUILD: ${{ matrix.cibw-python }} CIBW_SKIP: "*-musllinux* *-win32 *-manylinux_i686" @@ -58,7 +62,7 @@ jobs: CUDA_HOME=/usr/local/cuda PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cu${{ matrix.cuversion }} CIBW_REPAIR_WHEEL_COMMAND_LINUX: | - auditwheel repair --exclude libcuda.so --exclude libcuda.so.1 --exclude libc10.so --exclude libtorch_cuda.so --exclude libc10_cuda.so --exclude libtorch_cpu.so --exclude libcudart.so --exclude libnvToolsExt.so --exclude libnvrtc.so -w {dest_dir} {wheel} + auditwheel repair --exclude libcuda.so --exclude libcuda.so.1 --exclude libc10.so --exclude libtorch_cuda.so --exclude libc10_cuda.so --exclude libtorch_cpu.so --exclude libcudart.so --exclude libnvToolsExt.so --exclude libnvrtc.so --exclude libnvrtc.so.12 -w {dest_dir} {wheel} - name: Upload artifacts uses: actions/upload-artifact@v3 diff --git a/cuda_mace/jit_wrappers/src/invariant_message_passing_wrapper.cpp b/cuda_mace/jit_wrappers/src/invariant_message_passing_wrapper.cpp index e8b0d95..e0f40df 100644 --- a/cuda_mace/jit_wrappers/src/invariant_message_passing_wrapper.cpp +++ b/cuda_mace/jit_wrappers/src/invariant_message_passing_wrapper.cpp @@ -100,7 +100,7 @@ jit_forward_message_passing(torch::Tensor X, torch::Tensor Y, torch::Tensor radi dim3 bdim(NWARPS_PER_BLOCK * WARP_SIZE, 1, 1); AT_DISPATCH_FLOATING_TYPES( - X.type(), "forward_gpu", + X.scalar_type(), "forward_gpu", ([&] { unsigned int space = 0; void *sptr; @@ -187,7 +187,7 @@ jit_backward_message_passing(torch::Tensor X, torch::Tensor Y, torch::Tensor rad Y, torch::TensorOptions().dtype(Y.dtype()).device(Y.device())); AT_DISPATCH_FLOATING_TYPES( - X.type(), "backward_gpu", ([&] { + X.scalar_type(), "backward_gpu", ([&] { dim3 bdim(NWARPS_PER_BLOCK * WARP_SIZE, 1, 1); dim3 gdim(nnodes, 1); diff --git a/cuda_mace/jit_wrappers/src/symmetric_contraction_wrapper.cpp b/cuda_mace/jit_wrappers/src/symmetric_contraction_wrapper.cpp index b258b6f..c92ee20 100644 --- a/cuda_mace/jit_wrappers/src/symmetric_contraction_wrapper.cpp +++ b/cuda_mace/jit_wrappers/src/symmetric_contraction_wrapper.cpp @@ -66,7 +66,7 @@ std::vector jit_symmetric_contraction_forward( dim3 bdim(WARP_SIZE, NWARPS_PER_BLOCK, 1); AT_DISPATCH_FLOATING_TYPES( - X.type(), "symmetric_contraction_forwards", ([&] { + X.scalar_type(), "symmetric_contraction_forwards", ([&] { unsigned int shared_size = 0; void *sptr = nullptr; @@ -173,7 +173,7 @@ torch::Tensor jit_symmetric_contraction_backward(torch::Tensor gradX, dim3 bdim(WARP_SIZE, 4, 1); AT_DISPATCH_FLOATING_TYPES( - gradX.type(), "symm_contraction_backward", ([&] { + gradX.scalar_type(), "symm_contraction_backward", ([&] { unsigned int space = WARP_SIZE * 16 * sizeof(scalar_t); // buffer_grad storage From f7e3f40064dac641880667cebec8a6b6cdbdffa2 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Sun, 1 Dec 2024 21:50:10 +0100 Subject: [PATCH 32/64] x --- .github/workflows/main.yaml | 4 +++- .gitignore | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c1372b7..29c477c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -44,15 +44,17 @@ jobs: - name: Build wheels run: | + which nvcc ls -l /usr/local/cuda echo "CUDA_HOME=$CUDA_HOME" echo "CIBW_ENVIRONMENT: $CIBW_ENVIRONMENT" echo "Building wheels with CUDA ${{ matrix.cuversion}} and PyTorch ${{ matrix.pytorch-version }}" - CUDA_HOME=/usr/local/cuda python -m cibuildwheel --platform linux . + python -m cibuildwheel --platform linux . mkdir -p dist cp wheelhouse/*.whl dist/ env: CUDA_HOME: /usr/local/cuda + PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cu${{ matrix.cuversion }} CIBW_BUILD_VERBOSITY: 3 CIBW_BUILD: ${{ matrix.cibw-python }} CIBW_SKIP: "*-musllinux* *-win32 *-manylinux_i686" diff --git a/.gitignore b/.gitignore index 1e82c87..c1b4ecf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ build/* local/* tests/* +dist/* *.pyc *.pt .vscode cuda_mace.egg-info/ -*.model \ No newline at end of file +*.model From 8e04dbaec955bcae4743e16575d82a3911fb4433 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Sun, 1 Dec 2024 22:03:40 +0100 Subject: [PATCH 33/64] test --- .github/workflows/main.yaml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 29c477c..428ca85 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Build the custom Manylinux Docker image - name: Build Manylinux Docker Image @@ -43,15 +43,16 @@ jobs: python -m pip install cibuildwheel build - name: Build wheels - run: | - which nvcc - ls -l /usr/local/cuda - echo "CUDA_HOME=$CUDA_HOME" - echo "CIBW_ENVIRONMENT: $CIBW_ENVIRONMENT" - echo "Building wheels with CUDA ${{ matrix.cuversion}} and PyTorch ${{ matrix.pytorch-version }}" - python -m cibuildwheel --platform linux . - mkdir -p dist - cp wheelhouse/*.whl dist/ + uses: pypa/cibuildwheel@v2.22.0 + #run: | + # which nvcc + # ls -l /usr/local/cuda + # echo "CUDA_HOME=$CUDA_HOME" + # echo "CIBW_ENVIRONMENT: $CIBW_ENVIRONMENT" + # echo "Building wheels with CUDA ${{ matrix.cuversion}} and PyTorch ${{ matrix.pytorch-version }}" + # python -m cibuildwheel --platform linux . + # mkdir -p dist + # cp wheelhouse/*.whl dist/ env: CUDA_HOME: /usr/local/cuda PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cu${{ matrix.cuversion }} From f6611d45cf20bde6dd1c231bd9c0603a25055dc0 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Sun, 1 Dec 2024 22:12:56 +0100 Subject: [PATCH 34/64] try no isolation. --- .github/workflows/main.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 428ca85..62dd7a2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -58,6 +58,7 @@ jobs: PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cu${{ matrix.cuversion }} CIBW_BUILD_VERBOSITY: 3 CIBW_BUILD: ${{ matrix.cibw-python }} + CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" CIBW_SKIP: "*-musllinux* *-win32 *-manylinux_i686" CIBW_ARCHS: ${{ matrix.cibw-arch }} CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014_${{ matrix.cibw-arch }} From 230e82c3dd8924c5be3fc67ccc4a7c88af3d91cf Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Sun, 1 Dec 2024 22:21:56 +0100 Subject: [PATCH 35/64] added a print. --- cuda_mace/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index f5c25a9..8dbad6d 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -32,6 +32,8 @@ endif() string(STRIP ${TORCH_CMAKE_PATH_OUTPUT} TORCH_CMAKE_PATH_OUTPUT) +message(STATUS "TORCH_CMAKE_PATH_OUTPUT: ${TORCH_CMAKE_PATH_OUTPUT}") + set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${TORCH_CMAKE_PATH_OUTPUT}") add_library(cuda_mace SHARED From 5091ce2aa935d6630ee13993d5d625be96775301 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Sun, 1 Dec 2024 22:24:12 +0100 Subject: [PATCH 36/64] added torch find --- cuda_mace/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index 8dbad6d..b0c64e3 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -9,6 +9,7 @@ set(BIN_INSTALL_DIR "bin" CACHE PATH "Path relative to CMAKE_INSTALL_PREFIX wher set(INCLUDE_INSTALL_DIR "include" CACHE PATH "Path relative to CMAKE_INSTALL_PREFIX where to install headers") find_package(Python COMPONENTS Interpreter REQUIRED) +find_package(Torch 2.0 REQUIRED) include(CheckLanguage) check_language(CUDA) From 1fe3be020a7171c4b3e52f0bb042624b629544aa Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Sun, 1 Dec 2024 22:25:20 +0100 Subject: [PATCH 37/64] moved find_package --- cuda_mace/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index b0c64e3..95efdae 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -9,7 +9,6 @@ set(BIN_INSTALL_DIR "bin" CACHE PATH "Path relative to CMAKE_INSTALL_PREFIX wher set(INCLUDE_INSTALL_DIR "include" CACHE PATH "Path relative to CMAKE_INSTALL_PREFIX where to install headers") find_package(Python COMPONENTS Interpreter REQUIRED) -find_package(Torch 2.0 REQUIRED) include(CheckLanguage) check_language(CUDA) @@ -31,6 +30,8 @@ if (NOT ${TORCH_CMAKE_PATH_RESULT} EQUAL 0) message(FATAL_ERROR "failed to find your pytorch installation, error: ${TORCH_CMAKE_PATH_ERROR}\n") endif() +find_package(Torch 2.0 REQUIRED) + string(STRIP ${TORCH_CMAKE_PATH_OUTPUT} TORCH_CMAKE_PATH_OUTPUT) message(STATUS "TORCH_CMAKE_PATH_OUTPUT: ${TORCH_CMAKE_PATH_OUTPUT}") From 435b118ae40fab424d7314b08de59ca6633ac9a8 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Sun, 1 Dec 2024 22:32:25 +0100 Subject: [PATCH 38/64] x --- cuda_mace/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index 95efdae..aa37cbd 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -30,11 +30,13 @@ if (NOT ${TORCH_CMAKE_PATH_RESULT} EQUAL 0) message(FATAL_ERROR "failed to find your pytorch installation, error: ${TORCH_CMAKE_PATH_ERROR}\n") endif() +message(STATUS "TORCH_CMAKE_PATH_OUTPUT: ${TORCH_CMAKE_PATH_OUTPUT}") + find_package(Torch 2.0 REQUIRED) string(STRIP ${TORCH_CMAKE_PATH_OUTPUT} TORCH_CMAKE_PATH_OUTPUT) -message(STATUS "TORCH_CMAKE_PATH_OUTPUT: ${TORCH_CMAKE_PATH_OUTPUT}") + set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${TORCH_CMAKE_PATH_OUTPUT}") From 906eb13e453574d886592f99d262d801dc3bb0a2 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Sun, 1 Dec 2024 22:37:58 +0100 Subject: [PATCH 39/64] cmake --- cuda_mace/CMakeLists.txt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index aa37cbd..0d71c1d 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -30,15 +30,12 @@ if (NOT ${TORCH_CMAKE_PATH_RESULT} EQUAL 0) message(FATAL_ERROR "failed to find your pytorch installation, error: ${TORCH_CMAKE_PATH_ERROR}\n") endif() -message(STATUS "TORCH_CMAKE_PATH_OUTPUT: ${TORCH_CMAKE_PATH_OUTPUT}") - -find_package(Torch 2.0 REQUIRED) - string(STRIP ${TORCH_CMAKE_PATH_OUTPUT} TORCH_CMAKE_PATH_OUTPUT) +set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${TORCH_CMAKE_PATH_OUTPUT}") +message(STATUS "TORCH_CMAKE_PATH_OUTPUT: ${TORCH_CMAKE_PATH_OUTPUT}") - -set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${TORCH_CMAKE_PATH_OUTPUT}") +find_package(Torch 2.0 REQUIRED) add_library(cuda_mace SHARED "jit_wrappers/src/cubic_spline_wrapper.cpp" From 522163ce7cea9adcdddf2f021e7496bfb2bd090f Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Sun, 1 Dec 2024 22:48:28 +0100 Subject: [PATCH 40/64] updates --- .github/workflows/main.yaml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 62dd7a2..17c1fa4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -66,7 +66,7 @@ jobs: CUDA_HOME=/usr/local/cuda PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cu${{ matrix.cuversion }} CIBW_REPAIR_WHEEL_COMMAND_LINUX: | - auditwheel repair --exclude libcuda.so --exclude libcuda.so.1 --exclude libc10.so --exclude libtorch_cuda.so --exclude libc10_cuda.so --exclude libtorch_cpu.so --exclude libcudart.so --exclude libnvToolsExt.so --exclude libnvrtc.so --exclude libnvrtc.so.12 -w {dest_dir} {wheel} + auditwheel repair --exclude libcuda.so --exclude libcuda.so.1 --exclude libc10.so --exclude libtorch.so --exclude libtorch_cpu.so --exclude libtorch_cuda.so --exclude libc10_cuda.so --exclude libcudart.so --exclude libnvToolsExt.so --exclude libnvrtc.so --exclude libnvrtc.so.12 -w {dest_dir} {wheel} - name: Upload artifacts uses: actions/upload-artifact@v3 diff --git a/setup.py b/setup.py index 1441d7b..cd724a4 100755 --- a/setup.py +++ b/setup.py @@ -68,7 +68,7 @@ def run(self): cmake_options = [ f"-DCMAKE_INSTALL_PREFIX={install_dir}", - f"-DPYTHON_EXECUTABLE={sys.executable}", + #f"-DPYTHON_EXECUTABLE={sys.executable}", ] CUDA_HOME = os.environ.get("CUDA_HOME") From bc704e748409738613c99cb154e5992a568575da Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Sun, 1 Dec 2024 22:58:19 +0100 Subject: [PATCH 41/64] fixed upload. --- .github/workflows/main.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 17c1fa4..e70e3df 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -67,9 +67,8 @@ jobs: PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cu${{ matrix.cuversion }} CIBW_REPAIR_WHEEL_COMMAND_LINUX: | auditwheel repair --exclude libcuda.so --exclude libcuda.so.1 --exclude libc10.so --exclude libtorch.so --exclude libtorch_cpu.so --exclude libtorch_cuda.so --exclude libc10_cuda.so --exclude libcudart.so --exclude libnvToolsExt.so --exclude libnvrtc.so --exclude libnvrtc.so.12 -w {dest_dir} {wheel} - - - name: Upload artifacts - uses: actions/upload-artifact@v3 + + - uses: actions/upload-artifact@v4 with: - name: wheels - path: dist/ \ No newline at end of file + name: cibw-wheels-${{ matrix.cibw-arch }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl \ No newline at end of file From 91088750cd213a01dbe15198e2456ca1dc1a6312 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Sun, 1 Dec 2024 23:49:52 +0100 Subject: [PATCH 42/64] multiple wheel configs... --- .github/workflows/main.yaml | 47 +++++++++++++------------ scripts/manylinux2014_x86_64/Dockerfile | 19 ++++++---- 2 files changed, 37 insertions(+), 29 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e70e3df..4f10cb8 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -12,22 +12,32 @@ jobs: strategy: matrix: cibw-arch: ["x86_64"] - cibw-python: ['cp311-*'] - python-version: [3.11] - pytorch-version: [2.4.1] - cuda-version: [12.4.0] - cuversion: [124] + cibw-python: ['cp310-*', 'cp311-*', 'cp312-*'] + python-version: [3.10, 3.11] + pytorch-version: [2.4.0, 2.5.0] + cuda-version: [12.1, 12.4] + cuversion: [121, 124] env: - CIBW_SKIP: cp36-* cp37-* cp38-* cp39-* cp310-* - + CIBW_SKIP: cp36-* cp37-* cp38-* cp39-* + steps: - name: Checkout code uses: actions/checkout@v4 + + - name: Github Actions Envs Setup + run: | + CUVERSION=${{matrix.cuda-version}} + CUVERSION=${CUVERSION//.} + echo CUVERSION=${CUVERSION} >> $GITHUB_ENV # Build the custom Manylinux Docker image - name: Build Manylinux Docker Image run: | - docker build --no-cache -t manylinux2014_${{ matrix.cibw-arch }} \ + docker build --no-cache \ + -t manylinux2014_${{ matrix.cibw-arch }} \ + --build-arg PYTHON_VER=${{ matrix.python-version }} \ + --build-arg CUDA_VER=${{ matrix.cuda-version }} + --build-arg PYTORCH_VERSION=${{ matrix.pytorch-version }} \ scripts/manylinux2014_${{ matrix.cibw-arch }} # Set up Python environment @@ -35,7 +45,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - + # Install cibuildwheel and other required tools - name: Install Dependencies run: | @@ -44,31 +54,22 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 - #run: | - # which nvcc - # ls -l /usr/local/cuda - # echo "CUDA_HOME=$CUDA_HOME" - # echo "CIBW_ENVIRONMENT: $CIBW_ENVIRONMENT" - # echo "Building wheels with CUDA ${{ matrix.cuversion}} and PyTorch ${{ matrix.pytorch-version }}" - # python -m cibuildwheel --platform linux . - # mkdir -p dist - # cp wheelhouse/*.whl dist/ env: CUDA_HOME: /usr/local/cuda - PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cu${{ matrix.cuversion }} + PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cu${{ env.CUVERSION }} CIBW_BUILD_VERBOSITY: 3 CIBW_BUILD: ${{ matrix.cibw-python }} CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" CIBW_SKIP: "*-musllinux* *-win32 *-manylinux_i686" CIBW_ARCHS: ${{ matrix.cibw-arch }} CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014_${{ matrix.cibw-arch }} - CIBW_ENVIRONMENT: > - CUDA_HOME=/usr/local/cuda - PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cu${{ matrix.cuversion }} + #CIBW_ENVIRONMENT: > + # CUDA_HOME=/usr/local/cuda + # PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cu${{ matrix.cuda-version.replace('.', '') }} CIBW_REPAIR_WHEEL_COMMAND_LINUX: | auditwheel repair --exclude libcuda.so --exclude libcuda.so.1 --exclude libc10.so --exclude libtorch.so --exclude libtorch_cpu.so --exclude libtorch_cuda.so --exclude libc10_cuda.so --exclude libcudart.so --exclude libnvToolsExt.so --exclude libnvrtc.so --exclude libnvrtc.so.12 -w {dest_dir} {wheel} - uses: actions/upload-artifact@v4 with: - name: cibw-wheels-${{ matrix.cibw-arch }}-${{ strategy.job-index }} + name: "cuda_mace-py-${{ matrix.python-version }}-torch-${{matrix.pytorch-version}}+cu${{ env.CUVERSION }}-${{ matrix.cibw-arch }}" path: ./wheelhouse/*.whl \ No newline at end of file diff --git a/scripts/manylinux2014_x86_64/Dockerfile b/scripts/manylinux2014_x86_64/Dockerfile index 2ff716c..14c2d37 100644 --- a/scripts/manylinux2014_x86_64/Dockerfile +++ b/scripts/manylinux2014_x86_64/Dockerfile @@ -1,7 +1,9 @@ FROM quay.io/pypa/manylinux2014_x86_64 -# Set environment variable for CUDA version -ARG CUDA_VER="12-4" +# Set environment variables for Python and CUDA versions +ARG PYTHON_VER="3.11" +ARG CUDA_VER="12.4" +ARG PYTORCH_VERSION="2.4.1" # Install system dependencies and CUDA RUN yum install -y yum-utils gcc gcc-c++ make zlib-devel bzip2-devel libffi-devel \ @@ -13,9 +15,12 @@ RUN yum install -y yum-utils gcc gcc-c++ make zlib-devel bzip2-devel libffi-deve && echo "/usr/local/cuda/lib64" >> /etc/ld.so.conf.d/999_nvidia_cuda.conf # Remove all other Python versions -ENV PATH="/opt/python/cp311-cp311/bin:${PATH}" +#ENV PATH="/opt/python/cp311-cp311/bin:${PATH}" +#RUN ln -sf /opt/python/cp311-cp311/bin/python3.11 /opt/python/cp311-cp311/bin/python -RUN ln -sf /opt/python/cp311-cp311/bin/python3.11 /opt/python/cp311-cp311/bin/python +# Set Python version environment variables dynamically +ENV PATH="/opt/python/cp${PYTHON_VER//.}-cp${PYTHON_VER//.}/bin:${PATH}" +RUN ln -sf /opt/python/cp${PYTHON_VER//.}-cp${PYTHON_VER//.}/bin/python${PYTHON_VER} /opt/python/cp${PYTHON_VER//.}-cp${PYTHON_VER//.}/bin/python RUN python -m ensurepip --upgrade @@ -33,7 +38,9 @@ RUN yum install -y git-all RUN echo "CUDA_HOME: ${CUDA_HOME}" && \ nvcc --version -RUN pip install torch==2.4.1+cu124 --extra-index-url https://download.pytorch.org/whl/cu124 +#RUN pip install torch==2.4.1+cu124 --extra-index-url https://download.pytorch.org/whl/cu124 +#RUN pip install numpy cmake +RUN pip install torch==${PYTORCH_VERSION}+cu${CUDA_VER//.} --extra-index-url https://download.pytorch.org/whl/cu${CUDA_VER//.} RUN pip install numpy cmake RUN mkdir /workspace @@ -43,7 +50,7 @@ COPY remove_unused_python.sh /scripts/remove_unused_python.sh # Make the script executable RUN chmod +x /scripts/remove_unused_python.sh # Run the script to remove all Python versions except Python 3.11 -RUN /scripts/remove_unused_python.sh python3.11 +RUN /scripts/remove_unused_python.sh python${PYTHON_VER} # Clean up to reduce image size #RUN yum clean all && rm -rf /var/cache/yum/* From 17102bfc0e9f91f44548c34d0db3dcf00bb2e6af Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Sun, 1 Dec 2024 23:50:44 +0100 Subject: [PATCH 43/64] typo. --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4f10cb8..1ef9925 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -36,7 +36,7 @@ jobs: docker build --no-cache \ -t manylinux2014_${{ matrix.cibw-arch }} \ --build-arg PYTHON_VER=${{ matrix.python-version }} \ - --build-arg CUDA_VER=${{ matrix.cuda-version }} + --build-arg CUDA_VER=${{ matrix.cuda-version }} \ --build-arg PYTORCH_VERSION=${{ matrix.pytorch-version }} \ scripts/manylinux2014_${{ matrix.cibw-arch }} From bad52b10dae854551aecf50148c2f4d98870b5fa Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Sun, 1 Dec 2024 23:51:25 +0100 Subject: [PATCH 44/64] offset. --- .github/workflows/main.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1ef9925..89310a5 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -35,10 +35,10 @@ jobs: run: | docker build --no-cache \ -t manylinux2014_${{ matrix.cibw-arch }} \ - --build-arg PYTHON_VER=${{ matrix.python-version }} \ - --build-arg CUDA_VER=${{ matrix.cuda-version }} \ - --build-arg PYTORCH_VERSION=${{ matrix.pytorch-version }} \ - scripts/manylinux2014_${{ matrix.cibw-arch }} + --build-arg PYTHON_VER=${{ matrix.python-version }} \ + --build-arg CUDA_VER=${{ matrix.cuda-version }} \ + --build-arg PYTORCH_VERSION=${{ matrix.pytorch-version }} \ + scripts/manylinux2014_${{ matrix.cibw-arch }} # Set up Python environment - name: Set up Python From ed024c6535aa58507bbadd751c258cb22d5c1c87 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Sun, 1 Dec 2024 23:55:38 +0100 Subject: [PATCH 45/64] fixes. --- .github/workflows/main.yaml | 5 +++++ scripts/manylinux2014_x86_64/Dockerfile | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 89310a5..cff8985 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -29,6 +29,9 @@ jobs: CUVERSION=${{matrix.cuda-version}} CUVERSION=${CUVERSION//.} echo CUVERSION=${CUVERSION} >> $GITHUB_ENV + PYVERSION=${{matrix.python-version}} + PYVERSION=${PYVERSION//.} + echo PYVERSION=${PYVERSION} >> $GITHUB_ENV # Build the custom Manylinux Docker image - name: Build Manylinux Docker Image @@ -36,7 +39,9 @@ jobs: docker build --no-cache \ -t manylinux2014_${{ matrix.cibw-arch }} \ --build-arg PYTHON_VER=${{ matrix.python-version }} \ + --build-arg PY_VER=${{ env.PYVERSION }} \ --build-arg CUDA_VER=${{ matrix.cuda-version }} \ + --build-arg CU_VER=${{ env.CUVERSION }} \ --build-arg PYTORCH_VERSION=${{ matrix.pytorch-version }} \ scripts/manylinux2014_${{ matrix.cibw-arch }} diff --git a/scripts/manylinux2014_x86_64/Dockerfile b/scripts/manylinux2014_x86_64/Dockerfile index 14c2d37..0827d46 100644 --- a/scripts/manylinux2014_x86_64/Dockerfile +++ b/scripts/manylinux2014_x86_64/Dockerfile @@ -2,7 +2,9 @@ FROM quay.io/pypa/manylinux2014_x86_64 # Set environment variables for Python and CUDA versions ARG PYTHON_VER="3.11" +ARG PY_VER="311" ARG CUDA_VER="12.4" +ARG CU_VER="124" ARG PYTORCH_VERSION="2.4.1" # Install system dependencies and CUDA @@ -19,8 +21,8 @@ RUN yum install -y yum-utils gcc gcc-c++ make zlib-devel bzip2-devel libffi-deve #RUN ln -sf /opt/python/cp311-cp311/bin/python3.11 /opt/python/cp311-cp311/bin/python # Set Python version environment variables dynamically -ENV PATH="/opt/python/cp${PYTHON_VER//.}-cp${PYTHON_VER//.}/bin:${PATH}" -RUN ln -sf /opt/python/cp${PYTHON_VER//.}-cp${PYTHON_VER//.}/bin/python${PYTHON_VER} /opt/python/cp${PYTHON_VER//.}-cp${PYTHON_VER//.}/bin/python +ENV PATH="/opt/python/cp${PY_VER}-cp${PY_VER}/bin:${PATH}" +RUN ln -sf /opt/python/cp${PY_VER}-cp${PY_VER}/bin/python${PYTHON_VER} /opt/python/cp${PY_VER}-cp${PY_VER}/bin/python RUN python -m ensurepip --upgrade @@ -40,7 +42,7 @@ RUN echo "CUDA_HOME: ${CUDA_HOME}" && \ #RUN pip install torch==2.4.1+cu124 --extra-index-url https://download.pytorch.org/whl/cu124 #RUN pip install numpy cmake -RUN pip install torch==${PYTORCH_VERSION}+cu${CUDA_VER//.} --extra-index-url https://download.pytorch.org/whl/cu${CUDA_VER//.} +RUN pip install torch==${PYTORCH_VERSION}+cu${CU_VER} --extra-index-url https://download.pytorch.org/whl/cu${CU_VER} RUN pip install numpy cmake RUN mkdir /workspace From 08c64ed6203d389a83a9c5c8bbe7165b8fdb0c54 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 00:00:35 +0100 Subject: [PATCH 46/64] updates. --- .github/workflows/main.yaml | 2 -- scripts/manylinux2014_x86_64/Dockerfile | 14 ++++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cff8985..9e0f2b0 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -39,9 +39,7 @@ jobs: docker build --no-cache \ -t manylinux2014_${{ matrix.cibw-arch }} \ --build-arg PYTHON_VER=${{ matrix.python-version }} \ - --build-arg PY_VER=${{ env.PYVERSION }} \ --build-arg CUDA_VER=${{ matrix.cuda-version }} \ - --build-arg CU_VER=${{ env.CUVERSION }} \ --build-arg PYTORCH_VERSION=${{ matrix.pytorch-version }} \ scripts/manylinux2014_${{ matrix.cibw-arch }} diff --git a/scripts/manylinux2014_x86_64/Dockerfile b/scripts/manylinux2014_x86_64/Dockerfile index 0827d46..88827d2 100644 --- a/scripts/manylinux2014_x86_64/Dockerfile +++ b/scripts/manylinux2014_x86_64/Dockerfile @@ -2,16 +2,18 @@ FROM quay.io/pypa/manylinux2014_x86_64 # Set environment variables for Python and CUDA versions ARG PYTHON_VER="3.11" -ARG PY_VER="311" ARG CUDA_VER="12.4" -ARG CU_VER="124" ARG PYTORCH_VERSION="2.4.1" +RUN CUDA_VER_DASH=${CUDA_VER//./-} +RUN CUDA_VER_NO_DOT=${CUDA_VER//./} +RUN PYTHON_VER_NO_DOT=${PYTHON_VER//./} + # Install system dependencies and CUDA RUN yum install -y yum-utils gcc gcc-c++ make zlib-devel bzip2-devel libffi-devel \ && yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo \ && yum install -y \ - cuda-toolkit-${CUDA_VER} \ + cuda-toolkit-${CUDA_VER_DASH} \ && yum clean all \ && rm -rf /var/cache/yum/* \ && echo "/usr/local/cuda/lib64" >> /etc/ld.so.conf.d/999_nvidia_cuda.conf @@ -21,8 +23,8 @@ RUN yum install -y yum-utils gcc gcc-c++ make zlib-devel bzip2-devel libffi-deve #RUN ln -sf /opt/python/cp311-cp311/bin/python3.11 /opt/python/cp311-cp311/bin/python # Set Python version environment variables dynamically -ENV PATH="/opt/python/cp${PY_VER}-cp${PY_VER}/bin:${PATH}" -RUN ln -sf /opt/python/cp${PY_VER}-cp${PY_VER}/bin/python${PYTHON_VER} /opt/python/cp${PY_VER}-cp${PY_VER}/bin/python +ENV PATH="/opt/python/cp${PYTHON_VER_NO_DOT}-cp${PYTHON_VER_NO_DOT}/bin:${PATH}" +RUN ln -sf /opt/python/cp${PYTHON_VER_NO_DOT}-cp${PYTHON_VER_NO_DOT}/bin/python${PYTHON_VER} /opt/python/cp${PYTHON_VER_NO_DOT}-cp${PYTHON_VER_NO_DOT}/bin/python RUN python -m ensurepip --upgrade @@ -42,7 +44,7 @@ RUN echo "CUDA_HOME: ${CUDA_HOME}" && \ #RUN pip install torch==2.4.1+cu124 --extra-index-url https://download.pytorch.org/whl/cu124 #RUN pip install numpy cmake -RUN pip install torch==${PYTORCH_VERSION}+cu${CU_VER} --extra-index-url https://download.pytorch.org/whl/cu${CU_VER} +RUN pip install torch==${PYTORCH_VERSION}+cu${CUDA_VER_NO_DOT} --extra-index-url https://download.pytorch.org/whl/cu${CUDA_VER_NO_DOT} RUN pip install numpy cmake RUN mkdir /workspace From 32ca0d69b1eeb3c49a8ff4f61387e3299d761089 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 00:04:16 +0100 Subject: [PATCH 47/64] try again. --- scripts/manylinux2014_x86_64/Dockerfile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/manylinux2014_x86_64/Dockerfile b/scripts/manylinux2014_x86_64/Dockerfile index 88827d2..e3d94be 100644 --- a/scripts/manylinux2014_x86_64/Dockerfile +++ b/scripts/manylinux2014_x86_64/Dockerfile @@ -5,9 +5,17 @@ ARG PYTHON_VER="3.11" ARG CUDA_VER="12.4" ARG PYTORCH_VERSION="2.4.1" -RUN CUDA_VER_DASH=${CUDA_VER//./-} -RUN CUDA_VER_NO_DOT=${CUDA_VER//./} -RUN PYTHON_VER_NO_DOT=${PYTHON_VER//./} +RUN CUDA_VER_DASH=${CUDA_VER//./-} && \ + echo "CUDA_VER_DASH=${CUDA_VER_DASH}" >> /etc/environment +ENV CUDA_VER_DASH=${CUDA_VER_DASH} + +RUN CUDA_VER_NO_DOT=${CUDA_VER//./}&& \ +echo "CUDA_VER_NO_DOT=${CUDA_VER_NO_DOT}" >> /etc/environment +ENV CUDA_VER_NO_DOT=${CUDA_VER_NO_DOT} + +RUN PYTHON_VER_NO_DOT=${PYTHON_VER//./}&& \ +echo "PYTHON_VER_NO_DOT=${PYTHON_VER_NO_DOT}" >> /etc/environment +ENV PYTHON_VER_NO_DOT=${PYTHON_VER_NO_DOT} # Install system dependencies and CUDA RUN yum install -y yum-utils gcc gcc-c++ make zlib-devel bzip2-devel libffi-devel \ From acbfc72c39e5d054cdcfb289b3aa95f68d686385 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 00:10:45 +0100 Subject: [PATCH 48/64] try again. --- .github/workflows/main.yaml | 18 +++++++++++++----- scripts/manylinux2014_x86_64/Dockerfile | 15 +++------------ 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9e0f2b0..4548261 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -27,11 +27,16 @@ jobs: - name: Github Actions Envs Setup run: | CUVERSION=${{matrix.cuda-version}} - CUVERSION=${CUVERSION//.} - echo CUVERSION=${CUVERSION} >> $GITHUB_ENV - PYVERSION=${{matrix.python-version}} - PYVERSION=${PYVERSION//.} - echo PYVERSION=${PYVERSION} >> $GITHUB_ENV + PYTHONVERSION=${{matrix.python-version}} + + CU_VERSION_NO_DOT=${CUVERSION//./} + echo CU_VERSION_NO_DOT=${CU_VERSION_NO_DOT} >> $GITHUB_ENV + + CU_VERSION_DASH=${CUVERSION//./-} + echo CU_VERSION_DASH=${CU_VERSION_DASH} >> $GITHUB_ENV + + PYTHON_VER_NO_DOT=${PYTHONVERSION//./} + echo PYTHON_VER_NO_DOT=${PYTHON_VER_NO_DOT} >> $GITHUB_ENV # Build the custom Manylinux Docker image - name: Build Manylinux Docker Image @@ -39,7 +44,10 @@ jobs: docker build --no-cache \ -t manylinux2014_${{ matrix.cibw-arch }} \ --build-arg PYTHON_VER=${{ matrix.python-version }} \ + --build-arg PYTHON_VER_NO_DOT=${{ env.PYTHON_VER_NO_DOT }} \ --build-arg CUDA_VER=${{ matrix.cuda-version }} \ + --build-arg CUDA_VER_NO_DOT=${{ env.CU_VERSION_NO_DOT }} \ + --build-arg CUDA_VER_DASH=${{ env.CU_VERSION_DASH }} \ --build-arg PYTORCH_VERSION=${{ matrix.pytorch-version }} \ scripts/manylinux2014_${{ matrix.cibw-arch }} diff --git a/scripts/manylinux2014_x86_64/Dockerfile b/scripts/manylinux2014_x86_64/Dockerfile index e3d94be..1acb2e2 100644 --- a/scripts/manylinux2014_x86_64/Dockerfile +++ b/scripts/manylinux2014_x86_64/Dockerfile @@ -2,21 +2,12 @@ FROM quay.io/pypa/manylinux2014_x86_64 # Set environment variables for Python and CUDA versions ARG PYTHON_VER="3.11" +ARG PYTHON_VER_NO_DOT="311" ARG CUDA_VER="12.4" +ARG CUDA_VER_NO_DOT="124" +ARG CUDA_VER_DASH="12-4" ARG PYTORCH_VERSION="2.4.1" -RUN CUDA_VER_DASH=${CUDA_VER//./-} && \ - echo "CUDA_VER_DASH=${CUDA_VER_DASH}" >> /etc/environment -ENV CUDA_VER_DASH=${CUDA_VER_DASH} - -RUN CUDA_VER_NO_DOT=${CUDA_VER//./}&& \ -echo "CUDA_VER_NO_DOT=${CUDA_VER_NO_DOT}" >> /etc/environment -ENV CUDA_VER_NO_DOT=${CUDA_VER_NO_DOT} - -RUN PYTHON_VER_NO_DOT=${PYTHON_VER//./}&& \ -echo "PYTHON_VER_NO_DOT=${PYTHON_VER_NO_DOT}" >> /etc/environment -ENV PYTHON_VER_NO_DOT=${PYTHON_VER_NO_DOT} - # Install system dependencies and CUDA RUN yum install -y yum-utils gcc gcc-c++ make zlib-devel bzip2-devel libffi-devel \ && yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo \ From 39e5a87e37152726989dbc4a13e1c7cd6d937098 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 00:11:21 +0100 Subject: [PATCH 49/64] fix. --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4548261..33dc78b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -82,5 +82,5 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: "cuda_mace-py-${{ matrix.python-version }}-torch-${{matrix.pytorch-version}}+cu${{ env.CUVERSION }}-${{ matrix.cibw-arch }}" + name: "cuda_mace-py-${{ env.PYTHON_VER_NO_DOT }}-torch-${{matrix.pytorch-version}}+cu${{ env.CU_VERSION_NO_DOT }}-${{ matrix.cibw-arch }}" path: ./wheelhouse/*.whl \ No newline at end of file From 1200d892fc583d952b9b195f998257adb7551f0d Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 00:13:38 +0100 Subject: [PATCH 50/64] oops... --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 33dc78b..c18e8ea 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -12,7 +12,7 @@ jobs: strategy: matrix: cibw-arch: ["x86_64"] - cibw-python: ['cp310-*', 'cp311-*', 'cp312-*'] + cibw-python: ['cp312-*'] python-version: [3.10, 3.11] pytorch-version: [2.4.0, 2.5.0] cuda-version: [12.1, 12.4] From 1ed20ebfedd6fc911c5a8358991293bbe1a6a7b8 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 00:16:56 +0100 Subject: [PATCH 51/64] possibly remove unuseful python version. --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c18e8ea..82959f6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -12,7 +12,7 @@ jobs: strategy: matrix: cibw-arch: ["x86_64"] - cibw-python: ['cp312-*'] + #cibw-python: ['cp312-*'] python-version: [3.10, 3.11] pytorch-version: [2.4.0, 2.5.0] cuda-version: [12.1, 12.4] From af6998c1bca50489a94e726bb0038f1c5d43d235 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 00:24:06 +0100 Subject: [PATCH 52/64] echo pythonversion. --- scripts/manylinux2014_x86_64/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/manylinux2014_x86_64/Dockerfile b/scripts/manylinux2014_x86_64/Dockerfile index 1acb2e2..182252e 100644 --- a/scripts/manylinux2014_x86_64/Dockerfile +++ b/scripts/manylinux2014_x86_64/Dockerfile @@ -8,6 +8,7 @@ ARG CUDA_VER_NO_DOT="124" ARG CUDA_VER_DASH="12-4" ARG PYTORCH_VERSION="2.4.1" +RUN echo "PYTHON_VERSION: ${PYTHON_VER} NO-DOT: ${PYTHON_VER_NO_DOT}" # Install system dependencies and CUDA RUN yum install -y yum-utils gcc gcc-c++ make zlib-devel bzip2-devel libffi-devel \ && yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo \ From 16bd2f13c2f1e07bcd997ab7aae9ea1a953a832e Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 00:24:21 +0100 Subject: [PATCH 53/64] x --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 82959f6..8c4fcb1 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -26,8 +26,8 @@ jobs: - name: Github Actions Envs Setup run: | - CUVERSION=${{matrix.cuda-version}} - PYTHONVERSION=${{matrix.python-version}} + CUVERSION=${{ matrix.cuda-version }} + PYTHONVERSION=${{ matrix.python-version }} CU_VERSION_NO_DOT=${CUVERSION//./} echo CU_VERSION_NO_DOT=${CU_VERSION_NO_DOT} >> $GITHUB_ENV From 0a6ce00d05d733eac44efb66a0e5086985a6aed8 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 00:31:36 +0100 Subject: [PATCH 54/64] variable expansion --- .github/workflows/main.yaml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8c4fcb1..35c7697 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -26,8 +26,8 @@ jobs: - name: Github Actions Envs Setup run: | - CUVERSION=${{ matrix.cuda-version }} - PYTHONVERSION=${{ matrix.python-version }} + CUVERSION="${{ matrix.cuda-version }}" + PYTHONVERSION="${{ matrix.python-version }}" CU_VERSION_NO_DOT=${CUVERSION//./} echo CU_VERSION_NO_DOT=${CU_VERSION_NO_DOT} >> $GITHUB_ENV @@ -42,20 +42,20 @@ jobs: - name: Build Manylinux Docker Image run: | docker build --no-cache \ - -t manylinux2014_${{ matrix.cibw-arch }} \ - --build-arg PYTHON_VER=${{ matrix.python-version }} \ - --build-arg PYTHON_VER_NO_DOT=${{ env.PYTHON_VER_NO_DOT }} \ - --build-arg CUDA_VER=${{ matrix.cuda-version }} \ - --build-arg CUDA_VER_NO_DOT=${{ env.CU_VERSION_NO_DOT }} \ - --build-arg CUDA_VER_DASH=${{ env.CU_VERSION_DASH }} \ - --build-arg PYTORCH_VERSION=${{ matrix.pytorch-version }} \ - scripts/manylinux2014_${{ matrix.cibw-arch }} + -t manylinux2014_"${{ matrix.cibw-arch }}" \ + --build-arg PYTHON_VER="${{ matrix.python-version }}" \ + --build-arg PYTHON_VER_NO_DOT="${{ env.PYTHON_VER_NO_DOT }}" \ + --build-arg CUDA_VER="${{ matrix.cuda-version }}" \ + --build-arg CUDA_VER_NO_DOT="${{ env.CU_VERSION_NO_DOT }}" \ + --build-arg CUDA_VER_DASH="${{ env.CU_VERSION_DASH }}" \ + --build-arg PYTORCH_VERSION="${{ matrix.pytorch-version }}" \ + scripts/manylinux2014_"${{ matrix.cibw-arch }}" # Set up Python environment - name: Set up Python uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: "${{ matrix.python-version }}" # Install cibuildwheel and other required tools - name: Install Dependencies @@ -67,13 +67,12 @@ jobs: uses: pypa/cibuildwheel@v2.22.0 env: CUDA_HOME: /usr/local/cuda - PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cu${{ env.CUVERSION }} + PIP_EXTRA_INDEX_URL: "https://download.pytorch.org/whl/cu${{ env.CUVERSION }}" CIBW_BUILD_VERBOSITY: 3 - CIBW_BUILD: ${{ matrix.cibw-python }} CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" CIBW_SKIP: "*-musllinux* *-win32 *-manylinux_i686" - CIBW_ARCHS: ${{ matrix.cibw-arch }} - CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014_${{ matrix.cibw-arch }} + CIBW_ARCHS: "${{ matrix.cibw-arch }}" + CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014_${{ matrix.cibw-arch }}" #CIBW_ENVIRONMENT: > # CUDA_HOME=/usr/local/cuda # PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cu${{ matrix.cuda-version.replace('.', '') }} From 1301b50c90dcfb10a8b738fb4c1616dd5b5385ed Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 00:34:29 +0100 Subject: [PATCH 55/64] fixed more substitutions. --- .github/workflows/main.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 35c7697..4180d7f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -13,10 +13,10 @@ jobs: matrix: cibw-arch: ["x86_64"] #cibw-python: ['cp312-*'] - python-version: [3.10, 3.11] - pytorch-version: [2.4.0, 2.5.0] - cuda-version: [12.1, 12.4] - cuversion: [121, 124] + python-version: ["3.10", "3.11"] + pytorch-version: ["2.4.0, 2.5.0"] + cuda-version: ["12.1", "12.4"] + cuversion: ["121", "124"] env: CIBW_SKIP: cp36-* cp37-* cp38-* cp39-* From ae50c1dd86e25df81f62f6640fc6f083c7387fbd Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 00:38:49 +0100 Subject: [PATCH 56/64] typo. --- .github/workflows/main.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4180d7f..0e6428a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -12,11 +12,9 @@ jobs: strategy: matrix: cibw-arch: ["x86_64"] - #cibw-python: ['cp312-*'] python-version: ["3.10", "3.11"] - pytorch-version: ["2.4.0, 2.5.0"] + pytorch-version: ["2.4.0", "2.5.0"] cuda-version: ["12.1", "12.4"] - cuversion: ["121", "124"] env: CIBW_SKIP: cp36-* cp37-* cp38-* cp39-* From d49d5904363713ea8e45b2cc76704054ba6bdf25 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 00:46:36 +0100 Subject: [PATCH 57/64] not sure if I need this. --- .github/workflows/main.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 0e6428a..530da90 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -71,9 +71,9 @@ jobs: CIBW_SKIP: "*-musllinux* *-win32 *-manylinux_i686" CIBW_ARCHS: "${{ matrix.cibw-arch }}" CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014_${{ matrix.cibw-arch }}" - #CIBW_ENVIRONMENT: > - # CUDA_HOME=/usr/local/cuda - # PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cu${{ matrix.cuda-version.replace('.', '') }} + CIBW_ENVIRONMENT: > + CUDA_HOME=/usr/local/cuda + PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cu${{ env.CUVERSION }}" CIBW_REPAIR_WHEEL_COMMAND_LINUX: | auditwheel repair --exclude libcuda.so --exclude libcuda.so.1 --exclude libc10.so --exclude libtorch.so --exclude libtorch_cpu.so --exclude libtorch_cuda.so --exclude libc10_cuda.so --exclude libcudart.so --exclude libnvToolsExt.so --exclude libnvrtc.so --exclude libnvrtc.so.12 -w {dest_dir} {wheel} From ffffddcad5b27e9c11955b93f8946d163d82f463 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 00:59:58 +0100 Subject: [PATCH 58/64] debug messages. --- .github/workflows/main.yaml | 6 ------ cuda_mace/CMakeLists.txt | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 530da90..f859e96 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -55,12 +55,6 @@ jobs: with: python-version: "${{ matrix.python-version }}" - # Install cibuildwheel and other required tools - - name: Install Dependencies - run: | - python -m pip install --upgrade pip - python -m pip install cibuildwheel build - - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 env: diff --git a/cuda_mace/CMakeLists.txt b/cuda_mace/CMakeLists.txt index 0d71c1d..fc533bd 100644 --- a/cuda_mace/CMakeLists.txt +++ b/cuda_mace/CMakeLists.txt @@ -9,6 +9,8 @@ set(BIN_INSTALL_DIR "bin" CACHE PATH "Path relative to CMAKE_INSTALL_PREFIX wher set(INCLUDE_INSTALL_DIR "include" CACHE PATH "Path relative to CMAKE_INSTALL_PREFIX where to install headers") find_package(Python COMPONENTS Interpreter REQUIRED) +message(STATUS "Python Version: ${Python_VERSION}") +message (STATUS "Python Path: ${Python_EXECUTABLE}") include(CheckLanguage) check_language(CUDA) From 2b303de464c1440a58959559e3d6f244058442cd Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 01:47:00 +0100 Subject: [PATCH 59/64] potential fix. --- .github/workflows/main.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f859e96..c7302d0 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -61,6 +61,7 @@ jobs: CUDA_HOME: /usr/local/cuda PIP_EXTRA_INDEX_URL: "https://download.pytorch.org/whl/cu${{ env.CUVERSION }}" CIBW_BUILD_VERBOSITY: 3 + CIBW_BUILD: "cp${{ env.PYTHON_VER_NO_DOT }}-*" CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" CIBW_SKIP: "*-musllinux* *-win32 *-manylinux_i686" CIBW_ARCHS: "${{ matrix.cibw-arch }}" From 32de4b5acc291daddd06f146d62834ecaf2af364 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 11:52:53 +0100 Subject: [PATCH 60/64] removed unecessary env. --- .github/workflows/main.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c7302d0..08e09aa 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -15,8 +15,6 @@ jobs: python-version: ["3.10", "3.11"] pytorch-version: ["2.4.0", "2.5.0"] cuda-version: ["12.1", "12.4"] - env: - CIBW_SKIP: cp36-* cp37-* cp38-* cp39-* steps: - name: Checkout code From 20e2eed178c6231a9927b4ae1a1ae04ee291aa52 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 11:59:47 +0100 Subject: [PATCH 61/64] lets try aarch64... --- .github/workflows/main.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 08e09aa..4afa6e3 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -64,9 +64,9 @@ jobs: CIBW_SKIP: "*-musllinux* *-win32 *-manylinux_i686" CIBW_ARCHS: "${{ matrix.cibw-arch }}" CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014_${{ matrix.cibw-arch }}" - CIBW_ENVIRONMENT: > - CUDA_HOME=/usr/local/cuda - PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cu${{ env.CUVERSION }}" + #CIBW_ENVIRONMENT: > + # CUDA_HOME=/usr/local/cuda + # PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cu${{ env.CUVERSION }}" CIBW_REPAIR_WHEEL_COMMAND_LINUX: | auditwheel repair --exclude libcuda.so --exclude libcuda.so.1 --exclude libc10.so --exclude libtorch.so --exclude libtorch_cpu.so --exclude libtorch_cuda.so --exclude libc10_cuda.so --exclude libcudart.so --exclude libnvToolsExt.so --exclude libnvrtc.so --exclude libnvrtc.so.12 -w {dest_dir} {wheel} From 6e4a03480993ea4e6d2ef2bc32d6599b77b84010 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 12:04:57 +0100 Subject: [PATCH 62/64] update. --- .github/workflows/main.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4afa6e3..99a7b9d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -64,9 +64,6 @@ jobs: CIBW_SKIP: "*-musllinux* *-win32 *-manylinux_i686" CIBW_ARCHS: "${{ matrix.cibw-arch }}" CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014_${{ matrix.cibw-arch }}" - #CIBW_ENVIRONMENT: > - # CUDA_HOME=/usr/local/cuda - # PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cu${{ env.CUVERSION }}" CIBW_REPAIR_WHEEL_COMMAND_LINUX: | auditwheel repair --exclude libcuda.so --exclude libcuda.so.1 --exclude libc10.so --exclude libtorch.so --exclude libtorch_cpu.so --exclude libtorch_cuda.so --exclude libc10_cuda.so --exclude libcudart.so --exclude libnvToolsExt.so --exclude libnvrtc.so --exclude libnvrtc.so.12 -w {dest_dir} {wheel} From c97d64f7db7c13c6ae9f5eb457d56e04b9430721 Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 12:14:24 +0100 Subject: [PATCH 63/64] updates. --- .github/workflows/main.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 99a7b9d..c7302d0 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -15,6 +15,8 @@ jobs: python-version: ["3.10", "3.11"] pytorch-version: ["2.4.0", "2.5.0"] cuda-version: ["12.1", "12.4"] + env: + CIBW_SKIP: cp36-* cp37-* cp38-* cp39-* steps: - name: Checkout code @@ -64,6 +66,9 @@ jobs: CIBW_SKIP: "*-musllinux* *-win32 *-manylinux_i686" CIBW_ARCHS: "${{ matrix.cibw-arch }}" CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014_${{ matrix.cibw-arch }}" + CIBW_ENVIRONMENT: > + CUDA_HOME=/usr/local/cuda + PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cu${{ env.CUVERSION }}" CIBW_REPAIR_WHEEL_COMMAND_LINUX: | auditwheel repair --exclude libcuda.so --exclude libcuda.so.1 --exclude libc10.so --exclude libtorch.so --exclude libtorch_cpu.so --exclude libtorch_cuda.so --exclude libc10_cuda.so --exclude libcudart.so --exclude libnvToolsExt.so --exclude libnvrtc.so --exclude libnvrtc.so.12 -w {dest_dir} {wheel} From d85dc5d0418e06730e7789b0f35155bd2171a74c Mon Sep 17 00:00:00 2001 From: "Nick J. Browning" Date: Mon, 2 Dec 2024 22:05:30 +0100 Subject: [PATCH 64/64] x --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c7302d0..d64dce9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -12,7 +12,7 @@ jobs: strategy: matrix: cibw-arch: ["x86_64"] - python-version: ["3.10", "3.11"] + python-version: ["3.10", "3.11", "3.12"] pytorch-version: ["2.4.0", "2.5.0"] cuda-version: ["12.1", "12.4"] env: