onnxruntime/dockerfiles/Dockerfile.migraphx
Shucai Xiao bfc888613f
Migraphx improvements (#4328)
* Add amd migraphx execution provider to onnx runtime

* rename MiGraphX to MIGraphX

* add migraphx EP to tests

* support multiple program output

* disable more tests

* backup changes related to program multiple outputs

* remove logging code

* remove unnecessary changes in migraphx_execution_provider.cc

* add migraphx EP to tests

* add input requests of the batchnorm operator

* add to support an onnx operator PRelu

* update migrapx dockerfile and removed one unused line

* chagnes related to support dynamic input shape

* fix build error

* code backup

* code backup

* version that has 106 models run correctly

* code backup

* code backup

* remove unnecessary print info

* code backup

* code backup

* code backup

* code backup

* code backup

* code backup

* changes corresponding to migraphx change

* fix merge conflict

* minor code cleanup

* code cleanup

* remove unnecessary code

* remove unnecessary code

* add to support more constant folding analysis

* more constant folding checking for shape input

* add env var to control whether fp16 is enabled. Modify docker file to use ROCM3.3

* fix function name to avoid build error

* add build and execution instruction for migraphx execution provider

* added more build instructions

* fixed a small format error

* a minor change

* fix review comments

* another minor change

* additional refinement of the documents

* additional changes

* remove unnecessary changes in the dockfile

* additional changes for the dockerfile

* code change backup

* fix errors related to a few unit tests

* fix a build error related to api change

* fix unit test errors by either disabling the test or fix related isssues

* remove unnecessary log info

* sync submodule tvm with master

* remove unnecessary changes

* remove an unnecessary code line

* refine documents for addition example
2020-06-25 19:22:57 -07:00

53 lines
2.4 KiB
Text

# --------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------
# Dockerfile to run ONNXRuntime with MIGraphX integration
#--------------------------------------------------------------------------
FROM ubuntu:16.04
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
ARG ONNXRUNTIME_BRANCH=master
ENV DEBIAN_FRONTEND noninteractive
ENV MIGRAPHX_DISABLE_FAST_GELU=1
RUN apt-get clean && apt-get update && apt-get install -y locales
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
# Install rocm
RUN apt-get update && apt-get install -y --no-install-recommends curl && \
curl -sL http://repo.radeon.com/rocm/apt/debian/rocm.gpg.key | apt-key add - && \
sh -c 'echo deb [arch=amd64] http://repo.radeon.com/rocm/apt/3.3/ xenial main > /etc/apt/sources.list.d/rocm.list'
RUN apt-get update &&\
apt-get install -y sudo git bash build-essential cmake libpython3.5-dev python3-pip miopen-hip rocblas half
# Install rbuild
RUN pip3 install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz
# Install MIGraphX from source
RUN mkdir -p /migraphx
RUN cd /migraphx && git clone --depth=1 --branch migraphx_for_ort https://github.com/ROCmSoftwarePlatform/AMDMIGraphX src
RUN cd /migraphx && rbuild package --cxx /opt/rocm/bin/hcc -d /migraphx/deps -B /migraphx/build -S /migraphx/src/ -DPYTHON_EXECUTABLE=/usr/bin/python3
RUN dpkg -i /migraphx/build/*.deb
RUN rm -rf /migraphx
WORKDIR /code
ENV PATH /opt/miniconda/bin:/code/cmake-3.14.3-Linux-x86_64/bin:${PATH}
# Workaround for broken cmake in hip's binary package
RUN sed -i -e 's/hcc::hccrt;hcc::hc_am//g' /opt/rocm/hip/lib/cmake/hip/hip-targets-release.cmake
ENV CXXFLAGS "-D__HIP_PLATFORM_HCC__=1"
# Prepare onnxruntime repository & build onnxruntime
RUN git clone --single-branch --branch ${ONNXRUNTIME_BRANCH} --recursive ${ONNXRUNTIME_REPO} onnxruntime &&\
/bin/sh onnxruntime/dockerfiles/scripts/install_common_deps.sh &&\
cd onnxruntime &&\
/bin/sh ./build.sh --config Release --build_wheel --update --build --parallel --cmake_extra_defines ONNXRUNTIME_VERSION=$(cat ./VERSION_NUMBER) --use_migraphx &&\
pip install /code/onnxruntime/build/Linux/Release/dist/*.whl &&\
cd .. &&\
rm -rf onnxruntime cmake-3.14.3-Linux-x86_64