diff --git a/benchmarks/accelerate_opt/benchfile.py b/benchmarks/accelerate_opt/benchfile.py index c9ebecd37..c19c64b63 100644 --- a/benchmarks/accelerate_opt/benchfile.py +++ b/benchmarks/accelerate_opt/benchfile.py @@ -70,9 +70,16 @@ async def run(self): # XXX: this doesn't participate in the process timeout for i, worker in enumerate(self.config.get('worker_addrs', [])): command = ["docker", "run", "-i", "--rm", + "--ipc", "host", "--network", "host", - "--privileged", - "--gpus", "all"] + "--privileged"] + if self.config['arch'] == 'cuda': + command.extend(["--gpus", "all"]) + elif self.config['arch'] == 'rocm': + command.extend(["--security-opt", "seccomp=unconfined", + "--group-add", "video", + "-v", "/opt/amdgpu/share/libdrm/amdgpu.ids:/opt/amdgpu/share/libdrm/amdgpu.ids", + "-v", "/opt/rocm:/opt/rocm"]) env = self.make_env() for var in ('MILABENCH_CONFIG', 'XDG_CACHE_HOME', 'OMP_NUM_THREADS'): command.append("--env") diff --git a/docker/Dockerfile-rocm b/docker/Dockerfile-rocm index b6593de7b..04a82c5fd 100644 --- a/docker/Dockerfile-rocm +++ b/docker/Dockerfile-rocm @@ -8,7 +8,7 @@ ENV MILABENCH_GPU_ARCH=$ARCH ARG CONFIG=standard.yaml ENV MILABENCH_CONFIG_NAME=$CONFIG - +ENV MILABENCH_DOCKER=1 # Paths # ----- @@ -35,22 +35,23 @@ COPY . /milabench/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 &&\ +# Use ofed_info -s to get your local version +ARG MOFED_VERSION=5.4-3.4.0.0 + +RUN apt-get update -y &&\ + apt-get install -y git build-essential curl python3 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 &&\ + apt-get install -y libibverbs1 &&\ apt-get clean &&\ rm -rf /var/lib/apt/lists/* +# Install Rust + 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 # -----------------