This commit is contained in:
Mark Hillebrand 2016-10-27 12:46:02 +02:00
Родитель 9f8f87c896
Коммит 72b28630fd
4 изменённых файлов: 469 добавлений и 469 удалений

312
Dependencies/CNTKCustomMKL/build-windows.cmd поставляемый
Просмотреть файл

@ -1,156 +1,156 @@
@echo off
REM
REM Copyright (c) Microsoft. All rights reserved.
REM
REM Licensed under the MIT license. See LICENSE.md file in the project root
REM for full license information.
REM ==============================================================================
REM
echo.
echo This batch file will build a custom MKL dynamic link library for usage by CNTK.
echo.
echo Requirements:
echo - Intel MKL SDK installed on the machine
echo - MKLROOT environment variable is set to the MKL directory inside the Intel MKL SDK
echo - Visual Studio 2013 installed and included in the path
echo.
setlocal enableextensions enabledelayedexpansion
pushd "%~dp0"
if errorlevel 1 (
echo Could not change directory to script location.
exit /b 1
)
if not defined MKLROOT (
echo Error: Environment variable MKLROOT is undefined.
exit /b 1
)
if not exist "%MKLROOT%" (
echo Error: Directory doesn't exist: "%MKLROOT%".
exit /b 1
)
set MKLBUILDERROOT=%MKLROOT%\tools\builder
if not exist "%MKLBUILDERROOT%" (
echo Error: Directory doesn't exist: "%MKLBUILDERROOT%".
exit /b 1
)
where /q nmake.exe
if errorlevel 1 (
echo Error: NMAKE.EXE not in path.
exit /b 1
)
where /q link.exe
if errorlevel 1 (
echo Error: LINK.EXE not in path.
exit /b 1
)
set /p CNTKCUSTOMMKLVERSION=<version.txt
if not defined CNTKCUSTOMMKLVERSION (
echo Cannot determine CNTK custom MKL version.
exit /b 1
)
if exist lib rmdir /s /q lib
if errorlevel 1 exit /b 1
if exist Publish rmdir /s /q Publish
if errorlevel 1 exit /b 1
mkdir Publish\%CNTKCUSTOMMKLVERSION%\x64
echo.
echo Copying "%MKLBUILDERROOT%\lib".
xcopy /s /e /y /i "%MKLBUILDERROOT%\lib" lib
if errorlevel 1 (
exit /b 1
)
echo.
echo Compiling and copying libraries.
for %%t in (
parallel
sequential
) do (
set TFIRSTCHAR=%%t
set TFIRSTCHAR=!TFIRSTCHAR:~0,1!
set LIBBASENAME=mkl_cntk_!TFIRSTCHAR!
echo.
echo Calling NMAKE libintel64 export=functions.txt threading=%%t name=!LIBBASENAME! MKLROOT="%MKLROOT%".
NMAKE /f "%MKLBUILDERROOT%\makefile" ^
libintel64 ^
export=functions.txt ^
threading=%%t ^
name=!LIBBASENAME! ^
MKLROOT="%MKLROOT%"
if errorlevel 1 (
echo Error: NMAKE.exe for threading=%%t failed.
exit /b 1
)
mkdir Publish\%CNTKCUSTOMMKLVERSION%\x64\%%t
if errorlevel 1 exit /b 1
move !LIBBASENAME!.dll Publish\%CNTKCUSTOMMKLVERSION%\x64\%%t
if errorlevel 1 exit /b 1
move !LIBBASENAME!.lib Publish\%CNTKCUSTOMMKLVERSION%\x64\%%t
if errorlevel 1 exit /b 1
del !LIBBASENAME!*
if errorlevel 1 exit /b 1
@REM TODO manifest?
)
echo.
echo Copying libiomp5md.dll.
copy "%MKLROOT%\..\redist\intel64_win\compiler\libiomp5md.dll" Publish\%CNTKCUSTOMMKLVERSION%\x64\parallel
if errorlevel 1 (
exit /b 1
)
echo.
echo Removing LIB directory.
rmdir /s /q lib
if errorlevel 1 exit /b 1
echo.
echo Copying include files to Publish\%CNTKCUSTOMMKLVERSION%\include.
mkdir Publish\%CNTKCUSTOMMKLVERSION%\include
for /f %%h in (headers.txt) do (
copy "%MKLROOT%\include\%%h" Publish\%CNTKCUSTOMMKLVERSION%\include
if errorlevel 1 (
echo Failed to copy "%MKLROOT%\include\%%h".
exit /b 1
)
)
copy README-for-redistributable.txt Publish\%CNTKCUSTOMMKLVERSION%\README.txt
if errorlevel 1 (
echo Failed to copy README.
exit /b 1
)
copy ..\..\LICENSE.md Publish\%CNTKCUSTOMMKLVERSION%
if errorlevel 1 (
echo Failed to copy LICENSE.md.
exit /b 1
)
popd
@echo off
REM
REM Copyright (c) Microsoft. All rights reserved.
REM
REM Licensed under the MIT license. See LICENSE.md file in the project root
REM for full license information.
REM ==============================================================================
REM
echo.
echo This batch file will build a custom MKL dynamic link library for usage by CNTK.
echo.
echo Requirements:
echo - Intel MKL SDK installed on the machine
echo - MKLROOT environment variable is set to the MKL directory inside the Intel MKL SDK
echo - Visual Studio 2013 installed and included in the path
echo.
setlocal enableextensions enabledelayedexpansion
pushd "%~dp0"
if errorlevel 1 (
echo Could not change directory to script location.
exit /b 1
)
if not defined MKLROOT (
echo Error: Environment variable MKLROOT is undefined.
exit /b 1
)
if not exist "%MKLROOT%" (
echo Error: Directory doesn't exist: "%MKLROOT%".
exit /b 1
)
set MKLBUILDERROOT=%MKLROOT%\tools\builder
if not exist "%MKLBUILDERROOT%" (
echo Error: Directory doesn't exist: "%MKLBUILDERROOT%".
exit /b 1
)
where /q nmake.exe
if errorlevel 1 (
echo Error: NMAKE.EXE not in path.
exit /b 1
)
where /q link.exe
if errorlevel 1 (
echo Error: LINK.EXE not in path.
exit /b 1
)
set /p CNTKCUSTOMMKLVERSION=<version.txt
if not defined CNTKCUSTOMMKLVERSION (
echo Cannot determine CNTK custom MKL version.
exit /b 1
)
if exist lib rmdir /s /q lib
if errorlevel 1 exit /b 1
if exist Publish rmdir /s /q Publish
if errorlevel 1 exit /b 1
mkdir Publish\%CNTKCUSTOMMKLVERSION%\x64
echo.
echo Copying "%MKLBUILDERROOT%\lib".
xcopy /s /e /y /i "%MKLBUILDERROOT%\lib" lib
if errorlevel 1 (
exit /b 1
)
echo.
echo Compiling and copying libraries.
for %%t in (
parallel
sequential
) do (
set TFIRSTCHAR=%%t
set TFIRSTCHAR=!TFIRSTCHAR:~0,1!
set LIBBASENAME=mkl_cntk_!TFIRSTCHAR!
echo.
echo Calling NMAKE libintel64 export=functions.txt threading=%%t name=!LIBBASENAME! MKLROOT="%MKLROOT%".
NMAKE /f "%MKLBUILDERROOT%\makefile" ^
libintel64 ^
export=functions.txt ^
threading=%%t ^
name=!LIBBASENAME! ^
MKLROOT="%MKLROOT%"
if errorlevel 1 (
echo Error: NMAKE.exe for threading=%%t failed.
exit /b 1
)
mkdir Publish\%CNTKCUSTOMMKLVERSION%\x64\%%t
if errorlevel 1 exit /b 1
move !LIBBASENAME!.dll Publish\%CNTKCUSTOMMKLVERSION%\x64\%%t
if errorlevel 1 exit /b 1
move !LIBBASENAME!.lib Publish\%CNTKCUSTOMMKLVERSION%\x64\%%t
if errorlevel 1 exit /b 1
del !LIBBASENAME!*
if errorlevel 1 exit /b 1
@REM TODO manifest?
)
echo.
echo Copying libiomp5md.dll.
copy "%MKLROOT%\..\redist\intel64_win\compiler\libiomp5md.dll" Publish\%CNTKCUSTOMMKLVERSION%\x64\parallel
if errorlevel 1 (
exit /b 1
)
echo.
echo Removing LIB directory.
rmdir /s /q lib
if errorlevel 1 exit /b 1
echo.
echo Copying include files to Publish\%CNTKCUSTOMMKLVERSION%\include.
mkdir Publish\%CNTKCUSTOMMKLVERSION%\include
for /f %%h in (headers.txt) do (
copy "%MKLROOT%\include\%%h" Publish\%CNTKCUSTOMMKLVERSION%\include
if errorlevel 1 (
echo Failed to copy "%MKLROOT%\include\%%h".
exit /b 1
)
)
copy README-for-redistributable.txt Publish\%CNTKCUSTOMMKLVERSION%\README.txt
if errorlevel 1 (
echo Failed to copy README.
exit /b 1
)
copy ..\..\LICENSE.md Publish\%CNTKCUSTOMMKLVERSION%
if errorlevel 1 (
echo Failed to copy LICENSE.md.
exit /b 1
)
popd

