From 4466bf4b4ae85b5a8c2743debd0861054f9e317f Mon Sep 17 00:00:00 2001 From: Corey Lammie Date: Mon, 15 Sep 2025 16:02:43 +0200 Subject: [PATCH 01/22] Create build-wheels.yml Signed-off-by: PabloCarmona --- .github/workflows/build-wheels.yml | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/build-wheels.yml diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml new file mode 100644 index 00000000..bd4d91d5 --- /dev/null +++ b/.github/workflows/build-wheels.yml @@ -0,0 +1,46 @@ +name: build-wheels + +on: [push, pull_request] + +jobs: + build-and-deploy-linux: + name: Build wheels (manylinux) – ${{ matrix.python-version }} + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.11", "3.13", "pypy3.10"] + services: + docker: + image: docker:20.10.16 + options: --privileged + env: + CIBW_ENVIRONMENT: "TORCH_VERSION_SPECIFIER='==2.3.1+cu121'" + CIBW_BEFORE_BUILD: > + pip install torch==2.3.1+cu121 torchvision + -f https://download.pytorch.org/whl/torch_stable.html + && pip install -r requirements.txt + CIBW_MANYLINUX_X86_64_IMAGE: "aihwkit/manylinux2014_x86_64_aihwkit_cuda" + CIBW_REPAIR_WHEEL_COMMAND: > + auditwheel repair -w {dest_dir} {wheel} --exclude libtorch_python.so + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Pull manylinux image + run: docker pull $CIBW_MANYLINUX_X86_64_IMAGE + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==2.23.3 + + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + + - name: Upload wheels (per version) + uses: actions/upload-artifact@v4 + with: + name: wheels-${{ matrix.python-version }} + path: wheelhouse/*.whl From d698b11bca9229babc5ffcb17aa74a7246c2a1df Mon Sep 17 00:00:00 2001 From: Corey Lammie Date: Mon, 15 Sep 2025 16:38:10 +0200 Subject: [PATCH 02/22] Update build-wheels.yml Signed-off-by: PabloCarmona --- .github/workflows/build-wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index bd4d91d5..04175ee5 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.11", "3.13", "pypy3.10"] + python-version: ["3.12"] services: docker: image: docker:20.10.16 @@ -19,7 +19,7 @@ jobs: pip install torch==2.3.1+cu121 torchvision -f https://download.pytorch.org/whl/torch_stable.html && pip install -r requirements.txt - CIBW_MANYLINUX_X86_64_IMAGE: "aihwkit/manylinux2014_x86_64_aihwkit_cuda" + CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux2014_x86_64-cuda12.1" CIBW_REPAIR_WHEEL_COMMAND: > auditwheel repair -w {dest_dir} {wheel} --exclude libtorch_python.so steps: From 335605c001497b9fd047ff5b812fea9e7b33940b Mon Sep 17 00:00:00 2001 From: Corey Lammie Date: Mon, 15 Sep 2025 16:41:12 +0200 Subject: [PATCH 03/22] Update build-wheels.yml Signed-off-by: PabloCarmona --- .github/workflows/build-wheels.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 04175ee5..b1e550c7 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -14,12 +14,10 @@ jobs: image: docker:20.10.16 options: --privileged env: - CIBW_ENVIRONMENT: "TORCH_VERSION_SPECIFIER='==2.3.1+cu121'" CIBW_BEFORE_BUILD: > - pip install torch==2.3.1+cu121 torchvision - -f https://download.pytorch.org/whl/torch_stable.html + pip install torch torchvision && pip install -r requirements.txt - CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux2014_x86_64-cuda12.1" + CIBW_MANYLINUX_X86_64_IMAGE: "sameli/manylinux_2_34_x86_64_cuda_12.8" CIBW_REPAIR_WHEEL_COMMAND: > auditwheel repair -w {dest_dir} {wheel} --exclude libtorch_python.so steps: From e5e9af64f46c6d72a41de596d275764d420507be Mon Sep 17 00:00:00 2001 From: Corey Lammie Date: Mon, 15 Sep 2025 16:48:03 +0200 Subject: [PATCH 04/22] Update build-wheels.yml Signed-off-by: PabloCarmona --- .github/workflows/build-wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index b1e550c7..1d1da96e 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -14,6 +14,7 @@ jobs: image: docker:20.10.16 options: --privileged env: + CIBW_BUILD: "cp312-manylinux_x86_64" CIBW_BEFORE_BUILD: > pip install torch torchvision && pip install -r requirements.txt From 244dac412b0aa8a337b47043d9ec2d72ec049162 Mon Sep 17 00:00:00 2001 From: Corey Lammie Date: Mon, 15 Sep 2025 16:54:56 +0200 Subject: [PATCH 05/22] Update build-wheels.yml Signed-off-by: PabloCarmona --- .github/workflows/build-wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 1d1da96e..4d0f4077 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -16,9 +16,9 @@ jobs: env: CIBW_BUILD: "cp312-manylinux_x86_64" CIBW_BEFORE_BUILD: > - pip install torch torchvision + pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu && pip install -r requirements.txt - CIBW_MANYLINUX_X86_64_IMAGE: "sameli/manylinux_2_34_x86_64_cuda_12.8" + CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux2014_x86_64" CIBW_REPAIR_WHEEL_COMMAND: > auditwheel repair -w {dest_dir} {wheel} --exclude libtorch_python.so steps: From 8102b733a7199ce1433f19282ee5da21020118d0 Mon Sep 17 00:00:00 2001 From: Corey Lammie Date: Mon, 15 Sep 2025 16:59:12 +0200 Subject: [PATCH 06/22] Update build-wheels.yml Signed-off-by: PabloCarmona --- .github/workflows/build-wheels.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 4d0f4077..91abd0a8 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -15,6 +15,8 @@ jobs: options: --privileged env: CIBW_BUILD: "cp312-manylinux_x86_64" + CIBW_BEFORE_ALL: > + yum install -y openblas-devel CIBW_BEFORE_BUILD: > pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu && pip install -r requirements.txt From b277fcc7716fc47871da26077697633fe2b42010 Mon Sep 17 00:00:00 2001 From: Corey Lammie Date: Mon, 15 Sep 2025 17:13:37 +0200 Subject: [PATCH 07/22] Update build-wheels.yml Signed-off-by: PabloCarmona --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 91abd0a8..f796651a 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -18,7 +18,7 @@ jobs: CIBW_BEFORE_ALL: > yum install -y openblas-devel CIBW_BEFORE_BUILD: > - pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu + pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 && pip install -r requirements.txt CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux2014_x86_64" CIBW_REPAIR_WHEEL_COMMAND: > From 5a294cd24991782677b3a5d3a7d317c00a95558f Mon Sep 17 00:00:00 2001 From: Pablo Carmona Gonzalez Date: Wed, 17 Sep 2025 19:53:10 +0200 Subject: [PATCH 08/22] add build for cuda Signed-off-by: PabloCarmona --- .github/workflows/build-wheels-cuda.yml | 47 +++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/build-wheels-cuda.yml diff --git a/.github/workflows/build-wheels-cuda.yml b/.github/workflows/build-wheels-cuda.yml new file mode 100644 index 00000000..6805fa1d --- /dev/null +++ b/.github/workflows/build-wheels-cuda.yml @@ -0,0 +1,47 @@ +name: build-wheels-cuda + +on: [push, pull_request] + +jobs: + build-and-deploy-linux: + name: Build wheels (manylinux) - ${{ matrix.python-version }} + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.12"] + services: + docker: + image: docker:20.10.16 + options: --privileged + env: + CIBW_BUILD: "cp312-manylinux_x86_64" + CIBW_BEFORE_ALL: > + yum install -y openblas-devel + CIBW_BEFORE_BUILD: > + pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu128 + && pip install -r requirements.txt + CIBW_MANYLINUX_X86_64_IMAGE: "aihwkit/manylinux2014_x86_64_aihwkit_cuda" + CIBW_REPAIR_WHEEL_COMMAND: > + auditwheel repair -w {dest_dir} {wheel} --exclude libtorch_python.so + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Pull manylinux image + run: docker pull $CIBW_MANYLINUX_X86_64_IMAGE + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==2.23.3 + + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + + - name: Upload wheels (per version) + uses: actions/upload-artifact@v4 + with: + name: wheels-${{ matrix.python-version }} + path: wheelhouse/*.whl From 3d52bb65a179d95d3964af1d62072cd6ee90bcf2 Mon Sep 17 00:00:00 2001 From: Pablo Carmona Gonzalez Date: Wed, 17 Sep 2025 20:03:26 +0200 Subject: [PATCH 09/22] remove blas install Signed-off-by: PabloCarmona --- .github/workflows/build-wheels-cuda.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-wheels-cuda.yml b/.github/workflows/build-wheels-cuda.yml index 6805fa1d..6671da5e 100644 --- a/.github/workflows/build-wheels-cuda.yml +++ b/.github/workflows/build-wheels-cuda.yml @@ -15,8 +15,6 @@ jobs: options: --privileged env: CIBW_BUILD: "cp312-manylinux_x86_64" - CIBW_BEFORE_ALL: > - yum install -y openblas-devel CIBW_BEFORE_BUILD: > pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu128 && pip install -r requirements.txt From e1ad40395698f4467cf2185698c19a920860b893 Mon Sep 17 00:00:00 2001 From: Pablo Carmona Gonzalez Date: Wed, 17 Sep 2025 20:16:25 +0200 Subject: [PATCH 10/22] change torch version Signed-off-by: PabloCarmona --- .github/workflows/build-wheels-cuda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels-cuda.yml b/.github/workflows/build-wheels-cuda.yml index 6671da5e..e4fd5ea8 100644 --- a/.github/workflows/build-wheels-cuda.yml +++ b/.github/workflows/build-wheels-cuda.yml @@ -16,7 +16,7 @@ jobs: env: CIBW_BUILD: "cp312-manylinux_x86_64" CIBW_BEFORE_BUILD: > - pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu128 + conda install pytorch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 pytorch-cuda=12.1 -c pytorch -c nvidia && pip install -r requirements.txt CIBW_MANYLINUX_X86_64_IMAGE: "aihwkit/manylinux2014_x86_64_aihwkit_cuda" CIBW_REPAIR_WHEEL_COMMAND: > From 5330979e3c227dab657dbd34443c634177292508 Mon Sep 17 00:00:00 2001 From: Pablo Carmona Gonzalez Date: Wed, 17 Sep 2025 20:22:46 +0200 Subject: [PATCH 11/22] change torch version Signed-off-by: PabloCarmona --- .github/workflows/build-wheels-cuda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels-cuda.yml b/.github/workflows/build-wheels-cuda.yml index e4fd5ea8..c8c69521 100644 --- a/.github/workflows/build-wheels-cuda.yml +++ b/.github/workflows/build-wheels-cuda.yml @@ -16,7 +16,7 @@ jobs: env: CIBW_BUILD: "cp312-manylinux_x86_64" CIBW_BEFORE_BUILD: > - conda install pytorch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 pytorch-cuda=12.1 -c pytorch -c nvidia + pip install torch==2.3.1+cu121 torchvision -f https://download.pytorch.org/whl/torch_stable.html && pip install -r requirements.txt CIBW_MANYLINUX_X86_64_IMAGE: "aihwkit/manylinux2014_x86_64_aihwkit_cuda" CIBW_REPAIR_WHEEL_COMMAND: > From e7ebdcae349ea1d925d776c4f21fc0014319c91e Mon Sep 17 00:00:00 2001 From: Pablo Carmona Gonzalez Date: Wed, 17 Sep 2025 20:36:03 +0200 Subject: [PATCH 12/22] remove torch version for cpu and add openblas-devel for gpu Signed-off-by: PabloCarmona --- .github/workflows/build-wheels-cuda.yml | 2 ++ .github/workflows/build-wheels.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels-cuda.yml b/.github/workflows/build-wheels-cuda.yml index c8c69521..14227f8c 100644 --- a/.github/workflows/build-wheels-cuda.yml +++ b/.github/workflows/build-wheels-cuda.yml @@ -15,6 +15,8 @@ jobs: options: --privileged env: CIBW_BUILD: "cp312-manylinux_x86_64" + CIBW_BEFORE_ALL: > + yum install -y openblas-devel CIBW_BEFORE_BUILD: > pip install torch==2.3.1+cu121 torchvision -f https://download.pytorch.org/whl/torch_stable.html && pip install -r requirements.txt diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index f796651a..91abd0a8 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -18,7 +18,7 @@ jobs: CIBW_BEFORE_ALL: > yum install -y openblas-devel CIBW_BEFORE_BUILD: > - pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 + pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu && pip install -r requirements.txt CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux2014_x86_64" CIBW_REPAIR_WHEEL_COMMAND: > From 11ff800b4adb6220e7e04d0cf9a3a8eb1c2754da Mon Sep 17 00:00:00 2001 From: Pablo Carmona Gonzalez Date: Wed, 17 Sep 2025 20:51:47 +0200 Subject: [PATCH 13/22] update before all to match image repo Signed-off-by: PabloCarmona --- .github/workflows/build-wheels-cuda.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels-cuda.yml b/.github/workflows/build-wheels-cuda.yml index 14227f8c..1098756b 100644 --- a/.github/workflows/build-wheels-cuda.yml +++ b/.github/workflows/build-wheels-cuda.yml @@ -16,7 +16,9 @@ jobs: env: CIBW_BUILD: "cp312-manylinux_x86_64" CIBW_BEFORE_ALL: > - yum install -y openblas-devel + sudo apt-get update + sudo apt-get install -y libopenblas-dev gcc-9 g++-9 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 CIBW_BEFORE_BUILD: > pip install torch==2.3.1+cu121 torchvision -f https://download.pytorch.org/whl/torch_stable.html && pip install -r requirements.txt From 90daffc2af04fa70a94ada96e05d2be6e82d086e Mon Sep 17 00:00:00 2001 From: Pablo Carmona Gonzalez Date: Wed, 17 Sep 2025 21:01:34 +0200 Subject: [PATCH 14/22] fix before all command Signed-off-by: PabloCarmona --- .github/workflows/build-wheels-cuda.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels-cuda.yml b/.github/workflows/build-wheels-cuda.yml index 1098756b..fadaf9f7 100644 --- a/.github/workflows/build-wheels-cuda.yml +++ b/.github/workflows/build-wheels-cuda.yml @@ -17,8 +17,8 @@ jobs: CIBW_BUILD: "cp312-manylinux_x86_64" CIBW_BEFORE_ALL: > sudo apt-get update - sudo apt-get install -y libopenblas-dev gcc-9 g++-9 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 + && sudo apt-get install -y libopenblas-dev gcc-9 g++-9 + && sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 CIBW_BEFORE_BUILD: > pip install torch==2.3.1+cu121 torchvision -f https://download.pytorch.org/whl/torch_stable.html && pip install -r requirements.txt From ee06188b738e1ef63619865da27dc00b6c128014 Mon Sep 17 00:00:00 2001 From: Pablo Carmona Gonzalez Date: Wed, 17 Sep 2025 21:11:19 +0200 Subject: [PATCH 15/22] install only blas and gcc Signed-off-by: PabloCarmona --- .github/workflows/build-wheels-cuda.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-wheels-cuda.yml b/.github/workflows/build-wheels-cuda.yml index fadaf9f7..b9196a52 100644 --- a/.github/workflows/build-wheels-cuda.yml +++ b/.github/workflows/build-wheels-cuda.yml @@ -16,9 +16,7 @@ jobs: env: CIBW_BUILD: "cp312-manylinux_x86_64" CIBW_BEFORE_ALL: > - sudo apt-get update - && sudo apt-get install -y libopenblas-dev gcc-9 g++-9 - && sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 + sudo apt-get install -y libopenblas-dev gcc-9 g++-9 CIBW_BEFORE_BUILD: > pip install torch==2.3.1+cu121 torchvision -f https://download.pytorch.org/whl/torch_stable.html && pip install -r requirements.txt From 81c32ff4322a34d331a6171acaad8f093094d5fc Mon Sep 17 00:00:00 2001 From: Pablo Carmona Gonzalez Date: Wed, 17 Sep 2025 21:20:14 +0200 Subject: [PATCH 16/22] remove sudo Signed-off-by: PabloCarmona --- .github/workflows/build-wheels-cuda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels-cuda.yml b/.github/workflows/build-wheels-cuda.yml index b9196a52..d4c31202 100644 --- a/.github/workflows/build-wheels-cuda.yml +++ b/.github/workflows/build-wheels-cuda.yml @@ -16,7 +16,7 @@ jobs: env: CIBW_BUILD: "cp312-manylinux_x86_64" CIBW_BEFORE_ALL: > - sudo apt-get install -y libopenblas-dev gcc-9 g++-9 + apt-get install -y libopenblas-dev gcc-9 g++-9 CIBW_BEFORE_BUILD: > pip install torch==2.3.1+cu121 torchvision -f https://download.pytorch.org/whl/torch_stable.html && pip install -r requirements.txt From b5edeaef39743125776f24bd1b6b108b32dc1e31 Mon Sep 17 00:00:00 2001 From: Pablo Carmona Gonzalez Date: Thu, 18 Sep 2025 17:31:08 +0200 Subject: [PATCH 17/22] update before all to setup cuda env Signed-off-by: PabloCarmona --- .github/workflows/build-wheels-cuda.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels-cuda.yml b/.github/workflows/build-wheels-cuda.yml index d4c31202..7b1afc8c 100644 --- a/.github/workflows/build-wheels-cuda.yml +++ b/.github/workflows/build-wheels-cuda.yml @@ -16,11 +16,16 @@ jobs: env: CIBW_BUILD: "cp312-manylinux_x86_64" CIBW_BEFORE_ALL: > - apt-get install -y libopenblas-dev gcc-9 g++-9 + yum install -y openblas-devel gtest wget yum-utils && \ + wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && \ + rpm -i cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && \ + yum clean all && \ + yum -y install nvidia-driver-latest-dkms && \ + yum -y install cuda CIBW_BEFORE_BUILD: > pip install torch==2.3.1+cu121 torchvision -f https://download.pytorch.org/whl/torch_stable.html && pip install -r requirements.txt - CIBW_MANYLINUX_X86_64_IMAGE: "aihwkit/manylinux2014_x86_64_aihwkit_cuda" + CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux2014_x86_64" CIBW_REPAIR_WHEEL_COMMAND: > auditwheel repair -w {dest_dir} {wheel} --exclude libtorch_python.so steps: From 781d4c693b2b4af4d8a4a5ec404bac46061a2a91 Mon Sep 17 00:00:00 2001 From: Pablo Carmona Gonzalez Date: Thu, 18 Sep 2025 17:37:43 +0200 Subject: [PATCH 18/22] change to one line Signed-off-by: PabloCarmona --- .github/workflows/build-wheels-cuda.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/build-wheels-cuda.yml b/.github/workflows/build-wheels-cuda.yml index 7b1afc8c..2ba4eab6 100644 --- a/.github/workflows/build-wheels-cuda.yml +++ b/.github/workflows/build-wheels-cuda.yml @@ -16,12 +16,7 @@ jobs: env: CIBW_BUILD: "cp312-manylinux_x86_64" CIBW_BEFORE_ALL: > - yum install -y openblas-devel gtest wget yum-utils && \ - wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && \ - rpm -i cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && \ - yum clean all && \ - yum -y install nvidia-driver-latest-dkms && \ - yum -y install cuda + yum install -y openblas-devel gtest wget yum-utils && wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && rpm -i cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && yum clean all && yum -y install nvidia-driver-latest-dkms && yum -y install cuda CIBW_BEFORE_BUILD: > pip install torch==2.3.1+cu121 torchvision -f https://download.pytorch.org/whl/torch_stable.html && pip install -r requirements.txt From 320b544e37b069e5ae1a27cd0218307af4a6d811 Mon Sep 17 00:00:00 2001 From: Pablo Carmona Gonzalez Date: Thu, 18 Sep 2025 18:05:25 +0200 Subject: [PATCH 19/22] modify and add more setup and clean up for optimized space Signed-off-by: PabloCarmona --- .github/workflows/build-wheels-cuda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels-cuda.yml b/.github/workflows/build-wheels-cuda.yml index 2ba4eab6..1fa2df80 100644 --- a/.github/workflows/build-wheels-cuda.yml +++ b/.github/workflows/build-wheels-cuda.yml @@ -16,7 +16,7 @@ jobs: env: CIBW_BUILD: "cp312-manylinux_x86_64" CIBW_BEFORE_ALL: > - yum install -y openblas-devel gtest wget yum-utils && wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && rpm -i cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && yum clean all && yum -y install nvidia-driver-latest-dkms && yum -y install cuda + yum install -y openblas-devel gtest wget yum-utils && wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && rpm -i cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && yum clean all && yum -y install cuda-compiler-12-1 cuda-libraries-12-1 && yum clean all && rm -rf /var/cache/yum && export PATH "$PATH:/usr/local/cuda-12.1/bin" && export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda-12.1/lib64" CIBW_BEFORE_BUILD: > pip install torch==2.3.1+cu121 torchvision -f https://download.pytorch.org/whl/torch_stable.html && pip install -r requirements.txt From 4810d2f1c95270e35a32740583195a1c09c5c899 Mon Sep 17 00:00:00 2001 From: Pablo Carmona Gonzalez Date: Thu, 18 Sep 2025 18:18:08 +0200 Subject: [PATCH 20/22] remove exports Signed-off-by: PabloCarmona --- .github/workflows/build-wheels-cuda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels-cuda.yml b/.github/workflows/build-wheels-cuda.yml index 1fa2df80..c524d85c 100644 --- a/.github/workflows/build-wheels-cuda.yml +++ b/.github/workflows/build-wheels-cuda.yml @@ -16,7 +16,7 @@ jobs: env: CIBW_BUILD: "cp312-manylinux_x86_64" CIBW_BEFORE_ALL: > - yum install -y openblas-devel gtest wget yum-utils && wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && rpm -i cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && yum clean all && yum -y install cuda-compiler-12-1 cuda-libraries-12-1 && yum clean all && rm -rf /var/cache/yum && export PATH "$PATH:/usr/local/cuda-12.1/bin" && export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda-12.1/lib64" + yum install -y openblas-devel gtest wget yum-utils && wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && rpm -i cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && yum clean all && yum -y install cuda-compiler-12-1 cuda-libraries-12-1 && yum clean all && rm -rf /var/cache/yum CIBW_BEFORE_BUILD: > pip install torch==2.3.1+cu121 torchvision -f https://download.pytorch.org/whl/torch_stable.html && pip install -r requirements.txt From d2d8e5f4e2fd8e318e17f9cc5b35eddb09b2f440 Mon Sep 17 00:00:00 2001 From: Pablo Carmona Gonzalez Date: Thu, 18 Sep 2025 18:33:14 +0200 Subject: [PATCH 21/22] add version specifier and clean up rpm file Signed-off-by: PabloCarmona --- .github/workflows/build-wheels-cuda.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels-cuda.yml b/.github/workflows/build-wheels-cuda.yml index c524d85c..7f6ce507 100644 --- a/.github/workflows/build-wheels-cuda.yml +++ b/.github/workflows/build-wheels-cuda.yml @@ -14,9 +14,10 @@ jobs: image: docker:20.10.16 options: --privileged env: + CIBW_ENVIRONMENT: "TORCH_VERSION_SPECIFIER='==2.3.1+cu121'" CIBW_BUILD: "cp312-manylinux_x86_64" CIBW_BEFORE_ALL: > - yum install -y openblas-devel gtest wget yum-utils && wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && rpm -i cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && yum clean all && yum -y install cuda-compiler-12-1 cuda-libraries-12-1 && yum clean all && rm -rf /var/cache/yum + yum install -y openblas-devel gtest wget yum-utils && wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && rpm -i cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && yum clean all && yum -y install cuda-compiler-12-1 cuda-libraries-12-1 && yum clean all && rm -rf /var/cache/yum && rm -f rm -f cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm CIBW_BEFORE_BUILD: > pip install torch==2.3.1+cu121 torchvision -f https://download.pytorch.org/whl/torch_stable.html && pip install -r requirements.txt From cf4587e93396d6666b5c6695635f5cecaf094fc7 Mon Sep 17 00:00:00 2001 From: PabloCarmona Date: Wed, 24 Sep 2025 13:55:01 +0200 Subject: [PATCH 22/22] remove cuda workflow and fixed latest torch version for cpu on tag push Signed-off-by: PabloCarmona --- .github/workflows/build-wheels-cuda.yml | 48 ------------------------- .github/workflows/build-wheels.yml | 7 ++-- 2 files changed, 5 insertions(+), 50 deletions(-) delete mode 100644 .github/workflows/build-wheels-cuda.yml diff --git a/.github/workflows/build-wheels-cuda.yml b/.github/workflows/build-wheels-cuda.yml deleted file mode 100644 index 7f6ce507..00000000 --- a/.github/workflows/build-wheels-cuda.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: build-wheels-cuda - -on: [push, pull_request] - -jobs: - build-and-deploy-linux: - name: Build wheels (manylinux) - ${{ matrix.python-version }} - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.12"] - services: - docker: - image: docker:20.10.16 - options: --privileged - env: - CIBW_ENVIRONMENT: "TORCH_VERSION_SPECIFIER='==2.3.1+cu121'" - CIBW_BUILD: "cp312-manylinux_x86_64" - CIBW_BEFORE_ALL: > - yum install -y openblas-devel gtest wget yum-utils && wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && rpm -i cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm && yum clean all && yum -y install cuda-compiler-12-1 cuda-libraries-12-1 && yum clean all && rm -rf /var/cache/yum && rm -f rm -f cuda-repo-rhel7-12-1-local-12.1.1_530.30.02-1.x86_64.rpm - CIBW_BEFORE_BUILD: > - pip install torch==2.3.1+cu121 torchvision -f https://download.pytorch.org/whl/torch_stable.html - && pip install -r requirements.txt - CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux2014_x86_64" - CIBW_REPAIR_WHEEL_COMMAND: > - auditwheel repair -w {dest_dir} {wheel} --exclude libtorch_python.so - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Pull manylinux image - run: docker pull $CIBW_MANYLINUX_X86_64_IMAGE - - - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.23.3 - - - name: Build wheels - run: python -m cibuildwheel --output-dir wheelhouse - - - name: Upload wheels (per version) - uses: actions/upload-artifact@v4 - with: - name: wheels-${{ matrix.python-version }} - path: wheelhouse/*.whl diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 91abd0a8..9899b640 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -1,6 +1,9 @@ name: build-wheels -on: [push, pull_request] +on: + push: + tags: + - 'v**' jobs: build-and-deploy-linux: @@ -18,7 +21,7 @@ jobs: CIBW_BEFORE_ALL: > yum install -y openblas-devel CIBW_BEFORE_BUILD: > - pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu + pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cpu && pip install -r requirements.txt CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux2014_x86_64" CIBW_REPAIR_WHEEL_COMMAND: >