forked from tensorflow/tensorflow
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2625 from ROCm/r2.14-add-ub22
[r2.14-rocm-enhanced] add ub22; unify Python install scripts
- Loading branch information
Showing
14 changed files
with
310 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 0 additions & 55 deletions
55
tensorflow/tools/tf_sig_build_dockerfiles/Dockerfile.rocm.rt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Dockerfile.rocm.rt.ub20 |
55 changes: 55 additions & 0 deletions
55
tensorflow/tools/tf_sig_build_dockerfiles/Dockerfile.rocm.rt.ub20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
################################################################################ | ||
ARG DISTRO_IMG | ||
FROM ${DISTRO_IMG:-'ubuntu:20.04'} as runtime | ||
################################################################################ | ||
|
||
# Install dependencies | ||
COPY setup.packages.sh /setup.packages.sh | ||
COPY runtime.packages.txt /runtime.packages.txt | ||
COPY sles.runtime.packages.txt /sles.runtime.packages.txt | ||
RUN /setup.packages.sh /runtime.packages.txt | ||
|
||
# Install ROCM | ||
ARG TF_PKGS_DIR=tmp/packages | ||
ARG TENSORFLOW_PACKAGE=tf_nightly_rocm | ||
ARG ROCM_VERSION=6.1.2 | ||
ARG CUSTOM_INSTALL | ||
ARG ROCM_PATH=/opt/rocm-${ROCM_VERSION} | ||
ENV ROCM_PATH=${ROCM_PATH} | ||
COPY ${TF_PKGS_DIR}/${TENSORFLOW_PACKAGE} /${TF_PKGS_DIR}/${TENSORFLOW_PACKAGE} | ||
COPY ${CUSTOM_INSTALL} /${CUSTOM_INSTALL} | ||
COPY setup.rocm.sh /setup.rocm.sh | ||
COPY devel.packages.rocm.txt /devel.packages.rocm.txt | ||
COPY sles.devel.packages.rocm.txt /sles.devel.packages.rocm.txt | ||
RUN /setup.rocm.sh $ROCM_VERSION focal | ||
|
||
# All lines past this point are reset when $CACHEBUSTER is set. We need this | ||
# for Python specifically because we install some nightly packages which are | ||
# likely to change daily. | ||
ARG CACHEBUSTER=0 | ||
RUN echo $CACHEBUSTER | ||
|
||
# Setup Python environment. PYTHON_VERSION is e.g. "python3.8" | ||
ARG PYTHON_VERSION | ||
COPY setup.python.sh /setup.python.sh | ||
COPY devel.requirements.txt /devel.requirements.txt | ||
RUN /setup.python.sh $PYTHON_VERSION devel.requirements.txt true | ||
|
||
# Setup ENV variables for tensorflow pip build | ||
ENV TF_NEED_ROCM=1 | ||
ENV TF_ROCM_GCC=1 | ||
ENV ROCM_TOOLKIT_PATH=${ROCM_PATH} | ||
|
||
RUN pip install --no-cache-dir /${TF_PKGS_DIR}/${TENSORFLOW_PACKAGE} | ||
RUN echo 'ALL ALL=NOPASSWD:ALL' | tee /etc/sudoers.d/sudo-nopasswd | ||
|
||
ARG TF_TESTING_FL | ||
ENV TF_TESTING_FL=${TF_TESTING_FL} | ||
ARG DWLD_TF_SRC_CMD | ||
RUN if [ -n "${DWLD_TF_SRC_CMD}" ]; then eval "${DWLD_TF_SRC_CMD}"; fi | ||
RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64 -O /usr/local/bin/bazel && \ | ||
chmod +x /usr/local/bin/bazel | ||
RUN git clone https://github.com/tensorflow/models.git | ||
RUN git clone https://github.com/tensorflow/examples.git | ||
RUN git clone https://github.com/tensorflow/autograph.git | ||
RUN git clone https://github.com/tensorflow/benchmarks.git |
55 changes: 55 additions & 0 deletions
55
tensorflow/tools/tf_sig_build_dockerfiles/Dockerfile.rocm.rt.ub22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
################################################################################ | ||
ARG DISTRO_IMG | ||
FROM ${DISTRO_IMG:-'ubuntu:22.04'} as runtime | ||
################################################################################ | ||
|
||
# Install dependencies | ||
COPY setup.packages.sh /setup.packages.sh | ||
COPY runtime.packages.txt /runtime.packages.txt | ||
COPY sles.runtime.packages.txt /sles.runtime.packages.txt | ||
RUN /setup.packages.sh /runtime.packages.txt | ||
|
||
# Install ROCM | ||
ARG TF_PKGS_DIR=tmp/packages | ||
ARG TENSORFLOW_PACKAGE=tf_nightly_rocm | ||
ARG ROCM_VERSION=6.1.2 | ||
ARG CUSTOM_INSTALL | ||
ARG ROCM_PATH=/opt/rocm-${ROCM_VERSION} | ||
ENV ROCM_PATH=${ROCM_PATH} | ||
COPY ${TF_PKGS_DIR}/${TENSORFLOW_PACKAGE} /${TF_PKGS_DIR}/${TENSORFLOW_PACKAGE} | ||
COPY ${CUSTOM_INSTALL} /${CUSTOM_INSTALL} | ||
COPY setup.rocm.sh /setup.rocm.sh | ||
COPY devel.packages.rocm.txt /devel.packages.rocm.txt | ||
COPY sles.devel.packages.rocm.txt /sles.devel.packages.rocm.txt | ||
RUN /setup.rocm.sh $ROCM_VERSION jammy | ||
|
||
# All lines past this point are reset when $CACHEBUSTER is set. We need this | ||
# for Python specifically because we install some nightly packages which are | ||
# likely to change daily. | ||
ARG CACHEBUSTER=0 | ||
RUN echo $CACHEBUSTER | ||
|
||
# Setup Python environment. PYTHON_VERSION is e.g. "python3.8" | ||
ARG PYTHON_VERSION | ||
COPY setup.python.sh /setup.python.sh | ||
COPY devel.requirements.txt /devel.requirements.txt | ||
RUN /setup.python.sh $PYTHON_VERSION devel.requirements.txt true | ||
|
||
# Setup ENV variables for tensorflow pip build | ||
ENV TF_NEED_ROCM=1 | ||
ENV TF_ROCM_GCC=1 | ||
ENV ROCM_TOOLKIT_PATH=${ROCM_PATH} | ||
|
||
RUN pip install --no-cache-dir /${TF_PKGS_DIR}/${TENSORFLOW_PACKAGE} | ||
RUN echo 'ALL ALL=NOPASSWD:ALL' | tee /etc/sudoers.d/sudo-nopasswd | ||
|
||
ARG TF_TESTING_FL | ||
ENV TF_TESTING_FL=${TF_TESTING_FL} | ||
ARG DWLD_TF_SRC_CMD | ||
RUN if [ -n "${DWLD_TF_SRC_CMD}" ]; then eval "${DWLD_TF_SRC_CMD}"; fi | ||
RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64 -O /usr/local/bin/bazel && \ | ||
chmod +x /usr/local/bin/bazel | ||
RUN git clone https://github.com/tensorflow/models.git | ||
RUN git clone https://github.com/tensorflow/examples.git | ||
RUN git clone https://github.com/tensorflow/autograph.git | ||
RUN git clone https://github.com/tensorflow/benchmarks.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
tensorflow/tools/tf_sig_build_dockerfiles/Dockerfile.rocm.ub22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
################################################################################ | ||
FROM ubuntu:22.04 | ||
################################################################################ | ||
|
||
ARG GPU_DEVICE_TARGETS="gfx908 gfx90a gfx940 gfx941 gfx942 gfx1030 gfx1100" | ||
ENV GPU_DEVICE_TARGETS=${GPU_DEVICE_TARGETS} | ||
|
||
# Install build dependencies | ||
COPY setup.packages.sh setup.packages.sh | ||
COPY builder.packages.txt builder.packages.txt | ||
RUN /setup.packages.sh /builder.packages.txt | ||
|
||
# Install ROCM | ||
ARG ROCM_VERSION=6.1.2 | ||
ARG CUSTOM_INSTALL | ||
ARG ROCM_PATH=/opt/rocm-${ROCM_VERSION} | ||
ENV ROCM_PATH=${ROCM_PATH} | ||
COPY ${CUSTOM_INSTALL} /${CUSTOM_INSTALL} | ||
COPY setup.rocm.sh /setup.rocm.sh | ||
COPY devel.packages.rocm.txt /devel.packages.rocm.txt | ||
RUN /setup.rocm.sh $ROCM_VERSION jammy | ||
|
||
# Install various tools. | ||
# - bats: bash unit testing framework | ||
# - bazelisk: always use the correct bazel version | ||
# - buildifier: clean bazel build deps | ||
# - buildozer: clean bazel build deps | ||
# - gcloud SDK: communicate with Google Cloud Platform (GCP) for RBE, CI | ||
RUN git clone --branch v1.7.0 https://github.com/bats-core/bats-core.git && bats-core/install.sh /usr/local && rm -rf bats-core | ||
RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64 -O /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel | ||
RUN wget https://github.com/bazelbuild/buildtools/releases/download/3.5.0/buildifier -O /usr/local/bin/buildifier && chmod +x /usr/local/bin/buildifier | ||
RUN wget https://github.com/bazelbuild/buildtools/releases/download/3.5.0/buildozer -O /usr/local/bin/buildozer && chmod +x /usr/local/bin/buildozer | ||
RUN curl -sSL https://sdk.cloud.google.com > /tmp/gcloud && bash /tmp/gcloud --install-dir=~/usr/local/bin --disable-prompts | ||
|
||
|
||
# All lines past this point are reset when $CACHEBUSTER is set. We need this | ||
# for Python specifically because we install some nightly packages which are | ||
# likely to change daily. | ||
ARG CACHEBUSTER=0 | ||
RUN echo $CACHEBUSTER | ||
|
||
# Setup Python environment. PYTHON_VERSION is e.g. "python3.8" | ||
ARG PYTHON_VERSION | ||
COPY setup.python.sh /setup.python.sh | ||
COPY devel.requirements.txt /devel.requirements.txt | ||
RUN /setup.python.sh $PYTHON_VERSION devel.requirements.txt | ||
|
||
ARG TF_WHEEL_URL | ||
RUN if [ -n "${TF_WHEEL_URL}" ]; then pip install "${TF_WHEEL_URL}"; fi | ||
ARG DWLD_TF_SRC_CMD | ||
RUN if [ -n "${DWLD_TF_SRC_CMD}" ]; then eval "${DWLD_TF_SRC_CMD}"; fi | ||
|
||
# Setup build and environment | ||
COPY devel.usertools /usertools | ||
COPY devel.bashrc /root/.bashrc | ||
|
||
# Setup ENV variables for tensorflow pip build | ||
ENV TF_NEED_ROCM=1 | ||
ENV TF_ROCM_GCC=1 | ||
ENV ROCM_TOOLKIT_PATH=${ROCM_PATH} | ||
|
||
# Don't use the bazel cache when a new docker image is created. | ||
RUN echo build --action_env=DOCKER_CACHEBUSTER=$(date +%s%N)$RANDOM >> /etc/bazel.bazelrc | ||
RUN echo build --host_action_env=DOCKER_HOST_CACHEBUSTER=$(date +%s%N)$RANDOM >> /etc/bazel.bazelrc | ||
|
||
ARG TF_TESTING_FL | ||
ENV TF_TESTING_FL=${TF_TESTING_FL} | ||
ARG DWLD_TF_SRC_CMD | ||
RUN if [ -n "${DWLD_TF_SRC_CMD}" ]; then eval "${DWLD_TF_SRC_CMD}"; fi | ||
ARG CLONE_TEST_REPO | ||
COPY ${CLONE_TEST_REPO} /${CLONE_TEST_REPO} | ||
RUN if [ -n "${CLONE_TEST_REPO}" ]; then bash /${CLONE_TEST_REPO}; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.