Просмотреть файл

@ -1,169 +1,169 @@
FROM nvidia/cuda:7.5-cudnn5-devel
RUN apt-get update && apt-get install -y --no-install-recommends \
autotools-dev \
build-essential \
cmake \
git \
gfortran-multilib \
libavcodec-dev \
libavformat-dev \
libjasper-dev \
libjpeg-dev \
libpng-dev \
liblapacke-dev \
libswscale-dev \
libtiff-dev \
pkg-config \
python-dev \
python-numpy \
python-pip \
python-yaml \
wget \
zlib1g-dev \
# Protobuf
ca-certificates \
curl \
unzip \
# For Kaldi
automake \
libtool \
autoconf \
subversion \
# For Kaldi's dependencies
libapr1 libaprutil1 libltdl-dev libltdl7 libserf-1-1 libsigsegv2 libsvn1 m4 && \
rm -rf /var/lib/apt/lists/*
RUN OPENMPI_VERSION=1.10.3 && \
wget -q -O - https://www.open-mpi.org/software/ompi/v1.10/downloads/openmpi-${OPENMPI_VERSION}.tar.gz | tar -xzf - && \
cd openmpi-${OPENMPI_VERSION} && \
./configure --prefix=/usr/local/mpi && \
make -j"$(nproc)" install && \
rm -rf /openmpi-${OPENMPI_VERSION}
ENV PATH /usr/local/mpi/bin:$PATH
ENV LD_LIBRARY_PATH /usr/local/mpi/lib:$LD_LIBRARY_PATH
RUN LIBZIP_VERSION=1.1.2 && \
wget -q -O - http://nih.at/libzip/libzip-${LIBZIP_VERSION}.tar.gz | tar -xzf - && \
cd libzip-${LIBZIP_VERSION} && \
./configure && \
make -j"$(nproc)" install && \
rm -rf /libzip-${LIBZIP_VERSION}
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH
RUN wget -q -O - https://github.com/NVlabs/cub/archive/1.4.1.tar.gz | tar -C /usr/local -xzf -
RUN OPENCV_VERSION=3.1.0 && \
wget -q -O - https://github.com/Itseez/opencv/archive/${OPENCV_VERSION}.tar.gz | tar -xzf - && \
cd opencv-${OPENCV_VERSION} && \
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local/opencv-${OPENCV_VERSION} . && \
make -j"$(nproc)" install && \
rm -rf /opencv-${OPENCV_VERSION}
RUN OPENBLAS_VERSION=0.2.18 && \
wget -q -O - https://github.com/xianyi/OpenBLAS/archive/v${OPENBLAS_VERSION}.tar.gz | tar -xzf - && \
cd OpenBLAS-${OPENBLAS_VERSION} && \
make -j"$(nproc)" USE_OPENMP=1 | tee make.log && \
grep -qF 'OpenBLAS build complete. (BLAS CBLAS LAPACK LAPACKE)' make.log && \
grep -qF 'Use OpenMP in the multithreading.' make.log && \
make PREFIX=/usr/local/openblas install && \
rm -rf /OpenBLAS-${OPENBLAS_VERSION}
ENV LD_LIBRARY_PATH /usr/local/openblas/lib:$LD_LIBRARY_PATH
# Install Protobuf
RUN PROTOBUF_VERSION=3.1.0 \
PROTOBUF_STRING=protobuf-$PROTOBUF_VERSION && \
wget -O - --no-verbose https://github.com/google/protobuf/archive/v${PROTOBUF_VERSION}.tar.gz | tar -xzf - && \
cd $PROTOBUF_STRING && \
./autogen.sh && \
./configure CFLAGS=-fPIC CXXFLAGS=-fPIC --disable-shared --prefix=/usr/local/$PROTOBUF_STRING && \
make -j $(nproc) install && \
cd .. && \
rm -rf $PROTOBUF_STRING
# Install Boost
RUN BOOST_VERSION=1_60_0 && \
BOOST_DOTTED_VERSION=$(echo $BOOST_VERSION | tr _ .) && \
wget -q -O - https://sourceforge.net/projects/boost/files/boost/${BOOST_DOTTED_VERSION}/boost_${BOOST_VERSION}.tar.gz/download | tar -xzf - && \
cd boost_${BOOST_VERSION} && \
./bootstrap.sh --prefix=/usr/local/boost-${BOOST_DOTTED_VERSION} --with-libraries=filesystem,system,test && \
./b2 -d0 -j"$(nproc)" install && \
rm -rf /boost_${BOOST_VERSION}
# Install CNTK custom MKL, version 2
RUN mkdir /usr/local/CNTKCustomMKL && \
wget --no-verbose -O - https://www.cntk.ai/mkl/CNTKCustomMKL-Linux-2.tgz | \
tar -xzf - -C /usr/local/CNTKCustomMKL
RUN mkdir -p /usr/local/cudnn/cuda/include && \
ln -s /usr/include/cudnn.h /usr/local/cudnn/cuda/include/cudnn.h && \
mkdir -p /usr/local/cudnn/cuda/lib64 && \
ln -s /etc/alternatives/libcudnn_so /usr/local/cudnn/cuda/lib64/libcudnn.so
RUN pip install pytest sphinx-rtd-theme Pillow
ENV BLAS=/usr/local/openblas/lib/libopenblas.so
ENV LAPACK=/usr/local/openblas/lib/libopenblas.so
RUN SCIPY_VERSION=0.18.0 && \
wget -q -O - https://github.com/scipy/scipy/releases/download/v${SCIPY_VERSION}/scipy-${SCIPY_VERSION}.tar.gz | tar -zxf - && \
cd scipy-${SCIPY_VERSION} && \
python setup.py build && \
python setup.py install && \
cd .. && \
rm -rf scipy-${SCIPY_VERSION}
# Install Kaldi
ENV KALDI_VERSION=c024e8aa
ENV KALDI_PATH /usr/local/kaldi-$KALDI_VERSION
RUN mv /bin/sh /bin/sh.orig && \
ln -s -f /bin/bash /bin/sh && \
mkdir $KALDI_PATH && \
wget --no-verbose -O - https://github.com/kaldi-asr/kaldi/archive/$KALDI_VERSION.tar.gz | tar -xzf - --strip-components=1 -C $KALDI_PATH && \
cd $KALDI_PATH && \
cd tools && \
perl -pi -e 's/^# (OPENFST_VERSION = 1.4.1)$/\1/' Makefile && \
./extras/check_dependencies.sh && \
make -j $(nproc) all && \
cd ../src && \
./configure --openblas-root=/usr/local/openblas --shared && \
make -j $(nproc) depend && \
make -j $(nproc) all && \
# Remove some unneeded stuff in $KALDI_PATH to reduce size
find $KALDI_PATH -name '*.o' -print0 | xargs -0 rm && \
for dir in $KALDI_PATH/src/*bin; do make -C $dir clean; done && \
mv -f /bin/sh.orig /bin/sh
WORKDIR /cntk
RUN git clone --depth=1 -b master https://github.com/Microsoft/CNTK.git . && \
CONFIGURE_OPTS="\
--with-cuda=/usr/local/cuda \
--with-gdk-include=/usr/local/cuda/include \
--with-gdk-nvml-lib=/usr/local/cuda/lib64/stubs \
--with-kaldi=${KALDI_PATH} \
--with-cudnn=/usr/local/cudnn" && \
mkdir -p build/gpu/release && \
cd build/gpu/release && \
../../../configure $CONFIGURE_OPTS --with-openblas=/usr/local/openblas && \
make -j"$(nproc)" all && \
cd ../../.. && \
mkdir -p build-mkl/gpu/release && \
cd build-mkl/gpu/release && \
../../../configure $CONFIGURE_OPTS --with-mkl=/usr/local/CNTKCustomMKL && \
make -j"$(nproc)" all
RUN cd Examples/Image/DataSets/CIFAR-10 && \
python install_cifar10.py && \
cd ../../../..
RUN cd Examples/Image/DataSets/MNIST && \
python install_mnist.py && \
cd ../../../..
ENV PATH=/cntk/build/gpu/release/bin:/usr/local/mpi/bin:$PATH
FROM nvidia/cuda:7.5-cudnn5-devel
RUN apt-get update && apt-get install -y --no-install-recommends \
autotools-dev \
build-essential \
cmake \
git \
gfortran-multilib \
libavcodec-dev \
libavformat-dev \
libjasper-dev \
libjpeg-dev \
libpng-dev \
liblapacke-dev \
libswscale-dev \
libtiff-dev \
pkg-config \
python-dev \
python-numpy \
python-pip \
python-yaml \
wget \
zlib1g-dev \
# Protobuf
ca-certificates \
curl \
unzip \
# For Kaldi
automake \
libtool \
autoconf \
subversion \
# For Kaldi's dependencies
libapr1 libaprutil1 libltdl-dev libltdl7 libserf-1-1 libsigsegv2 libsvn1 m4 && \
rm -rf /var/lib/apt/lists/*
RUN OPENMPI_VERSION=1.10.3 && \
wget -q -O - https://www.open-mpi.org/software/ompi/v1.10/downloads/openmpi-${OPENMPI_VERSION}.tar.gz | tar -xzf - && \
cd openmpi-${OPENMPI_VERSION} && \
./configure --prefix=/usr/local/mpi && \
make -j"$(nproc)" install && \
rm -rf /openmpi-${OPENMPI_VERSION}
ENV PATH /usr/local/mpi/bin:$PATH
ENV LD_LIBRARY_PATH /usr/local/mpi/lib:$LD_LIBRARY_PATH
RUN LIBZIP_VERSION=1.1.2 && \
wget -q -O - http://nih.at/libzip/libzip-${LIBZIP_VERSION}.tar.gz | tar -xzf - && \
cd libzip-${LIBZIP_VERSION} && \
./configure && \
make -j"$(nproc)" install && \
rm -rf /libzip-${LIBZIP_VERSION}
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH
RUN wget -q -O - https://github.com/NVlabs/cub/archive/1.4.1.tar.gz | tar -C /usr/local -xzf -
RUN OPENCV_VERSION=3.1.0 && \
wget -q -O - https://github.com/Itseez/opencv/archive/${OPENCV_VERSION}.tar.gz | tar -xzf - && \
cd opencv-${OPENCV_VERSION} && \
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local/opencv-${OPENCV_VERSION} . && \
make -j"$(nproc)" install && \
rm -rf /opencv-${OPENCV_VERSION}
RUN OPENBLAS_VERSION=0.2.18 && \
wget -q -O - https://github.com/xianyi/OpenBLAS/archive/v${OPENBLAS_VERSION}.tar.gz | tar -xzf - && \
cd OpenBLAS-${OPENBLAS_VERSION} && \
make -j"$(nproc)" USE_OPENMP=1 | tee make.log && \
grep -qF 'OpenBLAS build complete. (BLAS CBLAS LAPACK LAPACKE)' make.log && \
grep -qF 'Use OpenMP in the multithreading.' make.log && \
make PREFIX=/usr/local/openblas install && \
rm -rf /OpenBLAS-${OPENBLAS_VERSION}
ENV LD_LIBRARY_PATH /usr/local/openblas/lib:$LD_LIBRARY_PATH
# Install Protobuf
RUN PROTOBUF_VERSION=3.1.0 \
PROTOBUF_STRING=protobuf-$PROTOBUF_VERSION && \
wget -O - --no-verbose https://github.com/google/protobuf/archive/v${PROTOBUF_VERSION}.tar.gz | tar -xzf - && \
cd $PROTOBUF_STRING && \
./autogen.sh && \
./configure CFLAGS=-fPIC CXXFLAGS=-fPIC --disable-shared --prefix=/usr/local/$PROTOBUF_STRING && \
make -j $(nproc) install && \
cd .. && \
rm -rf $PROTOBUF_STRING
# Install Boost
RUN BOOST_VERSION=1_60_0 && \
BOOST_DOTTED_VERSION=$(echo $BOOST_VERSION | tr _ .) && \
wget -q -O - https://sourceforge.net/projects/boost/files/boost/${BOOST_DOTTED_VERSION}/boost_${BOOST_VERSION}.tar.gz/download | tar -xzf - && \
cd boost_${BOOST_VERSION} && \
./bootstrap.sh --prefix=/usr/local/boost-${BOOST_DOTTED_VERSION} --with-libraries=filesystem,system,test && \
./b2 -d0 -j"$(nproc)" install && \
rm -rf /boost_${BOOST_VERSION}
# Install CNTK custom MKL, version 2
RUN mkdir /usr/local/CNTKCustomMKL && \
wget --no-verbose -O - https://www.cntk.ai/mkl/CNTKCustomMKL-Linux-2.tgz | \
tar -xzf - -C /usr/local/CNTKCustomMKL
RUN mkdir -p /usr/local/cudnn/cuda/include && \
ln -s /usr/include/cudnn.h /usr/local/cudnn/cuda/include/cudnn.h && \
mkdir -p /usr/local/cudnn/cuda/lib64 && \
ln -s /etc/alternatives/libcudnn_so /usr/local/cudnn/cuda/lib64/libcudnn.so
RUN pip install pytest sphinx-rtd-theme Pillow
ENV BLAS=/usr/local/openblas/lib/libopenblas.so
ENV LAPACK=/usr/local/openblas/lib/libopenblas.so
RUN SCIPY_VERSION=0.18.0 && \
wget -q -O - https://github.com/scipy/scipy/releases/download/v${SCIPY_VERSION}/scipy-${SCIPY_VERSION}.tar.gz | tar -zxf - && \
cd scipy-${SCIPY_VERSION} && \
python setup.py build && \
python setup.py install && \
cd .. && \
rm -rf scipy-${SCIPY_VERSION}
# Install Kaldi
ENV KALDI_VERSION=c024e8aa
ENV KALDI_PATH /usr/local/kaldi-$KALDI_VERSION
RUN mv /bin/sh /bin/sh.orig && \
ln -s -f /bin/bash /bin/sh && \
mkdir $KALDI_PATH && \
wget --no-verbose -O - https://github.com/kaldi-asr/kaldi/archive/$KALDI_VERSION.tar.gz | tar -xzf - --strip-components=1 -C $KALDI_PATH && \
cd $KALDI_PATH && \
cd tools && \
perl -pi -e 's/^# (OPENFST_VERSION = 1.4.1)$/\1/' Makefile && \
./extras/check_dependencies.sh && \
make -j $(nproc) all && \
cd ../src && \
./configure --openblas-root=/usr/local/openblas --shared && \
make -j $(nproc) depend && \
make -j $(nproc) all && \
# Remove some unneeded stuff in $KALDI_PATH to reduce size
find $KALDI_PATH -name '*.o' -print0 | xargs -0 rm && \
for dir in $KALDI_PATH/src/*bin; do make -C $dir clean; done && \
mv -f /bin/sh.orig /bin/sh
WORKDIR /cntk
RUN git clone --depth=1 -b master https://github.com/Microsoft/CNTK.git . && \
CONFIGURE_OPTS="\
--with-cuda=/usr/local/cuda \
--with-gdk-include=/usr/local/cuda/include \
--with-gdk-nvml-lib=/usr/local/cuda/lib64/stubs \
--with-kaldi=${KALDI_PATH} \
--with-cudnn=/usr/local/cudnn" && \
mkdir -p build/gpu/release && \
cd build/gpu/release && \
../../../configure $CONFIGURE_OPTS --with-openblas=/usr/local/openblas && \
make -j"$(nproc)" all && \
cd ../../.. && \
mkdir -p build-mkl/gpu/release && \
cd build-mkl/gpu/release && \
../../../configure $CONFIGURE_OPTS --with-mkl=/usr/local/CNTKCustomMKL && \
make -j"$(nproc)" all
RUN cd Examples/Image/DataSets/CIFAR-10 && \
python install_cifar10.py && \
cd ../../../..
RUN cd Examples/Image/DataSets/MNIST && \
python install_mnist.py && \
cd ../../../..
ENV PATH=/cntk/build/gpu/release/bin:/usr/local/mpi/bin:$PATH

Просмотреть файл

@ -1,77 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{19c9fbe6-fcf6-4300-988b-be7e64822b84}</ProjectGuid>
<ProjectHome />
<StartupFile>cntk_py.py</StartupFile>
<SearchPath />
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<ProjectTypeGuids>{888888a0-9f3d-457c-b088-3a5042f75d52}</ProjectTypeGuids>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<InterpreterId />
<InterpreterVersion />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'" />
<PropertyGroup Condition="'$(Configuration)' == 'Release'" />
<PropertyGroup>
<VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion>
<PtvsTargetsFile>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets</PtvsTargetsFile>
</PropertyGroup>
<ItemGroup>
<Content Include="cntk_py.i" />
<Content Include="io\tests\tf_data.txt" />
<Content Include="pytest.ini" />
</ItemGroup>
<ItemGroup>
<Compile Include="blocks.py" />
<Compile Include="cntk_py.py" />
<Compile Include="conftest.py" />
<Compile Include="initializer.py" />
<Compile Include="io\tests\io_tests.py" />
<Compile Include="io\__init__.py" />
<Compile Include="layers.py" />
<Compile Include="learner.py" />
<Compile Include="models.py" />
<Compile Include="ops\functions.py" />
<Compile Include="ops\sequence\__init__.py" />
<Compile Include="ops\tests\comparison_test.py" />
<Compile Include="ops\tests\evaluation_test.py" />
<Compile Include="ops\tests\linear_test.py" />
<Compile Include="ops\tests\non_diff_test.py" />
<Compile Include="ops\tests\non_linear_test.py" />
<Compile Include="ops\tests\ops_test_utils.py" />
<Compile Include="ops\tests\reshaping_test.py" />
<Compile Include="ops\tests\__init__.py" />
<Compile Include="ops\variables.py" />
<Compile Include="ops\__init__.py" />
<Compile Include="tensor.py" />
<Compile Include="tests\initializer_test.py" />
<Compile Include="tests\learner_test.py" />
<Compile Include="tests\tensor_test.py" />
<Compile Include="tests\test_utils.py" />
<Compile Include="tests\__init__.py" />
<Compile Include="trainer.py" />
<Compile Include="utils\debughelpers\__init__.py" />
<Compile Include="utils\persist.py" />
<Compile Include="utils\tests\persist_test.py" />
<Compile Include="utils\tests\utils_test.py" />
<Compile Include="utils\__init__.py" />
<Compile Include="__init__.py" />
</ItemGroup>
<ItemGroup>
<Folder Include="io" />
<Folder Include="io\tests" />
<Folder Include="ops" />
<Folder Include="ops\sequence" />
<Folder Include="ops\tests" />
<Folder Include="tests" />
<Folder Include="utils" />
<Folder Include="utils\debughelpers" />
<Folder Include="utils\tests" />
</ItemGroup>
<Import Project="$(PtvsTargetsFile)" Condition="Exists($(PtvsTargetsFile))" />
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="!Exists($(PtvsTargetsFile))" />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{19c9fbe6-fcf6-4300-988b-be7e64822b84}</ProjectGuid>
<ProjectHome />
<StartupFile>cntk_py.py</StartupFile>
<SearchPath />
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<ProjectTypeGuids>{888888a0-9f3d-457c-b088-3a5042f75d52}</ProjectTypeGuids>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<InterpreterId />
<InterpreterVersion />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'" />
<PropertyGroup Condition="'$(Configuration)' == 'Release'" />
<PropertyGroup>
<VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion>
<PtvsTargetsFile>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets</PtvsTargetsFile>
</PropertyGroup>
<ItemGroup>
<Content Include="cntk_py.i" />
<Content Include="io\tests\tf_data.txt" />
<Content Include="pytest.ini" />
</ItemGroup>
<ItemGroup>
<Compile Include="blocks.py" />
<Compile Include="cntk_py.py" />
<Compile Include="conftest.py" />
<Compile Include="initializer.py" />
<Compile Include="io\tests\io_tests.py" />
<Compile Include="io\__init__.py" />
<Compile Include="layers.py" />
<Compile Include="learner.py" />
<Compile Include="models.py" />
<Compile Include="ops\functions.py" />
<Compile Include="ops\sequence\__init__.py" />
<Compile Include="ops\tests\comparison_test.py" />
<Compile Include="ops\tests\evaluation_test.py" />
<Compile Include="ops\tests\linear_test.py" />
<Compile Include="ops\tests\non_diff_test.py" />
<Compile Include="ops\tests\non_linear_test.py" />
<Compile Include="ops\tests\ops_test_utils.py" />
<Compile Include="ops\tests\reshaping_test.py" />
<Compile Include="ops\tests\__init__.py" />
<Compile Include="ops\variables.py" />
<Compile Include="ops\__init__.py" />
<Compile Include="tensor.py" />
<Compile Include="tests\initializer_test.py" />
<Compile Include="tests\learner_test.py" />
<Compile Include="tests\tensor_test.py" />
<Compile Include="tests\test_utils.py" />
<Compile Include="tests\__init__.py" />
<Compile Include="trainer.py" />
<Compile Include="utils\debughelpers\__init__.py" />
<Compile Include="utils\persist.py" />
<Compile Include="utils\tests\persist_test.py" />
<Compile Include="utils\tests\utils_test.py" />
<Compile Include="utils\__init__.py" />
<Compile Include="__init__.py" />
</ItemGroup>
<ItemGroup>
<Folder Include="io" />
<Folder Include="io\tests" />
<Folder Include="ops" />
<Folder Include="ops\sequence" />
<Folder Include="ops\tests" />
<Folder Include="tests" />
<Folder Include="utils" />
<Folder Include="utils\debughelpers" />
<Folder Include="utils\tests" />
</ItemGroup>
<Import Project="$(PtvsTargetsFile)" Condition="Exists($(PtvsTargetsFile))" />
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="!Exists($(PtvsTargetsFile))" />
</Project>

Просмотреть файл

@ -1,69 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{1a078fc2-21c0-4f42-9a5b-0e84e944bc74}</ProjectGuid>
<ProjectHome />
<StartupFile>test\language_understanding_test.py</StartupFile>
<SearchPath>$(RepoRootPath)$(Platform)\$(Configuration);$(RepoRootPath)bindings\python;$(RepoRootPath)bindings\python\examples</SearchPath>
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<ProjectTypeGuids>{888888a0-9f3d-457c-b088-3a5042f75d52}</ProjectTypeGuids>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<InterpreterId>{51b3a70c-2ea2-4fe4-aeba-ff2cea35103f}</InterpreterId>
<InterpreterVersion>3.4</InterpreterVersion>
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
<IsWindowsApplication>False</IsWindowsApplication>
<Environment>PYTHONPATH=$(SolutionDir)bindings\python;$(SolutionDir)bindings\python\examples</Environment>
<InterpreterPath>
</InterpreterPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'" />
<PropertyGroup Condition="'$(Configuration)' == 'Release'" />
<PropertyGroup>
<VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion>
<PtvsTargetsFile>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets</PtvsTargetsFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release_NoOpt' ">
<OutputPath>bin\Release_NoOpt\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="CifarConvNet\CifarConvNet.py" />
<Compile Include="CifarResNet\CifarResNet.py" />
<Compile Include="common\layers.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="common\nn.py" />
<Compile Include="common\__init__.py" />
<Compile Include="LanguageUnderstanding\LanguageUnderstanding.py" />
<Compile Include="MNIST\SimpleMNIST.py" />
<Compile Include="NumpyInterop\FeedForwardNet.py" />
<Compile Include="Sequence2Sequence\Sequence2Sequence.py" />
<Compile Include="SequenceClassification\SequenceClassification.py" />
<Compile Include="test\cifar_resnet_test.py" />
<Compile Include="test\cifar_convnet_test.py" />
<Compile Include="test\feed_forward_net_test.py" />
<Compile Include="test\language_understanding_test.py" />
<Compile Include="test\sequence_classification_test.py" />
<Compile Include="test\sequence_to_sequence_test.py" />
<Compile Include="test\simple_mnist_test.py" />
<Compile Include="__init__.py" />
</ItemGroup>
<ItemGroup>
<Folder Include="CifarConvNet\" />
<Folder Include="CifarResNet" />
<Folder Include="common" />
<Folder Include="LanguageUnderstanding\" />
<Folder Include="MNIST" />
<Folder Include="NumpyInterop" />
<Folder Include="Sequence2Sequence" />
<Folder Include="SequenceClassification" />
<Folder Include="test\" />
</ItemGroup>
<ItemGroup>
<InterpreterReference Include="{51b3a70c-2ea2-4fe4-aeba-ff2cea35103f}\3.4" />
</ItemGroup>
<Import Project="$(PtvsTargetsFile)" Condition="Exists($(PtvsTargetsFile))" />
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="!Exists($(PtvsTargetsFile))" />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{1a078fc2-21c0-4f42-9a5b-0e84e944bc74}</ProjectGuid>
<ProjectHome />
<StartupFile>test\language_understanding_test.py</StartupFile>
<SearchPath>$(RepoRootPath)$(Platform)\$(Configuration);$(RepoRootPath)bindings\python;$(RepoRootPath)bindings\python\examples</SearchPath>
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<ProjectTypeGuids>{888888a0-9f3d-457c-b088-3a5042f75d52}</ProjectTypeGuids>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<InterpreterId>{51b3a70c-2ea2-4fe4-aeba-ff2cea35103f}</InterpreterId>
<InterpreterVersion>3.4</InterpreterVersion>
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
<IsWindowsApplication>False</IsWindowsApplication>
<Environment>PYTHONPATH=$(SolutionDir)bindings\python;$(SolutionDir)bindings\python\examples</Environment>
<InterpreterPath>
</InterpreterPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'" />
<PropertyGroup Condition="'$(Configuration)' == 'Release'" />
<PropertyGroup>
<VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion>
<PtvsTargetsFile>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets</PtvsTargetsFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release_NoOpt' ">
<OutputPath>bin\Release_NoOpt\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="CifarConvNet\CifarConvNet.py" />
<Compile Include="CifarResNet\CifarResNet.py" />
<Compile Include="common\layers.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="common\nn.py" />
<Compile Include="common\__init__.py" />
<Compile Include="LanguageUnderstanding\LanguageUnderstanding.py" />
<Compile Include="MNIST\SimpleMNIST.py" />
<Compile Include="NumpyInterop\FeedForwardNet.py" />
<Compile Include="Sequence2Sequence\Sequence2Sequence.py" />
<Compile Include="SequenceClassification\SequenceClassification.py" />
<Compile Include="test\cifar_resnet_test.py" />
<Compile Include="test\cifar_convnet_test.py" />
<Compile Include="test\feed_forward_net_test.py" />
<Compile Include="test\language_understanding_test.py" />
<Compile Include="test\sequence_classification_test.py" />
<Compile Include="test\sequence_to_sequence_test.py" />
<Compile Include="test\simple_mnist_test.py" />
<Compile Include="__init__.py" />
</ItemGroup>
<ItemGroup>
<Folder Include="CifarConvNet\" />
<Folder Include="CifarResNet" />
<Folder Include="common" />
<Folder Include="LanguageUnderstanding\" />
<Folder Include="MNIST" />
<Folder Include="NumpyInterop" />
<Folder Include="Sequence2Sequence" />
<Folder Include="SequenceClassification" />
<Folder Include="test\" />
</ItemGroup>
<ItemGroup>
<InterpreterReference Include="{51b3a70c-2ea2-4fe4-aeba-ff2cea35103f}\3.4" />
</ItemGroup>
<Import Project="$(PtvsTargetsFile)" Condition="Exists($(PtvsTargetsFile))" />
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="!Exists($(PtvsTargetsFile))" />
</Project>