fix: tf version

This commit is contained in:
2024-09-11 00:06:41 -07:00
parent ab28ff6aee
commit 2c69d563be
+15 -5
View File
@@ -2,9 +2,9 @@ ARG ROCM_VERSION="5.7.3"
FROM wtongze/rocm-base:${ROCM_VERSION} FROM wtongze/rocm-base:${ROCM_VERSION}
ARG TENSORFLOW_BRANCH="r2.11-rocm-enhanced" ARG TENSORFLOW_BRANCH="r2.12-rocm-enhanced"
ARG PYTHON_VERSION="3.11" ARG PYTHON_VERSION="3.11"
ARG NUMPY_VERSION="1.22.4" ARG NUMPY_VERSION="1.24.3"
ARG HIP_ARCH="gfx803;gfx900" ARG HIP_ARCH="gfx803;gfx900"
ARG DEBIAN_FRONTEND="noninteractive" ARG DEBIAN_FRONTEND="noninteractive"
@@ -17,6 +17,14 @@ RUN sudo wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/rel
WORKDIR /home/rocm WORKDIR /home/rocm
RUN git clone --depth 1 https://github.com/ROCm/tensorflow-upstream.git -b ${TENSORFLOW_BRANCH} tensorflow RUN git clone --depth 1 https://github.com/ROCm/tensorflow-upstream.git -b ${TENSORFLOW_BRANCH} tensorflow
# For ROCm 4.5+
RUN <<EOF
sudo apt-get update
sudo apt-get install -y rocm-ml-sdk rocm-hip-sdk
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
EOF
RUN <<EOF RUN <<EOF
sudo apt-get update sudo apt-get update
sudo apt install -y software-properties-common sudo apt install -y software-properties-common
@@ -31,14 +39,16 @@ WORKDIR /home/rocm/tensorflow
# TODO: simplify dependencies # TODO: simplify dependencies
# > Ref: https://github.com/ROCm/ROCm/issues/1880#issuecomment-1547838227 # > Ref: https://github.com/ROCm/ROCm/issues/1880#issuecomment-1547838227
# RUN python${PYTHON_VERSION} -m ensurepip --upgrade RUN python${PYTHON_VERSION} -m ensurepip --upgrade
RUN python${PYTHON_VERSION} -m pip install -U --user numpy==${NUMPY_VERSION} wheel packaging requests opt_einsum patchelf RUN python${PYTHON_VERSION} -m pip install -U --user numpy==${NUMPY_VERSION} wheel packaging requests opt_einsum patchelf
RUN python${PYTHON_VERSION} -m pip install -U --user keras_preprocessing --no-deps RUN python${PYTHON_VERSION} -m pip install -U --user keras_preprocessing --no-deps
RUN sed -i "s/python3/python${PYTHON_VERSION}/g" build_rocm_python3 RUN sed -i -e "s/python3/python${PYTHON_VERSION}/g" -e "s/pip3/python${PYTHON_VERSION} -m pip/g" build_rocm_python3
RUN sudo ln -s /usr/bin/python${PYTHON_VERSION} /usr/bin/python RUN sudo ln -s /usr/bin/python${PYTHON_VERSION} /usr/bin/python
RUN ./build_rocm_python3 /opt/rocm ENV ROCM_PATH=/opt/rocm-${ROCM_VERSION}
ENV ROCM_TOOLKIT_PATH=/opt/rocm-${ROCM_VERSION}
RUN ./build_rocm_python3 /opt/rocm-${ROCM_VERSION}
WORKDIR /tmp/tensorflow_pkg WORKDIR /tmp/tensorflow_pkg
RUN cp (ls -l tensorflow*.whl | awk '{ print $9 }' | tail -n1 | tr -d '\n') /home/rocm/tensorflow-rocm.whl RUN cp (ls -l tensorflow*.whl | awk '{ print $9 }' | tail -n1 | tr -d '\n') /home/rocm/tensorflow-rocm.whl