mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Abjindal/eager mode pipeline (#8870)
* Adding pipeline file for eager mode * adding the build eager mode flag * adding torch wheel files for installation * Changing pytorch version for change in wheel files * updating requirements file path * Removing Java and NodeJS from the build * removing import torch for testing build of eager mode * changing the build command * import torch * building eager mode separately * removing Java tests * python path issues * changing python path location * changing the build path file loc * installing torch before build * setting environment for building eager mode * Copying the build file and getting rid of flags * changing python path * adding missing packages * moving build eager mode code * changing python path to python3 * adding amd_hipify * adding logger file * install torch before build * change requirements file location * install torch before build eager * modifying eager mode build * modifying build location * adding new docker image * handling gradle move issue * Typo fix * changing deps file * adding java and nodejs * changing repo name for docker image * removing pybind * building only eager mode * changing the image name * removing install wheel package * build complete onnxruntime with eager mode * building wheel * enabling pybind * adding build eager mode flag in unit tests * removing build java nodejs * adding build command * removing java tests * moving Debug tests before Release * building Debug only case * changing debug test code * running the build eager mode with tests * adding build dir * adding build dir path * changing build dir path * changing build command for eager mode * building eager mode and running tests simultaneously * adding more flags to the pipeline * chaning flag * adding Debug and Release * changing torch to nightly build * changing torch version for nightly build * chaning torch version * move to Ubuntu image * adding pool * adding dockerfile for eager mode * adding python deps file for eager * modifying python deps file for eager * changing deps file * changing deps file statements * changing python path * REMOVING ECHO line * going to original docker file * changing docker file * changing to eager requirements file * changing python deps file * changing paths * changing cmake path * changing build script * changing python installation * running debug mode only * changing pipeline file * test name * test name * test name2 * changing requirements file * final flags for eager mode * previous pipeline * moving to ubuntu image and including some deps * adding cmake path * returning to manylinux image * removing unncecessary files for pipeline
This commit is contained in:
parent
6df4e293ff
commit
868c8af9ac
4 changed files with 171 additions and 0 deletions
|
|
@ -0,0 +1,45 @@
|
|||
jobs:
|
||||
- job: Linux_Build
|
||||
timeoutInMinutes: 120
|
||||
workspace:
|
||||
clean: all
|
||||
pool: Linux-CPU-2019
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
submodules: recursive
|
||||
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '12.16.3'
|
||||
|
||||
- template: templates/get-docker-image-steps.yml
|
||||
parameters:
|
||||
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_eager_cpu
|
||||
Context: tools/ci_build/github/linux/docker
|
||||
DockerBuildArgs: "--build-arg BUILD_UID=$( id -u )"
|
||||
Repository: onnxruntimecpubuildeagermode
|
||||
|
||||
- task: CmdLine@2
|
||||
displayName: 'build'
|
||||
inputs:
|
||||
script: |
|
||||
mkdir -p $HOME/.onnx
|
||||
docker run --rm \
|
||||
--volume /data/onnx:/data/onnx:ro \
|
||||
--volume $(Build.SourcesDirectory):/onnxruntime_src \
|
||||
--volume $(Build.BinariesDirectory):/build \
|
||||
--volume $HOME/.onnx:/home/onnxruntimedev/.onnx \
|
||||
-e ALLOW_RELEASED_ONNX_OPSET_ONLY=0 \
|
||||
-e NIGHTLY_BUILD \
|
||||
-e BUILD_BUILDNUMBER \
|
||||
onnxruntimecpubuildeagermode \
|
||||
/opt/python/cp38-cp38/bin/python3 /onnxruntime_src/tools/ci_build/build.py \
|
||||
--build_dir /build --cmake_generator Ninja \
|
||||
--config Debug Release \
|
||||
--skip_submodule_sync \
|
||||
--build_shared_lib \
|
||||
--parallel \
|
||||
--build_eager_mode --enable_training --enable_pybind
|
||||
workingDirectory: $(Build.SourcesDirectory)
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
FROM quay.io/pypa/manylinux2014_x86_64:latest
|
||||
|
||||
ENV PATH /usr/local/gradle/bin:/opt/rh/devtoolset-10/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
ADD scripts /tmp/scripts
|
||||
RUN yum remove -y devtoolset\* && yum install -y devtoolset-10-binutils devtoolset-10-gcc devtoolset-10-gcc-c++ devtoolset-10-gcc-gfortran && cd /tmp/scripts && /tmp/scripts/manylinux/install_centos.sh && /tmp/scripts/manylinux/install_deps_eager.sh && rm -rf /tmp/scripts
|
||||
|
||||
ARG BUILD_UID=1001
|
||||
ARG BUILD_USER=onnxruntimedev
|
||||
RUN adduser --uid $BUILD_UID $BUILD_USER
|
||||
WORKDIR /home/$BUILD_USER
|
||||
USER $BUILD_USER
|
||||
|
||||
109
tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh
Executable file
109
tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh
Executable file
|
|
@ -0,0 +1,109 @@
|
|||
#!/bin/bash
|
||||
set -e -x
|
||||
|
||||
# Development tools and libraries
|
||||
yum -y install \
|
||||
graphviz
|
||||
|
||||
# Download a file from internet
|
||||
function GetFile {
|
||||
local uri=$1
|
||||
local path=$2
|
||||
local force=${3:-false}
|
||||
local download_retries=${4:-5}
|
||||
local retry_wait_time_seconds=${5:-30}
|
||||
|
||||
if [[ -f $path ]]; then
|
||||
if [[ $force = false ]]; then
|
||||
echo "File '$path' already exists. Skipping download"
|
||||
return 0
|
||||
else
|
||||
rm -rf $path
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -f $uri ]]; then
|
||||
echo "'$uri' is a file path, copying file to '$path'"
|
||||
cp $uri $path
|
||||
return $?
|
||||
fi
|
||||
|
||||
echo "Downloading $uri"
|
||||
# Use aria2c if available, otherwise use curl
|
||||
if command -v aria2c > /dev/null; then
|
||||
aria2c -q -d $(dirname $path) -o $(basename $path) "$uri"
|
||||
else
|
||||
curl "$uri" -sSL --retry $download_retries --retry-delay $retry_wait_time_seconds --create-dirs -o "$path" --fail
|
||||
fi
|
||||
|
||||
return $?
|
||||
}
|
||||
|
||||
if [ ! -d "/opt/conda/bin" ]; then
|
||||
PYTHON_EXES=("/opt/python/cp36-cp36m/bin/python3.6" "/opt/python/cp37-cp37m/bin/python3.7" "/opt/python/cp38-cp38/bin/python3.8" "/opt/python/cp39-cp39/bin/python3.9")
|
||||
else
|
||||
PYTHON_EXES=("/opt/conda/bin/python")
|
||||
fi
|
||||
|
||||
os_major_version=$(cat /etc/redhat-release | tr -dc '0-9.'|cut -d \. -f1)
|
||||
|
||||
SYS_LONG_BIT=$(getconf LONG_BIT)
|
||||
mkdir -p /tmp/src
|
||||
GLIBC_VERSION=$(getconf GNU_LIBC_VERSION | cut -f 2 -d \.)
|
||||
|
||||
DISTRIBUTOR=$(lsb_release -i -s)
|
||||
|
||||
if [[ "$DISTRIBUTOR" = "CentOS" && $SYS_LONG_BIT = "64" ]]; then
|
||||
LIBDIR="lib64"
|
||||
else
|
||||
LIBDIR="lib"
|
||||
fi
|
||||
|
||||
cd /tmp/src
|
||||
|
||||
echo "Installing azcopy"
|
||||
mkdir -p /tmp/azcopy
|
||||
GetFile https://aka.ms/downloadazcopy-v10-linux /tmp/azcopy/azcopy.tar.gz
|
||||
tar --strip 1 -xf /tmp/azcopy/azcopy.tar.gz -C /tmp/azcopy
|
||||
cp /tmp/azcopy/azcopy /usr/bin
|
||||
|
||||
echo "Installing Ninja"
|
||||
GetFile https://github.com/ninja-build/ninja/archive/v1.10.0.tar.gz /tmp/src/ninja-linux.tar.gz
|
||||
tar -zxf ninja-linux.tar.gz
|
||||
cd ninja-1.10.0
|
||||
cmake -Bbuild-cmake -H.
|
||||
cmake --build build-cmake
|
||||
mv ./build-cmake/ninja /usr/bin
|
||||
echo "Installing Node.js"
|
||||
GetFile https://nodejs.org/dist/v12.16.3/node-v12.16.3-linux-x64.tar.gz /tmp/src/node-v12.16.3-linux-x64.tar.gz
|
||||
tar --strip 1 -xf /tmp/src/node-v12.16.3-linux-x64.tar.gz -C /usr
|
||||
|
||||
cd /tmp/src
|
||||
GetFile https://downloads.gradle-dn.com/distributions/gradle-6.3-bin.zip /tmp/src/gradle-6.3-bin.zip
|
||||
unzip /tmp/src/gradle-6.3-bin.zip
|
||||
# rm -rf /usr/local/gradle/*
|
||||
mv /tmp/src/gradle-6.3 /usr/local/gradle
|
||||
|
||||
if ! [ -x "$(command -v protoc)" ]; then
|
||||
source ${0/%install_deps_eager.sh/..\/install_protobuf.sh}
|
||||
fi
|
||||
|
||||
export ONNX_ML=1
|
||||
export CMAKE_ARGS="-DONNX_GEN_PB_TYPE_STUBS=OFF -DONNX_WERROR=OFF"
|
||||
|
||||
for PYTHON_EXE in "${PYTHON_EXES[@]}"
|
||||
do
|
||||
${PYTHON_EXE} -m pip install -r ${0/%install_deps_eager\.sh/requirements\.txt}
|
||||
${PYTHON_EXE} -m pip install -r ${0/%install_deps_eager\.sh/..\/training\/ortmodule\/stage1\/requirements_torch_eager_cpu.txt}
|
||||
done
|
||||
|
||||
cd /tmp/src
|
||||
GetFile 'https://sourceware.org/pub/valgrind/valgrind-3.16.1.tar.bz2' /tmp/src/valgrind-3.16.1.tar.bz2
|
||||
tar -jxvf valgrind-3.16.1.tar.bz2
|
||||
cd valgrind-3.16.1
|
||||
./configure --prefix=/usr --libdir=/usr/lib64 --enable-only64bit --enable-tls
|
||||
make -j$(getconf _NPROCESSORS_ONLN)
|
||||
make install
|
||||
|
||||
cd /
|
||||
rm -rf /tmp/src
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
--pre
|
||||
-f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
|
||||
torch>=1.9.0
|
||||
setuptools>=41.4.0
|
||||
Loading…
Reference in a new issue