mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-29 03:30:52 +00:00
### Description 1. As a follow-up of #16761, this PR allows build ORT on iOS/Android without the need to explicitly specify a protoc path. #16761 is for WASM. This one is for iOS/Android 2. Update the MacOS/Linux build scripts that build/install protobuf from source. Make them be more flexible. Add the support for RedHatEnterprise(ubi), which will needed for upgrading the base image from centos:7 to ubi:8. 3. Update tools/ci_build/github/pai/rocm-ci-pipeline-env.Dockerfile : the docker file's base image has preinstalled protobuf in /usr/local, we should uninstall them to avoid conflicts.
67 lines
2 KiB
Docker
67 lines
2 KiB
Docker
FROM rocm/cupy:rocm5.5.0_ubuntu20.04_py3.8_pytorch2.0.0_cupy13.0.0
|
|
|
|
|
|
RUN apt-get update -y && apt-get upgrade -y && apt-get autoremove -y libprotobuf\* protobuf-compiler\* && \
|
|
rm -f /usr/local/bin/protoc && apt-get install -y locales unzip && apt-get clean -y
|
|
RUN locale-gen en_US.UTF-8
|
|
RUN update-locale LANG=en_US.UTF-8
|
|
ENV LC_ALL C.UTF-8
|
|
ENV LANG C.UTF-8
|
|
|
|
WORKDIR /stage
|
|
|
|
# from rocm/pytorch's image, work around ucx's dlopen replacement conflicting with shared provider
|
|
RUN cd /opt/mpi_install/ucx/build &&\
|
|
make clean &&\
|
|
../contrib/configure-release --prefix=/opt/ucx --without-rocm &&\
|
|
make -j $(nproc) &&\
|
|
make install
|
|
|
|
# CMake
|
|
ENV CMAKE_VERSION=3.26.3
|
|
RUN cd /usr/local && \
|
|
wget -q -O - https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz | tar zxf -
|
|
ENV PATH=/usr/local/cmake-${CMAKE_VERSION}-linux-x86_64/bin:${PATH}
|
|
|
|
# ccache
|
|
RUN mkdir -p /tmp/ccache && \
|
|
cd /tmp/ccache && \
|
|
wget -q -O - https://github.com/ccache/ccache/releases/download/v4.7.4/ccache-4.7.4-linux-x86_64.tar.xz | tar --strip 1 -J -xf - && \
|
|
cp /tmp/ccache/ccache /usr/bin && \
|
|
rm -rf /tmp/ccache
|
|
|
|
RUN apt-get update && apt-get install -y cifs-utils
|
|
|
|
# rocm-ci branch contains instrumentation needed for loss curves and perf
|
|
RUN git clone https://github.com/microsoft/huggingface-transformers.git &&\
|
|
cd huggingface-transformers &&\
|
|
git checkout rocm-ci &&\
|
|
pip install -e .
|
|
|
|
RUN pip install \
|
|
numpy==1.24.1 \
|
|
onnx \
|
|
cerberus \
|
|
sympy \
|
|
h5py \
|
|
datasets==1.9.0 \
|
|
requests \
|
|
sacrebleu==1.5.1 \
|
|
sacremoses \
|
|
scipy==1.10.0 \
|
|
scikit-learn \
|
|
tokenizers \
|
|
sentencepiece \
|
|
dill==0.3.4 \
|
|
wget \
|
|
pytorch_lightning==1.6.0 \
|
|
pytest-xdist \
|
|
pytest-rerunfailures
|
|
|
|
RUN pip install torch-ort --no-dependencies
|
|
ENV ORTMODULE_ONNX_OPSET_VERSION=15
|
|
|
|
ARG BUILD_UID=1001
|
|
ARG BUILD_USER=onnxruntimedev
|
|
RUN adduser --uid $BUILD_UID $BUILD_USER
|
|
WORKDIR /home/$BUILD_USER
|