From 3ac7bbd3fa27c3c35aff55b399f9e6d631ffe358 Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 09:53:45 -0400 Subject: [PATCH 01/25] Create Dockerfile-xpu --- docker/Dockerfile-xpu | 1 + 1 file changed, 1 insertion(+) create mode 100644 docker/Dockerfile-xpu diff --git a/docker/Dockerfile-xpu b/docker/Dockerfile-xpu new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/docker/Dockerfile-xpu @@ -0,0 +1 @@ + From 02127ae652b005b2e71447d171842c4e0130fff3 Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 09:54:24 -0400 Subject: [PATCH 02/25] Create Dockerfile-hpu --- docker/Dockerfile-hpu | 1 + 1 file changed, 1 insertion(+) create mode 100644 docker/Dockerfile-hpu diff --git a/docker/Dockerfile-hpu b/docker/Dockerfile-hpu new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/docker/Dockerfile-hpu @@ -0,0 +1 @@ + From 7526334440e1e65a170245bcbe7e7d0572b3cda8 Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 10:08:33 -0400 Subject: [PATCH 03/25] Update Dockerfile-cuda --- docker/Dockerfile-cuda | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile-cuda b/docker/Dockerfile-cuda index 6e7641844..06b4e825a 100644 --- a/docker/Dockerfile-cuda +++ b/docker/Dockerfile-cuda @@ -1,7 +1,7 @@ # FROM ubuntu:22.04 # For cuda-gdb -FROM nvidia/cuda:11.8.0-devel-ubuntu22.04 +FROM nvidia/cuda:12.1.0-devel-ubuntu22.04 # Arguments # --------- @@ -41,7 +41,7 @@ COPY . /milabench/milabench/ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -y &&\ - apt-get install -y --no-install-recommends git build-essential curl python3 python-is-python3 python3-pip &&\ + apt-get install -y --no-install-recommends git build-essential curl python3.10 python-is-python3 python3-pip &&\ curl -o /etc/apt/trusted.gpg.d/mellanox.asc https://content.mellanox.com/ofed/RPM-GPG-KEY-Mellanox &&\ curl -o /etc/apt/sources.list.d/mellanox.list https://linux.mellanox.com/public/repo/mlnx_ofed/${MOFED_VERSION}/ubuntu22.04/mellanox_mlnx_ofed.list &&\ apt-get update -y &&\ From fdd839c9c0eae30b1b0d0bacd0b36809fd3db94c Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 10:09:10 -0400 Subject: [PATCH 04/25] Update Dockerfile-rocm --- docker/Dockerfile-rocm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile-rocm b/docker/Dockerfile-rocm index 504660848..e93194940 100644 --- a/docker/Dockerfile-rocm +++ b/docker/Dockerfile-rocm @@ -37,7 +37,7 @@ COPY . /milabench/milabench/ # build-essential: for rust RUN apt-get update &&\ - apt-get install -y git build-essential curl &&\ + apt-get install -y git build-essential curl python3.10 &&\ apt-get clean &&\ rm -rf /var/lib/apt/lists/* From 24286c6db22c8db05ab7060a931a739f6b8c49b5 Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 10:14:15 -0400 Subject: [PATCH 05/25] Update Dockerfile-cuda --- docker/Dockerfile-cuda | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile-cuda b/docker/Dockerfile-cuda index 06b4e825a..2c9cde10e 100644 --- a/docker/Dockerfile-cuda +++ b/docker/Dockerfile-cuda @@ -52,7 +52,7 @@ RUN apt-get update -y &&\ # Install Rust RUN curl https://sh.rustup.rs -sSf | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" -ENV CUDA_HOME=/usr/local/cuda-11.8 +ENV CUDA_HOME=/usr/local/cuda-12.1 # Install Milabench # ----------------- From a0da8b5a66d961f199599dbcb6ab23834274cf23 Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 10:14:36 -0400 Subject: [PATCH 06/25] Update Dockerfile-rocm --- docker/Dockerfile-rocm | 9 --------- 1 file changed, 9 deletions(-) diff --git a/docker/Dockerfile-rocm b/docker/Dockerfile-rocm index e93194940..8afe94442 100644 --- a/docker/Dockerfile-rocm +++ b/docker/Dockerfile-rocm @@ -44,15 +44,6 @@ RUN apt-get update &&\ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" -# Install Python -# -------------- - -# Install anaconda because milabench will need it later anyway -RUN curl https://repo.anaconda.com/miniconda/Miniconda3-py39_23.1.0-1-Linux-x86_64.sh -o ~/miniconda.sh && \ - /bin/bash ~/miniconda.sh -b -p $CONDA_PATH && rm ~/miniconda.sh -ENV PATH=$CONDA_PATH/bin:$PATH - - # Install Milabench # ----------------- From a4d3850cbb093556a97669be2053b6311630b527 Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 13:40:22 -0400 Subject: [PATCH 07/25] Update Dockerfile-hpu --- docker/Dockerfile-hpu | 68 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/docker/Dockerfile-hpu b/docker/Dockerfile-hpu index 8b1378917..c1a3f7ba1 100644 --- a/docker/Dockerfile-hpu +++ b/docker/Dockerfile-hpu @@ -1 +1,69 @@ +FROM ubuntu:22.04 + +# Arguments +# --------- + +ARG ARCH=rocm +ENV MILABENCH_GPU_ARCH=$ARCH + +ARG CONFIG=standard.yaml +ENV MILABENCH_CONFIG_NAME=$CONFIG +ENV MILABENCH_DOCKER=1 + +ARG PYTHON=3.10 + + +# Paths +# ----- + +ENV MILABENCH_CONFIG=/milabench/milabench/config/$MILABENCH_CONFIG_NAME +ENV MILABENCH_BASE=/milabench/envs +ENV MILABENCH_OUTPUT=/milabench/results/ +ENV MILABENCH_ARGS="" +ENV CONDA_PATH=/opt/anaconda + + +# Copy milabench +# -------------- + +WORKDIR /milabench +COPY . /milabench/milabench/ + + +# Install Dependencies +# -------------------- + +# curl: used to download anaconda +# git: used by milabench +# rustc: used by BERT models inside https://pypi.org/project/tokenizers/ +# build-essential: for rust + +RUN apt-get update &&\ + apt-get install -y git build-essential curl python3.10 &&\ + apt-get clean &&\ + rm -rf /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" + +# Install Milabench +# ----------------- + +RUN python3 -m pip install -U pip &&\ + python3 -m pip install -U setuptools &&\ + python3 -m pip install -U poetry &&\ + python3 -m pip install -e /milabench/milabench/ &&\ + python3 -m pip cache purge + + +# Prepare bench +# ------------- + +# pip times out often when downloading pytorch +ENV PIP_DEFAULT_TIMEOUT=800 + +RUN milabench install --config $MILABENCH_CONFIG --base $MILABENCH_BASE $MILABENCH_ARGS &&\ + python3 -m pip cache purge + +CMD ["milabench", "run"] From 66cdf0a8fbcfbfe07b1d15e9b1294017f5d84f8b Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 13:40:45 -0400 Subject: [PATCH 08/25] Update Dockerfile-rocm --- docker/Dockerfile-rocm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docker/Dockerfile-rocm b/docker/Dockerfile-rocm index 8afe94442..c1a3f7ba1 100644 --- a/docker/Dockerfile-rocm +++ b/docker/Dockerfile-rocm @@ -1,3 +1,4 @@ + FROM ubuntu:22.04 # Arguments @@ -10,6 +11,8 @@ ARG CONFIG=standard.yaml ENV MILABENCH_CONFIG_NAME=$CONFIG ENV MILABENCH_DOCKER=1 +ARG PYTHON=3.10 + # Paths # ----- @@ -47,11 +50,11 @@ ENV PATH="/root/.cargo/bin:${PATH}" # Install Milabench # ----------------- -RUN python -m pip install -U pip &&\ - python -m pip install -U setuptools &&\ - python -m pip install -U poetry &&\ - python -m pip install -e /milabench/milabench/ &&\ - python -m pip cache purge +RUN python3 -m pip install -U pip &&\ + python3 -m pip install -U setuptools &&\ + python3 -m pip install -U poetry &&\ + python3 -m pip install -e /milabench/milabench/ &&\ + python3 -m pip cache purge # Prepare bench @@ -61,6 +64,6 @@ RUN python -m pip install -U pip &&\ ENV PIP_DEFAULT_TIMEOUT=800 RUN milabench install --config $MILABENCH_CONFIG --base $MILABENCH_BASE $MILABENCH_ARGS &&\ - python -m pip cache purge + python3 -m pip cache purge CMD ["milabench", "run"] From d301128f54aa5a5f3bb040247fc752387540744e Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 13:45:37 -0400 Subject: [PATCH 09/25] Update Dockerfile-rocm --- docker/Dockerfile-rocm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docker/Dockerfile-rocm b/docker/Dockerfile-rocm index c1a3f7ba1..357af0208 100644 --- a/docker/Dockerfile-rocm +++ b/docker/Dockerfile-rocm @@ -40,7 +40,7 @@ COPY . /milabench/milabench/ # build-essential: for rust RUN apt-get update &&\ - apt-get install -y git build-essential curl python3.10 &&\ + apt-get install -y git build-essential curl python3.10 python-is-python3 python3-pip &&\ apt-get clean &&\ rm -rf /var/lib/apt/lists/* @@ -50,11 +50,11 @@ ENV PATH="/root/.cargo/bin:${PATH}" # Install Milabench # ----------------- -RUN python3 -m pip install -U pip &&\ - python3 -m pip install -U setuptools &&\ - python3 -m pip install -U poetry &&\ - python3 -m pip install -e /milabench/milabench/ &&\ - python3 -m pip cache purge +RUN python -m pip install -U pip &&\ + python -m pip install -U setuptools &&\ + python -m pip install -U poetry &&\ + python -m pip install -e /milabench/milabench/ &&\ + python -m pip cache purge # Prepare bench @@ -64,6 +64,6 @@ RUN python3 -m pip install -U pip &&\ ENV PIP_DEFAULT_TIMEOUT=800 RUN milabench install --config $MILABENCH_CONFIG --base $MILABENCH_BASE $MILABENCH_ARGS &&\ - python3 -m pip cache purge + python -m pip cache purge CMD ["milabench", "run"] From 490ef9501a113e36d88e0b6048daf3764ac7ebe7 Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 13:57:29 -0400 Subject: [PATCH 10/25] Update docker.yml --- .github/workflows/docker.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0b801a4c4..92b27f943 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -38,6 +38,13 @@ jobs: packages: write steps: + - uses: easimon/maximize-build-space@master + with: + remove-dotnet: 'true' + remove-codeql: 'true' + remove-haskell: 'true' + remove-android: 'true' + - name: Show all images run: | docker image ls From 973418868edadcc6e2c02a4037b19c3b928b4575 Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 14:04:03 -0400 Subject: [PATCH 11/25] Update docker.yml --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 92b27f943..32bebdf64 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -53,6 +53,7 @@ jobs: run: | # Prune all images older than 2 weeks # The images are still on github registry + cat /etc/docker/daemon.json docker image prune -f -a --filter "until=336h" docker system prune -f From d2d18543453da7c803b498378a588c9a0e33d7e0 Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 14:11:07 -0400 Subject: [PATCH 12/25] Update docker.yml --- .github/workflows/docker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 32bebdf64..8d721c8d8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -53,6 +53,8 @@ jobs: run: | # Prune all images older than 2 weeks # The images are still on github registry + apt install jq + jq --arg dataRoot "/home/runner/work/milabench/milabench" '. + { "data-root": $dataRoot }' "/etc/docker/daemon.json" cat /etc/docker/daemon.json docker image prune -f -a --filter "until=336h" docker system prune -f From 7cac788b8868f99b5161e7de2b6068f825512f57 Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 14:12:38 -0400 Subject: [PATCH 13/25] Update docker.yml --- .github/workflows/docker.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8d721c8d8..545affab9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -53,9 +53,10 @@ jobs: run: | # Prune all images older than 2 weeks # The images are still on github registry - apt install jq - jq --arg dataRoot "/home/runner/work/milabench/milabench" '. + { "data-root": $dataRoot }' "/etc/docker/daemon.json" + sudo apt install jq -y + sudo jq --arg dataRoot "/home/runner/work/milabench/milabench" '. + { "data-root": $dataRoot }' "/etc/docker/daemon.json" cat /etc/docker/daemon.json + sudo systemctl restart docker docker image prune -f -a --filter "until=336h" docker system prune -f From a3b51db0cf5e9e7e5c19a3a767424616fe7cfada Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 14:28:25 -0400 Subject: [PATCH 14/25] Update docker.yml --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 545affab9..4041d1027 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -53,6 +53,7 @@ jobs: run: | # Prune all images older than 2 weeks # The images are still on github registry + docker/build-push-action sudo apt install jq -y sudo jq --arg dataRoot "/home/runner/work/milabench/milabench" '. + { "data-root": $dataRoot }' "/etc/docker/daemon.json" cat /etc/docker/daemon.json From b9956bb9617c9901bd3db2e6fff5601944c7332f Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 14:29:59 -0400 Subject: [PATCH 15/25] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4041d1027..1b3c9d29c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -53,7 +53,7 @@ jobs: run: | # Prune all images older than 2 weeks # The images are still on github registry - docker/build-push-action + docker info sudo apt install jq -y sudo jq --arg dataRoot "/home/runner/work/milabench/milabench" '. + { "data-root": $dataRoot }' "/etc/docker/daemon.json" cat /etc/docker/daemon.json From 7d48cf5fde3518c0185edfeb7f71befdef89a7ed Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 14:36:32 -0400 Subject: [PATCH 16/25] Update docker.yml --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1b3c9d29c..d6ae9f255 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -58,6 +58,7 @@ jobs: sudo jq --arg dataRoot "/home/runner/work/milabench/milabench" '. + { "data-root": $dataRoot }' "/etc/docker/daemon.json" cat /etc/docker/daemon.json sudo systemctl restart docker + docker info docker image prune -f -a --filter "until=336h" docker system prune -f From 1d68709fec83836d15a2d61f774d9f95ed11d110 Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 14:40:32 -0400 Subject: [PATCH 17/25] Update docker.yml --- .github/workflows/docker.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d6ae9f255..176db5fe3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -57,7 +57,10 @@ jobs: sudo apt install jq -y sudo jq --arg dataRoot "/home/runner/work/milabench/milabench" '. + { "data-root": $dataRoot }' "/etc/docker/daemon.json" cat /etc/docker/daemon.json - sudo systemctl restart docker + sudo systemctl stop docker.service + sudo systemctl stop docker.socket + sudo systemctl start docker.service + sudo systemctl start docker.socket docker info docker image prune -f -a --filter "until=336h" docker system prune -f From e986142be84574573f09117b9c8b45b157176244 Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 14:41:50 -0400 Subject: [PATCH 18/25] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 176db5fe3..ae767c064 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -59,8 +59,8 @@ jobs: cat /etc/docker/daemon.json sudo systemctl stop docker.service sudo systemctl stop docker.socket - sudo systemctl start docker.service sudo systemctl start docker.socket + sudo systemctl start docker.service docker info docker image prune -f -a --filter "until=336h" docker system prune -f From a433c2f7d178ae487ed35cd0fbce54a30c0019fb Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 14:43:21 -0400 Subject: [PATCH 19/25] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ae767c064..7cd0515e3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -55,7 +55,7 @@ jobs: # The images are still on github registry docker info sudo apt install jq -y - sudo jq --arg dataRoot "/home/runner/work/milabench/milabench" '. + { "data-root": $dataRoot }' "/etc/docker/daemon.json" + sudo jq --arg dataRoot "/home/runner/work/milabench/milabench" '. + { "data-root": $dataRoot }' "/etc/docker/daemon.json" > /etc/docker/daemon.json cat /etc/docker/daemon.json sudo systemctl stop docker.service sudo systemctl stop docker.socket From cf6f19b382c02d25a66503bd9758faf98c9eec8c Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 14:45:57 -0400 Subject: [PATCH 20/25] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7cd0515e3..4106bfb40 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -55,7 +55,7 @@ jobs: # The images are still on github registry docker info sudo apt install jq -y - sudo jq --arg dataRoot "/home/runner/work/milabench/milabench" '. + { "data-root": $dataRoot }' "/etc/docker/daemon.json" > /etc/docker/daemon.json + sudo jq --arg dataRoot "/home/runner/work/milabench/milabench" '. + { "data-root": $dataRoot }' "/etc/docker/daemon.json" | sudo tee "/etc/docker/daemon.json" cat /etc/docker/daemon.json sudo systemctl stop docker.service sudo systemctl stop docker.socket From 56b48f327653b3543fc343e3274977973976d0eb Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 15:00:47 -0400 Subject: [PATCH 21/25] Update docker.yml --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4106bfb40..6e9f06b79 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -53,17 +53,17 @@ jobs: run: | # Prune all images older than 2 weeks # The images are still on github registry + docker image prune -f -a --filter "until=336h" + docker system prune -f docker info sudo apt install jq -y - sudo jq --arg dataRoot "/home/runner/work/milabench/milabench" '. + { "data-root": $dataRoot }' "/etc/docker/daemon.json" | sudo tee "/etc/docker/daemon.json" + sudo bash -c "jq '. + { \"data-root\": \"/home/runner/work/milabench/milabench\" }' /etc/docker/daemon.json > /etc/docker/daemon.json" cat /etc/docker/daemon.json sudo systemctl stop docker.service sudo systemctl stop docker.socket sudo systemctl start docker.socket sudo systemctl start docker.service docker info - docker image prune -f -a --filter "until=336h" - docker system prune -f - name: Check out the repo uses: actions/checkout@v3 From 0b0b6a6a5774e8b3a4545b3c49d0804bc0440971 Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 15:08:19 -0400 Subject: [PATCH 22/25] Update docker.yml --- .github/workflows/docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6e9f06b79..14f290182 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -57,7 +57,8 @@ jobs: docker system prune -f docker info sudo apt install jq -y - sudo bash -c "jq '. + { \"data-root\": \"/home/runner/work/milabench/milabench\" }' /etc/docker/daemon.json > /etc/docker/daemon.json" + jq '. + { "data-root": "/home/runner/work/milabench/milabench" }' /etc/docker/daemon.json > newconfig.json + sudo mv -f newconfig.json /etc/docker/daemon.json cat /etc/docker/daemon.json sudo systemctl stop docker.service sudo systemctl stop docker.socket From 9cd2d9dc00447b14d5c08325d143eb1156af5cab Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 15:13:17 -0400 Subject: [PATCH 23/25] Update docker.yml --- .github/workflows/docker.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 14f290182..c512f291f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -55,9 +55,8 @@ jobs: # The images are still on github registry docker image prune -f -a --filter "until=336h" docker system prune -f - docker info sudo apt install jq -y - jq '. + { "data-root": "/home/runner/work/milabench/milabench" }' /etc/docker/daemon.json > newconfig.json + jq '. + { "data-root": "/home/runner/work/milabench/milabench/docker" }' /etc/docker/daemon.json > newconfig.json sudo mv -f newconfig.json /etc/docker/daemon.json cat /etc/docker/daemon.json sudo systemctl stop docker.service From 508240b96a3dc0f10aa2c1a06b34e0b5373b9a67 Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 15:16:58 -0400 Subject: [PATCH 24/25] Update docker.yml --- .github/workflows/docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c512f291f..eeced2845 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -44,6 +44,7 @@ jobs: remove-codeql: 'true' remove-haskell: 'true' remove-android: 'true' + build-mount-path: /home/runner/work/milabench/ - name: Show all images run: | @@ -56,7 +57,7 @@ jobs: docker image prune -f -a --filter "until=336h" docker system prune -f sudo apt install jq -y - jq '. + { "data-root": "/home/runner/work/milabench/milabench/docker" }' /etc/docker/daemon.json > newconfig.json + jq '. + { "data-root": "/home/runner/work/milabench/docker" }' /etc/docker/daemon.json > newconfig.json sudo mv -f newconfig.json /etc/docker/daemon.json cat /etc/docker/daemon.json sudo systemctl stop docker.service From 230ae61667555c9d635eb0179b3914e23cf3f0d7 Mon Sep 17 00:00:00 2001 From: Setepenre Date: Mon, 5 Aug 2024 19:59:02 +0000 Subject: [PATCH 25/25] Add XPU & HPU dockerfiles --- .github/workflows/docker.yml | 19 +++++---- docker/Dockerfile-cuda | 14 ++++--- docker/Dockerfile-hpu | 41 ++++++++++++------- docker/Dockerfile-rocm | 7 ++-- docker/Dockerfile-xpu | 78 ++++++++++++++++++++++++++++++++++++ milabench/_version.py | 6 +-- 6 files changed, 128 insertions(+), 37 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index eeced2845..2aa0e3441 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -3,7 +3,7 @@ name: Publish Docker image on: # Allow manual runs workflow_dispatch: - + # Only run for push on the main branch or for tagged version push: branches: @@ -15,13 +15,10 @@ env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} - permissions: packages: write - # define build arguments - jobs: build-image: strategy: @@ -30,8 +27,10 @@ jobs: include: - arch: cuda - arch: rocm + - arch: xpu + - arch: hpu - runs-on: ubuntu-latest + runs-on: ubuntu-latest permissions: contents: read @@ -45,7 +44,7 @@ jobs: remove-haskell: 'true' remove-android: 'true' build-mount-path: /home/runner/work/milabench/ - + - name: Show all images run: | docker image ls @@ -56,7 +55,7 @@ jobs: # The images are still on github registry docker image prune -f -a --filter "until=336h" docker system prune -f - sudo apt install jq -y + sudo apt install jq -y jq '. + { "data-root": "/home/runner/work/milabench/docker" }' /etc/docker/daemon.json > newconfig.json sudo mv -f newconfig.json /etc/docker/daemon.json cat /etc/docker/daemon.json @@ -68,7 +67,7 @@ jobs: - name: Check out the repo uses: actions/checkout@v3 - + - name: Get Image Tag Name env: GITHUB_REF_NAME_ENV: ${{ github.ref_name }} @@ -79,14 +78,14 @@ jobs: IMAGE_TAG="${GITHUB_REF_NAME##*/}" fi echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV - + - name: Log in to the registry uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - + - name: Extract metadata (tags, labels) for the image id: meta uses: docker/metadata-action@v4 diff --git a/docker/Dockerfile-cuda b/docker/Dockerfile-cuda index 2c9cde10e..da9c2c96b 100644 --- a/docker/Dockerfile-cuda +++ b/docker/Dockerfile-cuda @@ -15,6 +15,10 @@ ENV MILABENCH_GPU_ARCH=$ARCH ENV MILABENCH_CONFIG_NAME=$CONFIG ENV MILABENCH_DOCKER=1 +ENV CUDA_VER=12.1 +ENV MELLANOX_KEY="https://content.mellanox.com/ofed/RPM-GPG-KEY-Mellanox" +ENV MELLANOX_LIST="https://linux.mellanox.com/public/repo/mlnx_ofed/${MOFED_VERSION}/ubuntu22.04/mellanox_mlnx_ofed.list" + # Paths # ----- @@ -42,17 +46,17 @@ COPY . /milabench/milabench/ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -y &&\ apt-get install -y --no-install-recommends git build-essential curl python3.10 python-is-python3 python3-pip &&\ - curl -o /etc/apt/trusted.gpg.d/mellanox.asc https://content.mellanox.com/ofed/RPM-GPG-KEY-Mellanox &&\ - curl -o /etc/apt/sources.list.d/mellanox.list https://linux.mellanox.com/public/repo/mlnx_ofed/${MOFED_VERSION}/ubuntu22.04/mellanox_mlnx_ofed.list &&\ + curl -o /etc/apt/trusted.gpg.d/mellanox.asc $MELLANOX_KEY &&\ + curl -o /etc/apt/sources.list.d/mellanox.list $MELLANOX_LIST &&\ apt-get update -y &&\ apt-get install -y --no-install-recommends libibverbs1 &&\ apt-get clean &&\ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* # Install Rust RUN curl https://sh.rustup.rs -sSf | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" -ENV CUDA_HOME=/usr/local/cuda-12.1 +ENV CUDA_HOME="/usr/local/cuda-${CUDA_VER}" # Install Milabench # ----------------- @@ -71,6 +75,6 @@ RUN python -m pip install -U pip &&\ ENV PIP_DEFAULT_TIMEOUT=800 RUN milabench install --config $MILABENCH_CONFIG --base $MILABENCH_BASE $MILABENCH_ARGS &&\ - python -m pip cache purge + python -m pip cache purge CMD milabench run diff --git a/docker/Dockerfile-hpu b/docker/Dockerfile-hpu index c1a3f7ba1..90fac3849 100644 --- a/docker/Dockerfile-hpu +++ b/docker/Dockerfile-hpu @@ -4,24 +4,25 @@ FROM ubuntu:22.04 # Arguments # --------- -ARG ARCH=rocm +ARG ARCH=hpu ENV MILABENCH_GPU_ARCH=$ARCH ARG CONFIG=standard.yaml ENV MILABENCH_CONFIG_NAME=$CONFIG ENV MILABENCH_DOCKER=1 -ARG PYTHON=3.10 +ARG PYTHON="3.10" +ENV HABANA_INSTALLER=https://vault.habana.ai/artifactory/gaudi-installer/1.16.1/habanalabs-installer.sh # Paths # ----- ENV MILABENCH_CONFIG=/milabench/milabench/config/$MILABENCH_CONFIG_NAME ENV MILABENCH_BASE=/milabench/envs -ENV MILABENCH_OUTPUT=/milabench/results/ ENV MILABENCH_ARGS="" -ENV CONDA_PATH=/opt/anaconda +ENV MILABENCH_OUTPUT="$MILABENCH_BASE/runs" +ENV BENCHMARK_VENV="$MILABENCH_BASE/venv" # Copy milabench @@ -40,9 +41,11 @@ COPY . /milabench/milabench/ # build-essential: for rust RUN apt-get update &&\ - apt-get install -y git build-essential curl python3.10 &&\ + apt-get install -y git build-essential curl python3.10 python-is-python3 python3-pip &&\ apt-get clean &&\ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* &&\ + curl -L -o habana_installer.sh -s ${HABANA_INSTALLER} &&\ + chmod +x habana_installer.sh RUN curl https://sh.rustup.rs -sSf | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" @@ -50,20 +53,28 @@ ENV PATH="/root/.cargo/bin:${PATH}" # Install Milabench # ----------------- -RUN python3 -m pip install -U pip &&\ - python3 -m pip install -U setuptools &&\ - python3 -m pip install -U poetry &&\ - python3 -m pip install -e /milabench/milabench/ &&\ - python3 -m pip cache purge - +# Have to install habana in the system env too... +# so we can monitor the HPU.. +RUN python -m pip install -U pip &&\ + python -m pip install -U setuptools &&\ + python -m pip install -U poetry &&\ + python -m pip install -e /milabench/milabench/ &&\ + ./habana_installer.sh install -t dependencies &&\ + ./habana_installer.sh install -t pytorch &&\ + python -m pip cache purge # Prepare bench # ------------- # pip times out often when downloading pytorch ENV PIP_DEFAULT_TIMEOUT=800 - -RUN milabench install --config $MILABENCH_CONFIG --base $MILABENCH_BASE $MILABENCH_ARGS &&\ - python3 -m pip cache purge +ENV HABANALABS_VIRTUAL_DIR=$BENCHMARK_VENV/torch + +# Install habana in the benchmark environment +RUN milabench install --config $MILABENCH_CONFIG --base $MILABENCH_BASE $MILABENCH_ARGS &&\ + ./habana_installer.sh install -t dependencies --venv -y &&\ + ./habana_installer.sh install -t pytorch --venv -y &&\ + python -m pip cache purge &&\ + rm -rf habana_installer.sh CMD ["milabench", "run"] diff --git a/docker/Dockerfile-rocm b/docker/Dockerfile-rocm index 357af0208..2290c40ef 100644 --- a/docker/Dockerfile-rocm +++ b/docker/Dockerfile-rocm @@ -11,7 +11,7 @@ ARG CONFIG=standard.yaml ENV MILABENCH_CONFIG_NAME=$CONFIG ENV MILABENCH_DOCKER=1 -ARG PYTHON=3.10 +ARG PYTHON="3.10" # Paths @@ -19,10 +19,9 @@ ARG PYTHON=3.10 ENV MILABENCH_CONFIG=/milabench/milabench/config/$MILABENCH_CONFIG_NAME ENV MILABENCH_BASE=/milabench/envs -ENV MILABENCH_OUTPUT=/milabench/results/ ENV MILABENCH_ARGS="" -ENV CONDA_PATH=/opt/anaconda - +ENV MILABENCH_OUTPUT="$MILABENCH_BASE/runs" +ENV BENCHMARK_VENV="$MILABENCH_BASE/venv" # Copy milabench # -------------- diff --git a/docker/Dockerfile-xpu b/docker/Dockerfile-xpu index 8b1378917..d8e524925 100644 --- a/docker/Dockerfile-xpu +++ b/docker/Dockerfile-xpu @@ -1 +1,79 @@ + +FROM ubuntu:22.04 + +# Arguments +# --------- + +ARG ARCH=xpu +ENV MILABENCH_GPU_ARCH=$ARCH + +ARG CONFIG=standard.yaml +ENV MILABENCH_CONFIG_NAME=$CONFIG +ENV MILABENCH_DOCKER=1 + +ARG PYTHON="3.10" + +ENV XPU_MANAGER="V1.2.36/xpumanager_1.2.36_20240428.081009.377f9162.u22.04_amd64.deb" + +# Paths +# ----- + +ENV MILABENCH_CONFIG=/milabench/milabench/config/$MILABENCH_CONFIG_NAME +ENV MILABENCH_BASE=/milabench/base +ENV MILABENCH_ARGS="" + +ENV MILABENCH_OUTPUT="$MILABENCH_BASE/runs" +ENV BENCHMARK_VENV="$MILABENCH_BASE/venv" + +# Copy milabench +# -------------- + +WORKDIR /milabench +COPY . /milabench/milabench/ + + +# Install Dependencies +# -------------------- + +# curl: used to download anaconda +# git: used by milabench +# rustc: used by BERT models inside https://pypi.org/project/tokenizers/ +# build-essential: for rust + +RUN apt-get update &&\ + apt-get install -y git build-essential curl python3.10 python-is-python3 python3-pip &&\ + apt-get clean &&\ + rm -rf /var/lib/apt/lists/* &&\ + curl -L -o xpu_manager.deb -s https://github.com/intel/xpumanager/releases/download/${XPU_MANAGER} &&\ + dpkg -i xpu_manager.deb &&\ + rm -rf xpu_manager.deb + + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" + +# Install Milabench +# ----------------- + +RUN python -m pip install -U pip &&\ + python -m pip install -U setuptools &&\ + python -m pip install -U poetry &&\ + python -m pip install -e /milabench/milabench/ &&\ + python -m pip cache purge + + +# Prepare bench +# ------------- + +# pip times out often when downloading pytorch +ENV PIP_DEFAULT_TIMEOUT=800 + +# Uninstall default pytorch +# reinstall pytorch with the right extensions... +RUN milabench install --config $MILABENCH_CONFIG --base $MILABENCH_BASE $MILABENCH_ARGS &&\ + /bin/bash -c "source $BENCHMARK_VENV/torch/bin/activate && pip uninstall torch torchvision torchaudio" &&\ + /bin/bash -c "source $BENCHMARK_VENV/torch/bin/activate && pip install torch torchvision torchaudio intel-extension-for-pytorch oneccl_bind_pt intel-extension-for-pytorch-deepspeed --index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/" &&\ + python -m pip cache purge + +CMD ["milabench", "run"] diff --git a/milabench/_version.py b/milabench/_version.py index 23cf810bc..dcf8c9247 100644 --- a/milabench/_version.py +++ b/milabench/_version.py @@ -1,5 +1,5 @@ """This file is generated, do not modify""" -__tag__ = "v0.1.0-38-gfb01d691" -__commit__ = "fb01d691aa0d88717dcb3fea8852f61e111cc75f" -__date__ = "2024-08-01 18:59:13 -0400" +__tag__ = "508240b" +__commit__ = "508240b96a3dc0f10aa2c1a06b34e0b5373b9a67" +__date__ = "2024-08-05 15:16:58 -0400"