Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker params for the rocm case to the multi-node test #126

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions benchmarks/accelerate_opt/benchfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
23 changes: 12 additions & 11 deletions docker/Dockerfile-rocm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ENV MILABENCH_GPU_ARCH=$ARCH

ARG CONFIG=standard.yaml
ENV MILABENCH_CONFIG_NAME=$CONFIG

ENV MILABENCH_DOCKER=1

# Paths
# -----
Expand All @@ -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
# -----------------
Expand Down