From 26879406d5aca53361eb8369e6400e7d8621bcc9 Mon Sep 17 00:00:00 2001 From: baptiste Date: Tue, 17 Sep 2024 11:29:42 +0000 Subject: [PATCH 01/25] fix broken cuda image --- docker/cuda/Dockerfile | 1 + scripts/install_quantization_libs.py | 24 ------------------------ 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/docker/cuda/Dockerfile b/docker/cuda/Dockerfile index fa43fa49..0ac20763 100644 --- a/docker/cuda/Dockerfile +++ b/docker/cuda/Dockerfile @@ -41,6 +41,7 @@ fi # Install quantization libraries from source ENV CUDA_VERSION=12.4 ENV TORCH_CUDA_ARCH_LIST="6.0 7.0 7.5 8.0 8.6 9.0+PTX" +ENV CUDA_HOME=/usr/local/cuda COPY scripts/install_quantization_libs.py /internal/install_quantization_libs.py RUN python internal/install_quantization_libs.py --install-autogptq-from-source --install-autoawq-from-source diff --git a/scripts/install_quantization_libs.py b/scripts/install_quantization_libs.py index 9feebbc1..2d3c427d 100644 --- a/scripts/install_quantization_libs.py +++ b/scripts/install_quantization_libs.py @@ -1,29 +1,11 @@ import argparse import os -import re import subprocess import sys EXTERNAL_REPOS_DIR = "external_repos" -def process_setup_file(setup_file_path): - with open(setup_file_path, "r") as file: - setup_content = file.read() - - # Use a regular expression to remove any line containing "torch==" - setup_content = re.sub(r'"torch==[^\"]+",', "", setup_content) - - # Set IS_CPU_ONLY to False - setup_content = setup_content.replace( - "IS_CPU_ONLY = not torch.backends.mps.is_available() and not torch.cuda.is_available()", "IS_CPU_ONLY = False" - ) - - # Write the modified content back to setup.py - with open(setup_file_path, "w") as file: - file.write(setup_content) - - def clone_or_pull_repo(repo_url, repo_location_path): """Clone the repo if it doesn't exist; otherwise, pull the latest changes.""" if os.path.exists(repo_location_path): @@ -46,8 +28,6 @@ def install_autoawq_from_source(): kernels_repo_path = os.path.join(EXTERNAL_REPOS_DIR, autoawq_kernels_repo_name) clone_or_pull_repo(f"https://github.com/casper-hansen/{autoawq_kernels_repo_name}", kernels_repo_path) - kernels_setup_file_path = os.path.join(kernels_repo_path, "setup.py") - process_setup_file(kernels_setup_file_path) subprocess.run( f"cd {kernels_repo_path} && {sys.executable} -m pip install .", shell=True, @@ -56,8 +36,6 @@ def install_autoawq_from_source(): ) clone_or_pull_repo(f"https://github.com/casper-hansen/{autoawq_repo_name}", autoawq_repo_path) - autoawq_setup_file_path = os.path.join(autoawq_repo_path, "setup.py") - process_setup_file(autoawq_setup_file_path) subprocess.run( f"cd {autoawq_repo_path} && {sys.executable} -m pip install .", shell=True, @@ -75,8 +53,6 @@ def install_autogptq_from_source(): clone_or_pull_repo("https://github.com/PanQiWei/AutoGPTQ.git", autogptq_repo_path) subprocess.run("pip install numpy gekko pandas", shell=True, check=True, env=os.environ) - autogptq_setup_file_path = os.path.join(autogptq_repo_path, "setup.py") - process_setup_file(autogptq_setup_file_path) subprocess.run( f"cd {autogptq_repo_path} && {sys.executable} -m pip install .", shell=True, From 15fd7a8d3bdc3a65b73176d6e4fd48aa3fac35da Mon Sep 17 00:00:00 2001 From: baptiste Date: Tue, 17 Sep 2024 12:00:04 +0000 Subject: [PATCH 02/25] fix broken cuda image --- docker/cuda/Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docker/cuda/Dockerfile b/docker/cuda/Dockerfile index 0ac20763..4413e17f 100644 --- a/docker/cuda/Dockerfile +++ b/docker/cuda/Dockerfile @@ -28,20 +28,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Install PyTorch ARG TORCH_CUDA=cu124 -ARG TORCH_VERSION=stable +ARG TORCH_RELEASE_TYPE=stable -RUN if [ "${TORCH_VERSION}" = "stable" ]; then \ +RUN if [ "${TORCH_RELEASE_TYPE}" = "stable" ]; then \ pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ -elif [ "${TORCH_VERSION}" = "nighly" ]; then \ +elif [ "${TORCH_RELEASE_TYPE}" = "nighly" ]; then \ pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ else \ - pip install --no-cache-dir torch==${TORCH_VERSION} torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ + echo "Error: Invalid TORCH_RELEASE_TYPE. Must be 'stable' or 'nightly'." && exit 1 ; \ fi # Install quantization libraries from source ENV CUDA_VERSION=12.4 ENV TORCH_CUDA_ARCH_LIST="6.0 7.0 7.5 8.0 8.6 9.0+PTX" -ENV CUDA_HOME=/usr/local/cuda COPY scripts/install_quantization_libs.py /internal/install_quantization_libs.py RUN python internal/install_quantization_libs.py --install-autogptq-from-source --install-autoawq-from-source From b909619f1ac1ef1f4ba0d666780f6e98ab05596f Mon Sep 17 00:00:00 2001 From: baptiste Date: Tue, 17 Sep 2024 13:11:48 +0000 Subject: [PATCH 03/25] fix broken cuda image --- docker/cuda/Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docker/cuda/Dockerfile b/docker/cuda/Dockerfile index 4413e17f..a3bbd34e 100644 --- a/docker/cuda/Dockerfile +++ b/docker/cuda/Dockerfile @@ -29,13 +29,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Install PyTorch ARG TORCH_CUDA=cu124 ARG TORCH_RELEASE_TYPE=stable +ARG TORCH_VERSION -RUN if [ "${TORCH_RELEASE_TYPE}" = "stable" ]; then \ +RUN if [ -n "${TORCH_VERSION}" ]; then \ + # Install specific torch version if TORCH_VERSION is provided + pip install --no-cache-dir torch==${TORCH_VERSION} torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ +elif [ "${TORCH_RELEASE_TYPE}" = "stable" ]; then \ pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ -elif [ "${TORCH_RELEASE_TYPE}" = "nighly" ]; then \ +elif [ "${TORCH_RELEASE_TYPE}" = "nightly" ]; then \ pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ else \ - echo "Error: Invalid TORCH_RELEASE_TYPE. Must be 'stable' or 'nightly'." && exit 1 ; \ + echo "Error: Invalid PYTORCH_RELEASE_TYPE. Must be 'stable', 'nightly', or specify a TORCH_VERSION." && exit 1 ; \ fi # Install quantization libraries from source From 8fb8de9b7999671308e19646e878e35c8496fcde Mon Sep 17 00:00:00 2001 From: baptiste Date: Tue, 17 Sep 2024 13:21:29 +0000 Subject: [PATCH 04/25] fix broken cuda image --- docker/cuda/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/cuda/Dockerfile b/docker/cuda/Dockerfile index a3bbd34e..9fed4bae 100644 --- a/docker/cuda/Dockerfile +++ b/docker/cuda/Dockerfile @@ -35,7 +35,7 @@ RUN if [ -n "${TORCH_VERSION}" ]; then \ # Install specific torch version if TORCH_VERSION is provided pip install --no-cache-dir torch==${TORCH_VERSION} torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ elif [ "${TORCH_RELEASE_TYPE}" = "stable" ]; then \ - pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ + pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/${TORCH_CUDA} ; \ elif [ "${TORCH_RELEASE_TYPE}" = "nightly" ]; then \ pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ else \ From 9d6e9a5c4990543b143abe0fcf27528cd212c08e Mon Sep 17 00:00:00 2001 From: baptiste Date: Tue, 17 Sep 2024 17:43:51 +0000 Subject: [PATCH 05/25] fix rocm dockerfile --- docker/cuda/Dockerfile | 2 +- docker/rocm/Dockerfile | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/docker/cuda/Dockerfile b/docker/cuda/Dockerfile index 9fed4bae..17dec2e3 100644 --- a/docker/cuda/Dockerfile +++ b/docker/cuda/Dockerfile @@ -39,7 +39,7 @@ elif [ "${TORCH_RELEASE_TYPE}" = "stable" ]; then \ elif [ "${TORCH_RELEASE_TYPE}" = "nightly" ]; then \ pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ else \ - echo "Error: Invalid PYTORCH_RELEASE_TYPE. Must be 'stable', 'nightly', or specify a TORCH_VERSION." && exit 1 ; \ + echo "Error: Invalid TORCH_RELEASE_TYPE. Must be 'stable', 'nightly', or specify a TORCH_VERSION." && exit 1 ; \ fi # Install quantization libraries from source diff --git a/docker/rocm/Dockerfile b/docker/rocm/Dockerfile index 611d058a..49577eac 100644 --- a/docker/rocm/Dockerfile +++ b/docker/rocm/Dockerfile @@ -31,16 +31,19 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-reco # Install PyTorch ARG TORCH_ROCM=rocm5.7 -ARG TORCH_VERSION=stable +ARG TORCH_RELEASE_TYPE=stable +ARG TORCH_VERSION -RUN if [ "${TORCH_VERSION}" = "stable" ]; then \ - pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_ROCM} ; \ -elif [ "${TORCH_VERSION}" = "nightly" ]; then \ - pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/${TORCH_ROCM} ; \ -else \ +RUN if [ -n "${TORCH_VERSION}" ]; then \ + # Install specific torch version if TORCH_VERSION is provided pip install --no-cache-dir torch==${TORCH_VERSION} torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_ROCM} ; \ +elif [ "${TORCH_RELEASE_TYPE}" = "stable" ]; then \ + pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/${TORCH_ROCM} ; \ +elif [ "${TORCH_RELEASE_TYPE}" = "nightly" ]; then \ + pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_ROCM} ; \ +else \ + echo "Error: Invalid TORCH_RELEASE_TYPE. Must be 'stable', 'nightly', or specify a TORCH_VERSION." && exit 1 ; \ fi - # Install quantization libraries from source ENV ROCM_VERSION=5.7 ENV PYTORCH_ROCM_ARCH="gfx900;gfx906;gfx908;gfx90a;gfx1030;gfx1100" From b827db76611a4957946d67d0169656461e9a6577 Mon Sep 17 00:00:00 2001 From: baptiste Date: Wed, 18 Sep 2024 08:27:21 +0000 Subject: [PATCH 06/25] fix autoawq install --- optimum_benchmark/hub_utils.py | 2 +- scripts/install_quantization_libs.py | 24 +++--------------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/optimum_benchmark/hub_utils.py b/optimum_benchmark/hub_utils.py index 01c21c3f..16b3f9e5 100644 --- a/optimum_benchmark/hub_utils.py +++ b/optimum_benchmark/hub_utils.py @@ -9,7 +9,7 @@ import pandas as pd from flatten_dict import flatten, unflatten from huggingface_hub import create_repo, hf_hub_download, upload_file -from huggingface_hub.utils._errors import HfHubHTTPError +from huggingface_hub.utils import HfHubHTTPError from typing_extensions import Self LOGGER = getLogger("hub_utils") diff --git a/scripts/install_quantization_libs.py b/scripts/install_quantization_libs.py index 2d3c427d..3be69452 100644 --- a/scripts/install_quantization_libs.py +++ b/scripts/install_quantization_libs.py @@ -18,32 +18,14 @@ def clone_or_pull_repo(repo_url, repo_location_path): def install_autoawq_from_source(): - """Install the AutoAWQ and AutoAWQ_kernels packages from GitHub.""" - print("Installing AutoAWQ and AutoAWQ_kernels packages.") - - autoawq_repo_name = "AutoAWQ" - autoawq_kernels_repo_name = "AutoAWQ_kernels" - - autoawq_repo_path = os.path.join(EXTERNAL_REPOS_DIR, autoawq_repo_name) - kernels_repo_path = os.path.join(EXTERNAL_REPOS_DIR, autoawq_kernels_repo_name) - - clone_or_pull_repo(f"https://github.com/casper-hansen/{autoawq_kernels_repo_name}", kernels_repo_path) - subprocess.run( - f"cd {kernels_repo_path} && {sys.executable} -m pip install .", - shell=True, - check=True, - env=os.environ, - ) - - clone_or_pull_repo(f"https://github.com/casper-hansen/{autoawq_repo_name}", autoawq_repo_path) + print("Installing AutoAWQ package.") subprocess.run( - f"cd {autoawq_repo_path} && {sys.executable} -m pip install .", + "INSTALL_KERNELS=1 pip install git+https://github.com/casper-hansen/AutoAWQ.git", shell=True, check=True, env=os.environ, ) - - print("AutoAWQ and AutoAWQ_kernels packages installed.") + print("AutoAWQ package installed.") def install_autogptq_from_source(): From 1812bc1ebb81949109a000f60e260b694adecf84 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 19 Sep 2024 08:13:29 +0000 Subject: [PATCH 07/25] fix autoawq --- docker/cpu/Dockerfile | 2 +- docker/cuda-ort/Dockerfile | 4 ++-- docker/cuda/Dockerfile | 6 +++-- docker/rocm/Dockerfile | 7 +++--- scripts/install_quantization_libs.py | 34 ++++++++++++++++++++++++---- 5 files changed, 41 insertions(+), 12 deletions(-) diff --git a/docker/cpu/Dockerfile b/docker/cpu/Dockerfile index 3851df45..995213d6 100644 --- a/docker/cpu/Dockerfile +++ b/docker/cpu/Dockerfile @@ -34,7 +34,7 @@ ARG TORCH_VERSION=stable RUN if [ "${TORCH_VERSION}" = "stable" ]; then \ pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu ; \ -elif [ "${TORCH_VERSION}" = "nighly" ]; then \ +elif [ "${TORCH_VERSION}" = "nightly" ]; then \ pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu ; \ else \ pip install --no-cache-dir torch==${TORCH_VERSION} torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu ; \ diff --git a/docker/cuda-ort/Dockerfile b/docker/cuda-ort/Dockerfile index 9b94fae7..0dc3925e 100644 --- a/docker/cuda-ort/Dockerfile +++ b/docker/cuda-ort/Dockerfile @@ -33,8 +33,8 @@ ARG TORCH_VERSION=stable RUN if [ "${TORCH_VERSION}" = "stable" ]; then \ pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ -elif [ "${TORCH_VERSION}" = "nighly" ]; then \ - pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ +elif [ "${TORCH_VERSION}" = "nightly" ]; then \ + pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/${TORCH_CUDA} ; \ else \ pip install --no-cache-dir torch==${TORCH_VERSION} torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ fi diff --git a/docker/cuda/Dockerfile b/docker/cuda/Dockerfile index 17dec2e3..1c6285d0 100644 --- a/docker/cuda/Dockerfile +++ b/docker/cuda/Dockerfile @@ -35,9 +35,9 @@ RUN if [ -n "${TORCH_VERSION}" ]; then \ # Install specific torch version if TORCH_VERSION is provided pip install --no-cache-dir torch==${TORCH_VERSION} torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ elif [ "${TORCH_RELEASE_TYPE}" = "stable" ]; then \ - pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/${TORCH_CUDA} ; \ + pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ elif [ "${TORCH_RELEASE_TYPE}" = "nightly" ]; then \ - pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ + pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/${TORCH_CUDA} ; \ else \ echo "Error: Invalid TORCH_RELEASE_TYPE. Must be 'stable', 'nightly', or specify a TORCH_VERSION." && exit 1 ; \ fi @@ -45,6 +45,8 @@ fi # Install quantization libraries from source ENV CUDA_VERSION=12.4 ENV TORCH_CUDA_ARCH_LIST="6.0 7.0 7.5 8.0 8.6 9.0+PTX" +ARG IMAGE_FLAVOR +ENV IMAGE_FLAVOR=${IMAGE_FLAVOR} COPY scripts/install_quantization_libs.py /internal/install_quantization_libs.py RUN python internal/install_quantization_libs.py --install-autogptq-from-source --install-autoawq-from-source diff --git a/docker/rocm/Dockerfile b/docker/rocm/Dockerfile index 49577eac..3a320c76 100644 --- a/docker/rocm/Dockerfile +++ b/docker/rocm/Dockerfile @@ -38,9 +38,9 @@ RUN if [ -n "${TORCH_VERSION}" ]; then \ # Install specific torch version if TORCH_VERSION is provided pip install --no-cache-dir torch==${TORCH_VERSION} torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_ROCM} ; \ elif [ "${TORCH_RELEASE_TYPE}" = "stable" ]; then \ - pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/${TORCH_ROCM} ; \ + pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_ROCM} ; \ elif [ "${TORCH_RELEASE_TYPE}" = "nightly" ]; then \ - pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_ROCM} ; \ + pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/${TORCH_ROCM} ; \ else \ echo "Error: Invalid TORCH_RELEASE_TYPE. Must be 'stable', 'nightly', or specify a TORCH_VERSION." && exit 1 ; \ fi @@ -49,4 +49,5 @@ ENV ROCM_VERSION=5.7 ENV PYTORCH_ROCM_ARCH="gfx900;gfx906;gfx908;gfx90a;gfx1030;gfx1100" COPY scripts/install_quantization_libs.py /internal/install_quantization_libs.py -RUN python internal/install_quantization_libs.py --install-autogptq-from-source --install-autoawq-from-source \ No newline at end of file +RUN +# RUN python internal/install_quantization_libs.py --install-autogptq-from-source --install-autoawq-from-source \ No newline at end of file diff --git a/scripts/install_quantization_libs.py b/scripts/install_quantization_libs.py index 3be69452..becae136 100644 --- a/scripts/install_quantization_libs.py +++ b/scripts/install_quantization_libs.py @@ -2,7 +2,7 @@ import os import subprocess import sys - +import re EXTERNAL_REPOS_DIR = "external_repos" @@ -16,17 +16,43 @@ def clone_or_pull_repo(repo_url, repo_location_path): print(f"Cloning {repo_name} into {repo_location_path}") subprocess.run(f"git clone {repo_url} {repo_location_path}", shell=True, check=True) +def process_setup_file_for_autoawq(setup_file_path): + print(f"Processing {setup_file_path} for AutoAWQ") + + with open(setup_file_path, "r") as file: + setup_content = file.read() + + # Use regex to match any line that starts with IS_CPU_ONLY = and modify it to IS_CPU_ONLY = False + setup_content = re.sub( + r"(IS_CPU_ONLY\s*=\s*.*)", + r"\1\nIS_CPU_ONLY = False", + setup_content + ) + + # Write the modified content back to setup.py + with open(setup_file_path, "w") as file: + file.write(setup_content) def install_autoawq_from_source(): - print("Installing AutoAWQ package.") + """Install the AutoAWQ and AutoAWQ_kernels packages from GitHub.""" + print("Installing AutoAWQ and AutoAWQ_kernels packages.") + + autoawq_repo_name = "AutoAWQ" + + autoawq_repo_path = os.path.join(EXTERNAL_REPOS_DIR, autoawq_repo_name) + + clone_or_pull_repo(f"https://github.com/casper-hansen/{autoawq_repo_name}", autoawq_repo_path) + autoawq_setup_file_path = os.path.join(autoawq_repo_path, "setup.py") + if os.environ.get("IMAGE_FLAVOR") in ["cuda", "rocm", "cuda-ort"]: + process_setup_file_for_autoawq(autoawq_setup_file_path) subprocess.run( - "INSTALL_KERNELS=1 pip install git+https://github.com/casper-hansen/AutoAWQ.git", + f"cd {autoawq_repo_path} && {sys.executable} -m pip install .", shell=True, check=True, env=os.environ, ) - print("AutoAWQ package installed.") + print("AutoAWQ and AutoAWQ_kernels packages installed.") def install_autogptq_from_source(): """Install the AutoGPTQ package from GitHub.""" From 073e7dc2f78fdeb04b88d92fbbc04c44dd857108 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 19 Sep 2024 08:13:50 +0000 Subject: [PATCH 08/25] fix autoawq --- scripts/install_quantization_libs.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install_quantization_libs.py b/scripts/install_quantization_libs.py index becae136..390f3568 100644 --- a/scripts/install_quantization_libs.py +++ b/scripts/install_quantization_libs.py @@ -1,8 +1,9 @@ import argparse import os +import re import subprocess import sys -import re + EXTERNAL_REPOS_DIR = "external_repos" @@ -16,6 +17,7 @@ def clone_or_pull_repo(repo_url, repo_location_path): print(f"Cloning {repo_name} into {repo_location_path}") subprocess.run(f"git clone {repo_url} {repo_location_path}", shell=True, check=True) + def process_setup_file_for_autoawq(setup_file_path): print(f"Processing {setup_file_path} for AutoAWQ") @@ -23,16 +25,13 @@ def process_setup_file_for_autoawq(setup_file_path): setup_content = file.read() # Use regex to match any line that starts with IS_CPU_ONLY = and modify it to IS_CPU_ONLY = False - setup_content = re.sub( - r"(IS_CPU_ONLY\s*=\s*.*)", - r"\1\nIS_CPU_ONLY = False", - setup_content - ) + setup_content = re.sub(r"(IS_CPU_ONLY\s*=\s*.*)", r"\1\nIS_CPU_ONLY = False", setup_content) # Write the modified content back to setup.py with open(setup_file_path, "w") as file: file.write(setup_content) + def install_autoawq_from_source(): """Install the AutoAWQ and AutoAWQ_kernels packages from GitHub.""" print("Installing AutoAWQ and AutoAWQ_kernels packages.") @@ -54,6 +53,7 @@ def install_autoawq_from_source(): print("AutoAWQ and AutoAWQ_kernels packages installed.") + def install_autogptq_from_source(): """Install the AutoGPTQ package from GitHub.""" print("Installing AutoGPTQ package.") From 6abc2ba26b696ed3d506df3b06863a67cc9752c7 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 19 Sep 2024 08:15:15 +0000 Subject: [PATCH 09/25] fix autoawq --- docker/cuda-ort/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/cuda-ort/Dockerfile b/docker/cuda-ort/Dockerfile index 0dc3925e..c2c9f965 100644 --- a/docker/cuda-ort/Dockerfile +++ b/docker/cuda-ort/Dockerfile @@ -30,6 +30,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Install PyTorch ARG TORCH_CUDA=cu118 ARG TORCH_VERSION=stable +ARG IMAGE_FLAVOR +ENV IMAGE_FLAVOR=${IMAGE_FLAVOR} RUN if [ "${TORCH_VERSION}" = "stable" ]; then \ pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ From 5c3a633fcbd1419d252099aa13bf4d3341069ab6 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 19 Sep 2024 08:18:04 +0000 Subject: [PATCH 10/25] fix autoawq --- scripts/install_quantization_libs.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/install_quantization_libs.py b/scripts/install_quantization_libs.py index 390f3568..63542001 100644 --- a/scripts/install_quantization_libs.py +++ b/scripts/install_quantization_libs.py @@ -35,17 +35,14 @@ def process_setup_file_for_autoawq(setup_file_path): def install_autoawq_from_source(): """Install the AutoAWQ and AutoAWQ_kernels packages from GitHub.""" print("Installing AutoAWQ and AutoAWQ_kernels packages.") + autoawq_repo_path = os.path.join(EXTERNAL_REPOS_DIR, "AutoAWQ") - autoawq_repo_name = "AutoAWQ" - - autoawq_repo_path = os.path.join(EXTERNAL_REPOS_DIR, autoawq_repo_name) - - clone_or_pull_repo(f"https://github.com/casper-hansen/{autoawq_repo_name}", autoawq_repo_path) - autoawq_setup_file_path = os.path.join(autoawq_repo_path, "setup.py") + clone_or_pull_repo(f"https://github.com/casper-hansen/AutoAWQ", autoawq_repo_path) if os.environ.get("IMAGE_FLAVOR") in ["cuda", "rocm", "cuda-ort"]: + autoawq_setup_file_path = os.path.join(autoawq_repo_path, "setup.py") process_setup_file_for_autoawq(autoawq_setup_file_path) subprocess.run( - f"cd {autoawq_repo_path} && {sys.executable} -m pip install .", + f"cd {autoawq_repo_path} && INSTALL_KERNELS=1 {sys.executable} -m pip install .", shell=True, check=True, env=os.environ, From f18330e00633d870dc469e38383436c852850058 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 19 Sep 2024 08:23:44 +0000 Subject: [PATCH 11/25] fix autoawq --- .github/workflows/images.yaml | 2 ++ docker/rocm/Dockerfile | 2 ++ scripts/install_quantization_libs.py | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index 34084457..a70f795c 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -69,3 +69,5 @@ jobs: labels: ${{ steps.meta.outputs.labels }} file: docker/${{ matrix.image_flavor }}/Dockerfile cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-${{ matrix.image_flavor }} + build-args: | + IMAGE_FLAVOR=${{ matrix.image_flavor }} diff --git a/docker/rocm/Dockerfile b/docker/rocm/Dockerfile index 3a320c76..aa95d174 100644 --- a/docker/rocm/Dockerfile +++ b/docker/rocm/Dockerfile @@ -47,6 +47,8 @@ fi # Install quantization libraries from source ENV ROCM_VERSION=5.7 ENV PYTORCH_ROCM_ARCH="gfx900;gfx906;gfx908;gfx90a;gfx1030;gfx1100" +ARG IMAGE_FLAVOR +ENV IMAGE_FLAVOR=${IMAGE_FLAVOR} COPY scripts/install_quantization_libs.py /internal/install_quantization_libs.py RUN diff --git a/scripts/install_quantization_libs.py b/scripts/install_quantization_libs.py index 63542001..7b86b0c4 100644 --- a/scripts/install_quantization_libs.py +++ b/scripts/install_quantization_libs.py @@ -37,7 +37,7 @@ def install_autoawq_from_source(): print("Installing AutoAWQ and AutoAWQ_kernels packages.") autoawq_repo_path = os.path.join(EXTERNAL_REPOS_DIR, "AutoAWQ") - clone_or_pull_repo(f"https://github.com/casper-hansen/AutoAWQ", autoawq_repo_path) + clone_or_pull_repo("https://github.com/casper-hansen/AutoAWQ", autoawq_repo_path) if os.environ.get("IMAGE_FLAVOR") in ["cuda", "rocm", "cuda-ort"]: autoawq_setup_file_path = os.path.join(autoawq_repo_path, "setup.py") process_setup_file_for_autoawq(autoawq_setup_file_path) From 1c71b4016a0df53f3ea5cd03f27464471b6e59db Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 19 Sep 2024 08:34:21 +0000 Subject: [PATCH 12/25] fix autoawq --- scripts/install_quantization_libs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/install_quantization_libs.py b/scripts/install_quantization_libs.py index 7b86b0c4..dabc330c 100644 --- a/scripts/install_quantization_libs.py +++ b/scripts/install_quantization_libs.py @@ -19,7 +19,7 @@ def clone_or_pull_repo(repo_url, repo_location_path): def process_setup_file_for_autoawq(setup_file_path): - print(f"Processing {setup_file_path} for AutoAWQ") + print(f"Processing setup.py for AutoAWQ") with open(setup_file_path, "r") as file: setup_content = file.read() @@ -41,6 +41,9 @@ def install_autoawq_from_source(): if os.environ.get("IMAGE_FLAVOR") in ["cuda", "rocm", "cuda-ort"]: autoawq_setup_file_path = os.path.join(autoawq_repo_path, "setup.py") process_setup_file_for_autoawq(autoawq_setup_file_path) + raise Exception("Success") + + raise Exception("Failure") subprocess.run( f"cd {autoawq_repo_path} && INSTALL_KERNELS=1 {sys.executable} -m pip install .", shell=True, From 68b21532c52f5cb1164c4ad851e5fae0feb2ffc7 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 19 Sep 2024 08:43:10 +0000 Subject: [PATCH 13/25] fix autoawq --- scripts/install_quantization_libs.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/install_quantization_libs.py b/scripts/install_quantization_libs.py index dabc330c..c571ee2b 100644 --- a/scripts/install_quantization_libs.py +++ b/scripts/install_quantization_libs.py @@ -41,9 +41,7 @@ def install_autoawq_from_source(): if os.environ.get("IMAGE_FLAVOR") in ["cuda", "rocm", "cuda-ort"]: autoawq_setup_file_path = os.path.join(autoawq_repo_path, "setup.py") process_setup_file_for_autoawq(autoawq_setup_file_path) - raise Exception("Success") - raise Exception("Failure") subprocess.run( f"cd {autoawq_repo_path} && INSTALL_KERNELS=1 {sys.executable} -m pip install .", shell=True, From f9bc25dd67a7c00b74da57cfa773d1bf14b5e1ec Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 19 Sep 2024 09:10:33 +0000 Subject: [PATCH 14/25] fix autoawq --- scripts/install_quantization_libs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_quantization_libs.py b/scripts/install_quantization_libs.py index c571ee2b..5ee4fe5e 100644 --- a/scripts/install_quantization_libs.py +++ b/scripts/install_quantization_libs.py @@ -19,7 +19,7 @@ def clone_or_pull_repo(repo_url, repo_location_path): def process_setup_file_for_autoawq(setup_file_path): - print(f"Processing setup.py for AutoAWQ") + print("Processing setup.py for AutoAWQ") with open(setup_file_path, "r") as file: setup_content = file.read() From 8074083d70bb4d889af1c28ce6943a7b7ca4fa72 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 19 Sep 2024 09:49:27 +0000 Subject: [PATCH 15/25] fix autoawq --- docker/rocm/Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docker/rocm/Dockerfile b/docker/rocm/Dockerfile index aa95d174..f2d34656 100644 --- a/docker/rocm/Dockerfile +++ b/docker/rocm/Dockerfile @@ -26,7 +26,7 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-reco python3.10 python3-pip python3.10-dev && \ apt-get clean && rm -rf /var/lib/apt/lists/* && \ update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 && \ - pip install --no-cache-dir --upgrade pip setuptools wheel requests && \ + pip install --no-cache-dir --upgrade pip setuptools wheel requests pyrsmi && \ cd /opt/rocm/share/amd_smi && pip install . # Install PyTorch @@ -51,5 +51,4 @@ ARG IMAGE_FLAVOR ENV IMAGE_FLAVOR=${IMAGE_FLAVOR} COPY scripts/install_quantization_libs.py /internal/install_quantization_libs.py -RUN -# RUN python internal/install_quantization_libs.py --install-autogptq-from-source --install-autoawq-from-source \ No newline at end of file +RUN python internal/install_quantization_libs.py --install-autogptq-from-source --install-autoawq-from-source \ No newline at end of file From a255c3a6596acbce756e7d55057eae917c8998c2 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 19 Sep 2024 11:04:00 +0000 Subject: [PATCH 16/25] fix autoawq --- docker/cuda-ort/Dockerfile | 2 -- scripts/install_quantization_libs.py | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docker/cuda-ort/Dockerfile b/docker/cuda-ort/Dockerfile index c2c9f965..0dc3925e 100644 --- a/docker/cuda-ort/Dockerfile +++ b/docker/cuda-ort/Dockerfile @@ -30,8 +30,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Install PyTorch ARG TORCH_CUDA=cu118 ARG TORCH_VERSION=stable -ARG IMAGE_FLAVOR -ENV IMAGE_FLAVOR=${IMAGE_FLAVOR} RUN if [ "${TORCH_VERSION}" = "stable" ]; then \ pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${TORCH_CUDA} ; \ diff --git a/scripts/install_quantization_libs.py b/scripts/install_quantization_libs.py index 5ee4fe5e..c85fa62e 100644 --- a/scripts/install_quantization_libs.py +++ b/scripts/install_quantization_libs.py @@ -38,10 +38,13 @@ def install_autoawq_from_source(): autoawq_repo_path = os.path.join(EXTERNAL_REPOS_DIR, "AutoAWQ") clone_or_pull_repo("https://github.com/casper-hansen/AutoAWQ", autoawq_repo_path) - if os.environ.get("IMAGE_FLAVOR") in ["cuda", "rocm", "cuda-ort"]: + if os.environ.get("IMAGE_FLAVOR") in ["cuda", "rocm"]: + raise ValueError("AutoAWQ with CUDA or ROCM") autoawq_setup_file_path = os.path.join(autoawq_repo_path, "setup.py") process_setup_file_for_autoawq(autoawq_setup_file_path) + raise ValueError("AutoAWQ end") + subprocess.run( f"cd {autoawq_repo_path} && INSTALL_KERNELS=1 {sys.executable} -m pip install .", shell=True, From 11119435a47f7076643353217a15c9c58fda6bf0 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 19 Sep 2024 11:20:22 +0000 Subject: [PATCH 17/25] fix autoawq --- scripts/install_quantization_libs.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/install_quantization_libs.py b/scripts/install_quantization_libs.py index c85fa62e..19595f56 100644 --- a/scripts/install_quantization_libs.py +++ b/scripts/install_quantization_libs.py @@ -39,12 +39,9 @@ def install_autoawq_from_source(): clone_or_pull_repo("https://github.com/casper-hansen/AutoAWQ", autoawq_repo_path) if os.environ.get("IMAGE_FLAVOR") in ["cuda", "rocm"]: - raise ValueError("AutoAWQ with CUDA or ROCM") autoawq_setup_file_path = os.path.join(autoawq_repo_path, "setup.py") process_setup_file_for_autoawq(autoawq_setup_file_path) - raise ValueError("AutoAWQ end") - subprocess.run( f"cd {autoawq_repo_path} && INSTALL_KERNELS=1 {sys.executable} -m pip install .", shell=True, From d9c19f932660f02984b7a77e6ee624a1c5f9f808 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 19 Sep 2024 18:09:43 +0000 Subject: [PATCH 18/25] fix autoawq --- scripts/install_quantization_libs.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/install_quantization_libs.py b/scripts/install_quantization_libs.py index 19595f56..1b02023e 100644 --- a/scripts/install_quantization_libs.py +++ b/scripts/install_quantization_libs.py @@ -35,13 +35,25 @@ def process_setup_file_for_autoawq(setup_file_path): def install_autoawq_from_source(): """Install the AutoAWQ and AutoAWQ_kernels packages from GitHub.""" print("Installing AutoAWQ and AutoAWQ_kernels packages.") - autoawq_repo_path = os.path.join(EXTERNAL_REPOS_DIR, "AutoAWQ") + autoawq_repo_name = "AutoAWQ" + autoawq_kernels_repo_name = "AutoAWQ_kernels" - clone_or_pull_repo("https://github.com/casper-hansen/AutoAWQ", autoawq_repo_path) + autoawq_repo_path = os.path.join(EXTERNAL_REPOS_DIR, autoawq_repo_name) + kernels_repo_path = os.path.join(EXTERNAL_REPOS_DIR, autoawq_kernels_repo_name) + + clone_or_pull_repo(f"https://github.com/casper-hansen/{autoawq_kernels_repo_name}", kernels_repo_path) + subprocess.run( + f"cd {kernels_repo_path} && {sys.executable} -m pip install .", + shell=True, + check=True, + env=os.environ, + ) + + + clone_or_pull_repo(f"https://github.com/casper-hansen/{autoawq_repo_name}", autoawq_repo_path) if os.environ.get("IMAGE_FLAVOR") in ["cuda", "rocm"]: autoawq_setup_file_path = os.path.join(autoawq_repo_path, "setup.py") process_setup_file_for_autoawq(autoawq_setup_file_path) - subprocess.run( f"cd {autoawq_repo_path} && INSTALL_KERNELS=1 {sys.executable} -m pip install .", shell=True, From 6c5ca8dac525d44876f723b162e5f7c7308d53bc Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 19 Sep 2024 18:26:33 +0000 Subject: [PATCH 19/25] fix autoawq --- scripts/install_quantization_libs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_quantization_libs.py b/scripts/install_quantization_libs.py index 1b02023e..f2f7d2e5 100644 --- a/scripts/install_quantization_libs.py +++ b/scripts/install_quantization_libs.py @@ -55,7 +55,7 @@ def install_autoawq_from_source(): autoawq_setup_file_path = os.path.join(autoawq_repo_path, "setup.py") process_setup_file_for_autoawq(autoawq_setup_file_path) subprocess.run( - f"cd {autoawq_repo_path} && INSTALL_KERNELS=1 {sys.executable} -m pip install .", + f"cd {autoawq_repo_path} && {sys.executable} -m pip install .", shell=True, check=True, env=os.environ, From c95d41a7f43cc8519c304d78796f6c03b1388d3d Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 19 Sep 2024 18:29:18 +0000 Subject: [PATCH 20/25] fix autoawq --- scripts/install_quantization_libs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install_quantization_libs.py b/scripts/install_quantization_libs.py index f2f7d2e5..1ebf38fc 100644 --- a/scripts/install_quantization_libs.py +++ b/scripts/install_quantization_libs.py @@ -49,7 +49,6 @@ def install_autoawq_from_source(): env=os.environ, ) - clone_or_pull_repo(f"https://github.com/casper-hansen/{autoawq_repo_name}", autoawq_repo_path) if os.environ.get("IMAGE_FLAVOR") in ["cuda", "rocm"]: autoawq_setup_file_path = os.path.join(autoawq_repo_path, "setup.py") From 8614324784ecbc13fa627b2b6080dd5d87a12809 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 19 Sep 2024 19:26:01 +0000 Subject: [PATCH 21/25] fix autoawq --- scripts/install_quantization_libs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install_quantization_libs.py b/scripts/install_quantization_libs.py index 1ebf38fc..88c19196 100644 --- a/scripts/install_quantization_libs.py +++ b/scripts/install_quantization_libs.py @@ -41,6 +41,7 @@ def install_autoawq_from_source(): autoawq_repo_path = os.path.join(EXTERNAL_REPOS_DIR, autoawq_repo_name) kernels_repo_path = os.path.join(EXTERNAL_REPOS_DIR, autoawq_kernels_repo_name) + print("Installing AutoAWQ_kernels package.") clone_or_pull_repo(f"https://github.com/casper-hansen/{autoawq_kernels_repo_name}", kernels_repo_path) subprocess.run( f"cd {kernels_repo_path} && {sys.executable} -m pip install .", @@ -49,6 +50,7 @@ def install_autoawq_from_source(): env=os.environ, ) + print("Installing AutoAWQ package.") clone_or_pull_repo(f"https://github.com/casper-hansen/{autoawq_repo_name}", autoawq_repo_path) if os.environ.get("IMAGE_FLAVOR") in ["cuda", "rocm"]: autoawq_setup_file_path = os.path.join(autoawq_repo_path, "setup.py") From e56802e80b5910ec2db27792e6a58e787c80e979 Mon Sep 17 00:00:00 2001 From: baptiste Date: Fri, 20 Sep 2024 08:07:58 +0000 Subject: [PATCH 22/25] fix autoawq install --- .github/workflows/images.yaml | 2 -- docker/cuda/Dockerfile | 2 -- docker/rocm/Dockerfile | 2 -- scripts/install_quantization_libs.py | 5 ++--- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index a70f795c..34084457 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -69,5 +69,3 @@ jobs: labels: ${{ steps.meta.outputs.labels }} file: docker/${{ matrix.image_flavor }}/Dockerfile cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-${{ matrix.image_flavor }} - build-args: | - IMAGE_FLAVOR=${{ matrix.image_flavor }} diff --git a/docker/cuda/Dockerfile b/docker/cuda/Dockerfile index 1c6285d0..eab0c744 100644 --- a/docker/cuda/Dockerfile +++ b/docker/cuda/Dockerfile @@ -45,8 +45,6 @@ fi # Install quantization libraries from source ENV CUDA_VERSION=12.4 ENV TORCH_CUDA_ARCH_LIST="6.0 7.0 7.5 8.0 8.6 9.0+PTX" -ARG IMAGE_FLAVOR -ENV IMAGE_FLAVOR=${IMAGE_FLAVOR} COPY scripts/install_quantization_libs.py /internal/install_quantization_libs.py RUN python internal/install_quantization_libs.py --install-autogptq-from-source --install-autoawq-from-source diff --git a/docker/rocm/Dockerfile b/docker/rocm/Dockerfile index f2d34656..bb5d28a3 100644 --- a/docker/rocm/Dockerfile +++ b/docker/rocm/Dockerfile @@ -47,8 +47,6 @@ fi # Install quantization libraries from source ENV ROCM_VERSION=5.7 ENV PYTORCH_ROCM_ARCH="gfx900;gfx906;gfx908;gfx90a;gfx1030;gfx1100" -ARG IMAGE_FLAVOR -ENV IMAGE_FLAVOR=${IMAGE_FLAVOR} COPY scripts/install_quantization_libs.py /internal/install_quantization_libs.py RUN python internal/install_quantization_libs.py --install-autogptq-from-source --install-autoawq-from-source \ No newline at end of file diff --git a/scripts/install_quantization_libs.py b/scripts/install_quantization_libs.py index 88c19196..fa9c5936 100644 --- a/scripts/install_quantization_libs.py +++ b/scripts/install_quantization_libs.py @@ -52,9 +52,8 @@ def install_autoawq_from_source(): print("Installing AutoAWQ package.") clone_or_pull_repo(f"https://github.com/casper-hansen/{autoawq_repo_name}", autoawq_repo_path) - if os.environ.get("IMAGE_FLAVOR") in ["cuda", "rocm"]: - autoawq_setup_file_path = os.path.join(autoawq_repo_path, "setup.py") - process_setup_file_for_autoawq(autoawq_setup_file_path) + autoawq_setup_file_path = os.path.join(autoawq_repo_path, "setup.py") + process_setup_file_for_autoawq(autoawq_setup_file_path) subprocess.run( f"cd {autoawq_repo_path} && {sys.executable} -m pip install .", shell=True, From d5af74045cace774489d978d9cc67954cb577e02 Mon Sep 17 00:00:00 2001 From: Baptiste Colle <32412211+baptistecolle@users.noreply.github.com> Date: Fri, 20 Sep 2024 10:31:14 +0200 Subject: [PATCH 23/25] Update docker/rocm/Dockerfile Co-authored-by: Ilyas Moutawwakil <57442720+IlyasMoutawwakil@users.noreply.github.com> --- docker/rocm/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/rocm/Dockerfile b/docker/rocm/Dockerfile index bb5d28a3..22acb32a 100644 --- a/docker/rocm/Dockerfile +++ b/docker/rocm/Dockerfile @@ -26,7 +26,7 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-reco python3.10 python3-pip python3.10-dev && \ apt-get clean && rm -rf /var/lib/apt/lists/* && \ update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 && \ - pip install --no-cache-dir --upgrade pip setuptools wheel requests pyrsmi && \ + pip install --no-cache-dir --upgrade pip setuptools wheel requests && \ cd /opt/rocm/share/amd_smi && pip install . # Install PyTorch From 4ed7b5825331edf3fa2b0804318e9faf461f62ee Mon Sep 17 00:00:00 2001 From: Baptiste Colle <32412211+baptistecolle@users.noreply.github.com> Date: Fri, 20 Sep 2024 10:31:20 +0200 Subject: [PATCH 24/25] Update docker/cuda/Dockerfile Co-authored-by: Ilyas Moutawwakil <57442720+IlyasMoutawwakil@users.noreply.github.com> --- docker/cuda/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/cuda/Dockerfile b/docker/cuda/Dockerfile index eab0c744..f97d7c56 100644 --- a/docker/cuda/Dockerfile +++ b/docker/cuda/Dockerfile @@ -29,7 +29,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Install PyTorch ARG TORCH_CUDA=cu124 ARG TORCH_RELEASE_TYPE=stable -ARG TORCH_VERSION +ARG TORCH_VERSION="" RUN if [ -n "${TORCH_VERSION}" ]; then \ # Install specific torch version if TORCH_VERSION is provided From 63086d68c64aa559da90a1db701a03f4330e524f Mon Sep 17 00:00:00 2001 From: Baptiste Colle <32412211+baptistecolle@users.noreply.github.com> Date: Fri, 20 Sep 2024 10:31:26 +0200 Subject: [PATCH 25/25] Update docker/rocm/Dockerfile Co-authored-by: Ilyas Moutawwakil <57442720+IlyasMoutawwakil@users.noreply.github.com> --- docker/rocm/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/rocm/Dockerfile b/docker/rocm/Dockerfile index 22acb32a..00f51b84 100644 --- a/docker/rocm/Dockerfile +++ b/docker/rocm/Dockerfile @@ -32,7 +32,7 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-reco # Install PyTorch ARG TORCH_ROCM=rocm5.7 ARG TORCH_RELEASE_TYPE=stable -ARG TORCH_VERSION +ARG TORCH_VERSION="" RUN if [ -n "${TORCH_VERSION}" ]; then \ # Install specific torch version if TORCH_VERSION is provided