2020-08-25 09:59:07 +03:00
|
|
|
# Azure pipelines for Marian NMT
|
|
|
|
#
|
|
|
|
# The pipeline need to be added manually to the repository, for example:
|
2020-08-26 22:56:14 +03:00
|
|
|
# 1. Go to Your repository > Pipelines, click "New pipeline"
|
|
|
|
# 2. Choose "Azure Repos Git" and a repository
|
|
|
|
# 3. Choose "Existing Azure Pipelines YAML file" and specify path to this file
|
|
|
|
# 4. "More actions" > "Save"
|
2020-08-25 09:59:07 +03:00
|
|
|
|
2022-02-06 23:00:48 +03:00
|
|
|
parameters:
|
|
|
|
# Allow skipping the entire 'Build' stage
|
|
|
|
- name: runBuilds
|
|
|
|
displayName: Run builds? Uncheck to run regression tests only.
|
|
|
|
type: boolean
|
|
|
|
default: true
|
|
|
|
|
2020-08-25 09:59:07 +03:00
|
|
|
# The pipeline CI trigger is set on the branch master only and PR trigger on a
|
|
|
|
# (non-draft) pull request to any branch
|
|
|
|
trigger:
|
2022-11-01 09:26:56 +03:00
|
|
|
# This minimizes the number of parallel pipeline runs. When a pipeline is
|
|
|
|
# running, the CI waits until it is completed before starting another one.
|
|
|
|
batch: true
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- master
|
|
|
|
paths:
|
|
|
|
exclude:
|
|
|
|
- azure-regression-tests.yml
|
|
|
|
- contrib
|
|
|
|
- doc
|
|
|
|
- examples
|
|
|
|
- regression-tests
|
|
|
|
- scripts
|
|
|
|
- VERSION
|
|
|
|
- vs
|
|
|
|
- '**/*.md'
|
|
|
|
- '**/*.txt'
|
2020-08-25 09:59:07 +03:00
|
|
|
|
|
|
|
pool:
|
|
|
|
name: Azure Pipelines
|
|
|
|
|
2020-08-26 22:56:14 +03:00
|
|
|
variables:
|
2021-08-06 11:02:18 +03:00
|
|
|
- group: marian-prod-tests
|
|
|
|
- name: BOOST_ROOT_WINDOWS
|
|
|
|
value: "C:/hostedtoolcache/windows/Boost/1.72.0/x86_64"
|
|
|
|
- name: BOOST_URL
|
|
|
|
value: "https://sourceforge.net/projects/boost/files/boost-binaries/1.72.0/boost_1_72_0-msvc-14.2-64.exe"
|
|
|
|
- name: CUDA_PATH_WINDOWS
|
|
|
|
value: "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA"
|
|
|
|
- name: MKL_DIR
|
|
|
|
value: "$(Build.SourcesDirectory)/mkl"
|
|
|
|
- name: MKL_URL
|
2022-11-01 09:26:56 +03:00
|
|
|
value: "https://data.statmt.org/romang/marian-regression-tests/ci/mkl-2020.1-windows-static.zip"
|
2021-08-06 11:02:18 +03:00
|
|
|
- name: VCPKG_COMMIT
|
2022-04-08 20:15:56 +03:00
|
|
|
value: 2022.03.10
|
2021-08-06 11:02:18 +03:00
|
|
|
- name: VCPKG_DIR
|
|
|
|
value: "$(Build.SourcesDirectory)/vcpkg"
|
|
|
|
- name: VCPKG_PACKAGES
|
|
|
|
value: "protobuf"
|
2020-08-26 22:56:14 +03:00
|
|
|
# The Visual Studio installation directory can be found using:
|
|
|
|
# pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
|
|
|
|
# for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x
|
|
|
|
# popd
|
2021-08-06 11:02:18 +03:00
|
|
|
- name: VS_PATH
|
|
|
|
value: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise"
|
2020-08-26 22:56:14 +03:00
|
|
|
|
2020-08-25 09:59:07 +03:00
|
|
|
stages:
|
2021-08-06 11:02:18 +03:00
|
|
|
- stage: Builds
|
2020-08-25 09:59:07 +03:00
|
|
|
jobs:
|
|
|
|
|
2020-08-26 22:56:14 +03:00
|
|
|
######################################################################
|
2021-08-06 11:02:18 +03:00
|
|
|
- job: BuildWindows
|
2022-11-01 09:26:56 +03:00
|
|
|
cancelTimeoutInMinutes: 1
|
2022-02-06 23:00:48 +03:00
|
|
|
condition: eq(${{ parameters.runBuilds }}, true)
|
2021-08-06 11:02:18 +03:00
|
|
|
displayName: Windows
|
2020-08-26 22:56:14 +03:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-09-11 15:03:26 +03:00
|
|
|
# Windows CPU-only build
|
2020-08-26 22:56:14 +03:00
|
|
|
"CPU":
|
|
|
|
cuda: false
|
|
|
|
cuda_version: ""
|
2020-09-11 15:03:26 +03:00
|
|
|
# Windows CPU+GPU build
|
2020-08-26 22:56:14 +03:00
|
|
|
"CUDA 10.2":
|
|
|
|
cuda: true
|
|
|
|
cuda_version: 10.2
|
|
|
|
|
|
|
|
pool:
|
2022-04-08 20:15:56 +03:00
|
|
|
vmImage: windows-2019
|
2020-08-26 22:56:14 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
submodules: true
|
|
|
|
|
|
|
|
- pwsh: .\scripts\ci\install_cuda_windows.ps1 "$(cuda_version)"
|
|
|
|
displayName: Install CUDA
|
|
|
|
condition: eq(variables.cuda, true)
|
|
|
|
|
|
|
|
- pwsh: |
|
2020-09-08 19:58:03 +03:00
|
|
|
C:\msys64\usr\bin\wget.exe -nv $(MKL_URL) -O mkl.zip
|
2020-08-26 22:56:14 +03:00
|
|
|
Expand-Archive -Force mkl.zip $(MKL_DIR)
|
|
|
|
displayName: Download MKL
|
|
|
|
|
2021-08-06 11:02:18 +03:00
|
|
|
## Cache for Boost
|
2020-08-26 22:56:14 +03:00
|
|
|
#- task: Cache@2
|
2021-08-06 11:02:18 +03:00
|
|
|
# displayName: Cache Boost
|
2020-08-26 22:56:14 +03:00
|
|
|
# inputs:
|
|
|
|
# # Change the first value (v0) to another value to clear the cache
|
2021-08-06 11:02:18 +03:00
|
|
|
# key: '"v0" | "boost" | "$(BOOST_URL)" | "$(BOOST_ROOT_WINDOWS)" | "$(Agent.OS)"'
|
|
|
|
# path: $(BOOST_ROOT_WINDOWS)
|
|
|
|
# cacheHitVar: CACHE_BOOST_RESTORED
|
2020-08-26 22:56:14 +03:00
|
|
|
|
2021-03-17 20:34:09 +03:00
|
|
|
# Boost is no longer pre-installed on Azure/GitHub-hosted Windows runners
|
|
|
|
- pwsh: |
|
|
|
|
Write-Host "Downloading Boost to $(BOOST_ROOT_WINDOWS)"
|
2021-08-06 11:02:18 +03:00
|
|
|
C:\msys64\usr\bin\wget.exe -nv "$(BOOST_URL)" -O "$(Pipeline.Workspace)/boost.exe"
|
2021-03-17 20:34:09 +03:00
|
|
|
Start-Process -Wait -FilePath "$(Pipeline.Workspace)/boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=$(BOOST_ROOT_WINDOWS)"
|
|
|
|
displayName: Download Boost
|
2021-08-06 11:02:18 +03:00
|
|
|
condition: ne(variables.CACHE_BOOST_RESTORED, 'true')
|
|
|
|
|
|
|
|
## Cache for vcpkg packages. It does not work yet properly due to linker errors after restoring it.
|
|
|
|
#- task: Cache@2
|
|
|
|
# displayName: Cache vcpkg
|
|
|
|
# inputs:
|
|
|
|
# # Change the first value (v0) to another value to clear the cache
|
|
|
|
# key: '"v0" | "vcpkg" | "$(VCPKG_COMMIT)" | "$(VCPKG_PACKAGES)" | "$(Agent.OS)"'
|
|
|
|
# path: $(VCPKG_DIR)
|
|
|
|
# cacheHitVar: CACHE_VCPKG_RESTORED
|
2021-03-17 20:34:09 +03:00
|
|
|
|
2020-08-26 22:56:14 +03:00
|
|
|
- pwsh: |
|
|
|
|
git clone https://github.com/Microsoft/vcpkg.git $(VCPKG_DIR)
|
|
|
|
cd $(VCPKG_DIR)
|
|
|
|
git checkout $(VCPKG_COMMIT)
|
|
|
|
pushd
|
|
|
|
.\bootstrap-vcpkg.bat -disableMetrics
|
|
|
|
popd
|
|
|
|
# Install packages
|
|
|
|
.\vcpkg.exe install --triplet x64-windows-static $(VCPKG_PACKAGES)
|
|
|
|
# Clean to make the cache smaller
|
2021-07-22 19:36:43 +03:00
|
|
|
Remove-Item $(VCPKG_DIR)\downloads -Force -Recurse -ErrorAction SilentlyContinue
|
|
|
|
Remove-Item $(VCPKG_DIR)\buildtrees -Force -Recurse -ErrorAction SilentlyContinue
|
2020-08-26 22:56:14 +03:00
|
|
|
displayName: Prepare vcpkg
|
2021-08-06 11:02:18 +03:00
|
|
|
condition: ne(variables.CACHE_VCPKG_RESTORED, 'true')
|
2020-08-26 22:56:14 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
:: Load VS environment
|
|
|
|
call "$(VS_PATH)/VC/Auxiliary/Build/vcvarsall.bat" x64
|
|
|
|
:: Create build directory
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
:: Run CMake
|
|
|
|
cmake .. -G Ninja ^
|
|
|
|
-DCMAKE_BUILD_TYPE="Debug" ^
|
|
|
|
-DCMAKE_C_COMPILER="cl.exe" ^
|
|
|
|
-DCMAKE_CXX_COMPILER="cl.exe" ^
|
|
|
|
-DCMAKE_MAKE_PROGRAM="ninja.exe" ^
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_DIR)\scripts\buildsystems\vcpkg.cmake" ^
|
|
|
|
-DVCPKG_TARGET_TRIPLET="x64-windows-static" ^
|
|
|
|
^
|
2020-09-11 15:03:26 +03:00
|
|
|
-DBOOST_ROOT="$(BOOST_ROOT)" ^
|
|
|
|
-DBOOST_INCLUDEDIR="$(BOOST_ROOT)/include" ^
|
|
|
|
-DBOOST_LIBRARYDIR="$(BOOST_ROOT)/lib" ^
|
2020-08-26 22:56:14 +03:00
|
|
|
-DOPENSSL_USE_STATIC_LIBS="TRUE" ^
|
|
|
|
-DOPENSSL_MSVC_STATIC_RT="TRUE" ^
|
|
|
|
^
|
|
|
|
-DCOMPILE_CPU="TRUE" ^
|
|
|
|
-DCOMPILE_CUDA="$(cuda)" ^
|
|
|
|
-DCOMPILE_EXAMPLES="FALSE" ^
|
2020-09-14 16:23:10 +03:00
|
|
|
-DCOMPILE_SERVER="TRUE" ^
|
2020-08-26 22:56:14 +03:00
|
|
|
-DCOMPILE_TESTS="TRUE" ^
|
|
|
|
^
|
|
|
|
-DUSE_CUDNN="FALSE" ^
|
|
|
|
-DUSE_FBGEMM="TRUE" ^
|
|
|
|
-DUSE_MPI="FALSE" ^
|
|
|
|
-DUSE_NCCL="FALSE" ^
|
|
|
|
-DUSE_SENTENCEPIECE="TRUE" ^
|
|
|
|
-DUSE_STATIC_LIBS="TRUE"
|
|
|
|
displayName: Configure CMake
|
2020-09-08 19:58:03 +03:00
|
|
|
env:
|
|
|
|
# Set envvars so that CMake can find the installed packages
|
|
|
|
MKLROOT: $(MKL_DIR)
|
|
|
|
CUDA_PATH: $(CUDA_PATH_WINDOWS)/v$(cuda_version)
|
2021-03-17 20:34:09 +03:00
|
|
|
BOOST_ROOT: $(BOOST_ROOT_WINDOWS)
|
2020-08-26 22:56:14 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
call "$(VS_PATH)/VC/Auxiliary/Build/vcvarsall.bat" x64
|
|
|
|
ninja
|
|
|
|
displayName: Compile
|
|
|
|
workingDirectory: build
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
call "$(VS_PATH)/VC/Auxiliary/Build/vcvarsall.bat" x64
|
|
|
|
ctest
|
|
|
|
displayName: Run unit tests
|
|
|
|
workingDirectory: build
|
|
|
|
condition: eq(variables.cuda, false)
|
|
|
|
|
2020-09-14 16:23:10 +03:00
|
|
|
# Note that versions from Marian executables will not be printed for CUDA builds
|
|
|
|
- script: |
|
2020-08-26 22:56:14 +03:00
|
|
|
.\marian.exe --version
|
|
|
|
.\marian-decoder.exe --version
|
|
|
|
.\marian-scorer.exe --version
|
2020-09-14 16:23:10 +03:00
|
|
|
.\marian-server.exe --version
|
2020-08-26 22:56:14 +03:00
|
|
|
.\spm_encode.exe --version
|
|
|
|
displayName: Print versions
|
|
|
|
workingDirectory: build
|
|
|
|
|
2020-08-25 09:59:07 +03:00
|
|
|
######################################################################
|
|
|
|
- job: BuildUbuntu
|
2022-11-01 09:26:56 +03:00
|
|
|
cancelTimeoutInMinutes: 1
|
2022-02-06 23:00:48 +03:00
|
|
|
condition: eq(${{ parameters.runBuilds }}, true)
|
2020-08-25 09:59:07 +03:00
|
|
|
displayName: Ubuntu
|
2022-09-02 08:55:20 +03:00
|
|
|
timeoutInMinutes: 120
|
2020-08-25 09:59:07 +03:00
|
|
|
|
2022-02-10 19:34:23 +03:00
|
|
|
# Minimal tested configurations for marian-dev v1.11 and C++17:
|
|
|
|
# * Ubuntu 16.04, GCC 7.5, CMake 3.10.2, CUDA 9.2 (probably GCC 6 would work too)
|
|
|
|
# * Ubuntu 18.04, GCC 7.5, CMake 3.12.2, CUDA 10.0
|
2020-08-25 09:59:07 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-09-11 13:11:34 +03:00
|
|
|
################################################################
|
|
|
|
# Ubuntu CPU-only build
|
|
|
|
"CPU-only":
|
2022-09-02 08:55:20 +03:00
|
|
|
image: ubuntu-20.04
|
2020-09-11 13:11:34 +03:00
|
|
|
boost: true
|
|
|
|
cpu: true
|
2020-09-11 13:49:55 +03:00
|
|
|
gpu: false
|
2020-09-11 13:11:34 +03:00
|
|
|
cuda: ""
|
2022-09-02 08:55:20 +03:00
|
|
|
gcc: 9
|
2020-09-11 13:11:34 +03:00
|
|
|
unit_tests: true
|
|
|
|
examples: false
|
2020-09-11 15:31:02 +03:00
|
|
|
static: true
|
2020-09-11 13:11:34 +03:00
|
|
|
# Ubuntu GPU-only build
|
|
|
|
"GPU-only":
|
2022-09-02 08:55:20 +03:00
|
|
|
image: ubuntu-20.04
|
2020-09-11 13:11:34 +03:00
|
|
|
boost: true
|
|
|
|
cpu: false
|
2020-09-11 13:49:55 +03:00
|
|
|
gpu: true
|
2022-09-02 08:55:20 +03:00
|
|
|
cuda: 11.1
|
|
|
|
gcc: 9
|
2020-09-11 13:49:55 +03:00
|
|
|
unit_tests: false
|
2020-09-11 13:11:34 +03:00
|
|
|
examples: false
|
2020-09-11 15:31:02 +03:00
|
|
|
static: false
|
2020-09-11 13:11:34 +03:00
|
|
|
################################################################
|
2022-09-02 08:55:20 +03:00
|
|
|
# Ubuntu 22.04 supports CUDA 11+
|
2020-09-11 13:11:34 +03:00
|
|
|
#
|
2021-02-01 22:40:46 +03:00
|
|
|
# CPU is disabled because FBGEMM + GCC 9+ do not compile on machines with
|
2020-09-08 19:58:03 +03:00
|
|
|
# avx512_vnni, see https://github.com/marian-nmt/marian-dev/issues/709
|
2022-09-02 08:55:20 +03:00
|
|
|
"22.04 CUDA 11.7 gcc-11":
|
|
|
|
image: ubuntu-22.04
|
|
|
|
boost: false
|
|
|
|
cpu: false
|
2021-02-01 22:40:46 +03:00
|
|
|
gpu: true
|
2022-09-02 08:55:20 +03:00
|
|
|
cuda: 11.7
|
|
|
|
gcc: 11
|
2021-02-01 22:40:46 +03:00
|
|
|
unit_tests: false # disable unit tests to minimize compilation time
|
|
|
|
examples: false # disable examples to minimize compilation time
|
|
|
|
static: false
|
2020-09-11 13:11:34 +03:00
|
|
|
################################################################
|
2022-09-02 08:55:20 +03:00
|
|
|
# Ubuntu 20.04 supports CUDA 11+
|
|
|
|
"20.04 CUDA 11.1 gcc-9":
|
|
|
|
image: ubuntu-20.04
|
2020-08-26 22:56:14 +03:00
|
|
|
boost: true
|
2020-09-11 13:11:34 +03:00
|
|
|
cpu: true
|
2020-09-11 13:49:55 +03:00
|
|
|
gpu: true
|
2022-09-02 08:55:20 +03:00
|
|
|
cuda: 11.1
|
|
|
|
gcc: 9
|
2020-08-26 22:56:14 +03:00
|
|
|
unit_tests: true
|
|
|
|
examples: true
|
2020-09-11 15:31:02 +03:00
|
|
|
static: true
|
2020-09-11 13:11:34 +03:00
|
|
|
################################################################
|
2022-02-06 23:00:48 +03:00
|
|
|
# Ubuntu 16.04 is no longer available on Azure-hosted machines
|
2020-08-25 09:59:07 +03:00
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: $(image)
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
submodules: true
|
|
|
|
|
2021-03-17 20:34:09 +03:00
|
|
|
# The following packages are already installed on Azure-hosted runners: build-essential openssl libssl-dev
|
|
|
|
# No need to install libprotobuf{17,10,9v5} on Ubuntu {20,18,16}.04 because it is installed together with libprotobuf-dev
|
2022-09-02 08:55:20 +03:00
|
|
|
# Note that installation of libunwind-dev is a bug fix for ubuntu-22.04 images on Azure/GitHub-hosted machines
|
|
|
|
# and is normally not required
|
|
|
|
- bash: sudo apt-get install -y libunwind-dev libgoogle-perftools-dev libprotobuf-dev protobuf-compiler
|
2020-08-25 09:59:07 +03:00
|
|
|
displayName: Install packages
|
|
|
|
|
2021-03-17 20:34:09 +03:00
|
|
|
# Boost is no longer pre-installed on Azure/GitHub-hosted runners
|
|
|
|
- bash: sudo apt-get install -y libboost-system-dev
|
|
|
|
displayName: Install Boost
|
|
|
|
condition: eq(variables.boost, true)
|
|
|
|
|
|
|
|
# https://software.intel.com/content/www/us/en/develop/articles/installing-intel-free-libs-and-python-apt-repo.html
|
2020-08-25 09:59:07 +03:00
|
|
|
- bash: |
|
|
|
|
wget -qO- "https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB" | sudo apt-key add -
|
|
|
|
sudo sh -c "echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list"
|
|
|
|
sudo apt-get update -o Dir::Etc::sourcelist="/etc/apt/sources.list.d/intel-mkl.list"
|
|
|
|
sudo apt-get install -y --no-install-recommends intel-mkl-64bit-2020.0-088
|
|
|
|
displayName: Install MKL
|
2020-09-11 14:20:31 +03:00
|
|
|
condition: eq(variables.cpu, true)
|
2020-08-25 09:59:07 +03:00
|
|
|
|
2021-03-17 20:34:09 +03:00
|
|
|
# The script simplifies installation of different versions of CUDA
|
2020-08-25 09:59:07 +03:00
|
|
|
- bash: ./scripts/ci/install_cuda_ubuntu.sh $(cuda)
|
|
|
|
displayName: Install CUDA
|
2020-09-11 14:20:31 +03:00
|
|
|
condition: eq(variables.gpu, true)
|
2020-08-25 09:59:07 +03:00
|
|
|
|
|
|
|
- bash: |
|
|
|
|
mkdir -p build
|
|
|
|
cd build
|
|
|
|
CC=/usr/bin/gcc-$(gcc) CXX=/usr/bin/g++-$(gcc) CUDAHOSTCXX=/usr/bin/g++-$(gcc) \
|
|
|
|
cmake .. \
|
2020-09-11 15:43:23 +03:00
|
|
|
-DCOMPILE_CPU=$(cpu) \
|
|
|
|
-DCOMPILE_CUDA=$(gpu) \
|
|
|
|
-DCOMPILE_EXAMPLES=$(examples) \
|
|
|
|
-DCOMPILE_SERVER=$(boost) \
|
|
|
|
-DCOMPILE_TESTS=$(unit_tests) \
|
2021-02-01 22:40:46 +03:00
|
|
|
-DUSE_FBGEMM=$(cpu) \
|
2020-09-11 15:43:23 +03:00
|
|
|
-DUSE_SENTENCEPIECE=on \
|
2020-09-11 15:31:02 +03:00
|
|
|
-DUSE_STATIC_LIBS=$(static) \
|
2020-08-25 09:59:07 +03:00
|
|
|
-DBoost_ARCHITECTURE=-x64 \
|
|
|
|
-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-$(cuda)
|
|
|
|
displayName: Configure CMake
|
|
|
|
|
2021-02-05 22:15:50 +03:00
|
|
|
# Clean build/src/ to safe disk space on Azure-hosted VMs and stay below the 10GB limit
|
|
|
|
- bash: |
|
|
|
|
make -j3
|
|
|
|
rm -rf src/
|
2020-08-25 09:59:07 +03:00
|
|
|
displayName: Compile
|
|
|
|
workingDirectory: build
|
|
|
|
|
2020-09-11 13:11:34 +03:00
|
|
|
# Unit tests are run only for CPU-only builds because Azure-hosted runners do not have GPUs
|
|
|
|
# TODO: add an option to CMake to compile unit tests only for CPU
|
|
|
|
- bash: make test
|
|
|
|
displayName: Run unit tests
|
|
|
|
workingDirectory: build
|
2020-09-11 14:20:31 +03:00
|
|
|
condition: and(eq(variables.unit_tests, true), eq(variables.gpu, false))
|
2020-08-25 09:59:07 +03:00
|
|
|
|
|
|
|
- bash: |
|
|
|
|
./marian --version
|
|
|
|
./marian-decoder --version
|
|
|
|
./marian-scorer --version
|
|
|
|
./spm_encode --version
|
|
|
|
displayName: Print versions
|
|
|
|
workingDirectory: build
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
- job: BuildMacOS
|
2022-11-01 09:26:56 +03:00
|
|
|
cancelTimeoutInMinutes: 1
|
2022-02-06 23:00:48 +03:00
|
|
|
condition: eq(${{ parameters.runBuilds }}, true)
|
2020-08-25 09:59:07 +03:00
|
|
|
displayName: macOS CPU clang
|
|
|
|
|
|
|
|
pool:
|
2022-09-15 09:18:42 +03:00
|
|
|
vmImage: macos-12
|
2020-08-25 09:59:07 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
submodules: true
|
|
|
|
|
2021-03-17 20:34:09 +03:00
|
|
|
- bash: brew install boost openblas openssl protobuf
|
2020-08-25 09:59:07 +03:00
|
|
|
displayName: Install packages
|
|
|
|
|
2020-09-14 16:36:04 +03:00
|
|
|
# Openblas location is exported explicitly because openblas is keg-only, which means it was not symlinked into /usr/local/.
|
|
|
|
# CMake cannot find BLAS on Azure runners if Marian is being compiled statically, hence USE_STATIC_LIBS=off
|
2020-08-25 09:59:07 +03:00
|
|
|
- bash: |
|
|
|
|
export LDFLAGS="-L/usr/local/opt/openblas/lib"
|
|
|
|
export CPPFLAGS="-I/usr/local/opt/openblas/include"
|
|
|
|
mkdir -p build
|
|
|
|
cd build
|
2020-09-14 16:36:04 +03:00
|
|
|
cmake .. \
|
|
|
|
-DCOMPILE_CPU=on \
|
|
|
|
-DCOMPILE_CUDA=off \
|
|
|
|
-DCOMPILE_EXAMPLES=on \
|
|
|
|
-DCOMPILE_SERVER=on \
|
|
|
|
-DCOMPILE_TESTS=on \
|
|
|
|
-DUSE_FBGEMM=on \
|
|
|
|
-DUSE_SENTENCEPIECE=on \
|
|
|
|
-DUSE_STATIC_LIBS=off
|
2020-08-25 09:59:07 +03:00
|
|
|
displayName: Configure CMake
|
|
|
|
|
|
|
|
- bash: make -j2
|
|
|
|
displayName: Compile
|
|
|
|
workingDirectory: build
|
|
|
|
|
|
|
|
- bash: make test
|
|
|
|
displayName: Run unit tests
|
|
|
|
workingDirectory: build
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
./marian --version
|
|
|
|
./marian-decoder --version
|
|
|
|
./marian-scorer --version
|
|
|
|
./spm_encode --version
|
|
|
|
displayName: Print versions
|
|
|
|
workingDirectory: build
|
2021-02-08 19:09:28 +03:00
|
|
|
|
|
|
|
######################################################################
|
|
|
|
- job: BuildInstall
|
2022-11-01 09:26:56 +03:00
|
|
|
cancelTimeoutInMinutes: 1
|
2022-02-06 23:00:48 +03:00
|
|
|
condition: eq(${{ parameters.runBuilds }}, true)
|
2021-02-08 19:09:28 +03:00
|
|
|
displayName: Linux CPU library install
|
|
|
|
|
|
|
|
pool:
|
2022-09-02 08:55:20 +03:00
|
|
|
vmImage: ubuntu-20.04
|
2021-02-08 19:09:28 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
submodules: true
|
|
|
|
|
2021-08-06 11:02:18 +03:00
|
|
|
# The following packages are already installed on Azure-hosted runners: build-essential openssl libssl-dev
|
|
|
|
# No need to install libprotobuf{17,10,9v5} on Ubuntu {20,18,16}.04 because it is installed together with libprotobuf-dev
|
2021-02-08 19:09:28 +03:00
|
|
|
- bash: sudo apt-get install -y libgoogle-perftools-dev libprotobuf-dev protobuf-compiler
|
|
|
|
displayName: Install packages
|
|
|
|
|
2021-08-06 11:02:18 +03:00
|
|
|
# https://software.intel.com/content/www/us/en/develop/articles/installing-intel-free-libs-and-python-apt-repo.html
|
2021-02-08 19:09:28 +03:00
|
|
|
- bash: |
|
|
|
|
wget -qO- "https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB" | sudo apt-key add -
|
|
|
|
sudo sh -c "echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list"
|
|
|
|
sudo apt-get update -o Dir::Etc::sourcelist="/etc/apt/sources.list.d/intel-mkl.list"
|
|
|
|
sudo apt-get install -y --no-install-recommends intel-mkl-64bit-2020.0-088
|
|
|
|
displayName: Install MKL
|
|
|
|
|
2022-09-02 08:55:20 +03:00
|
|
|
- bash: /usr/bin/gcc-9 --version
|
2021-02-08 19:09:28 +03:00
|
|
|
displayName: Print GCC version
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
mkdir -p install
|
|
|
|
mkdir -p build
|
|
|
|
cd build
|
2022-09-02 08:55:20 +03:00
|
|
|
CC=/usr/bin/gcc-9 CXX=/usr/bin/g++-9 \
|
2021-02-08 19:09:28 +03:00
|
|
|
cmake .. \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=../install \
|
|
|
|
-DCMAKE_BUILD_TYPE=slim \
|
|
|
|
-DCOMPILE_LIBRARY_ONLY=on \
|
|
|
|
-DCOMPILE_CUDA=off \
|
|
|
|
-DGENERATE_MARIAN_INSTALL_TARGETS=on \
|
|
|
|
-DUSE_FBGEMM=on \
|
|
|
|
-DUSE_SENTENCEPIECE=on
|
|
|
|
displayName: Configure CMake
|
|
|
|
|
|
|
|
- bash: make -j3 install
|
|
|
|
displayName: Compile & install
|
|
|
|
workingDirectory: build
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
test -e lib/libmarian.a
|
|
|
|
test -e lib/libfbgemm.a
|
|
|
|
test -e lib/libsentencepiece.a
|
|
|
|
ls -lah *
|
|
|
|
displayName: Check targets
|
|
|
|
workingDirectory: install
|
2021-08-06 11:02:18 +03:00
|
|
|
|
|
|
|
|
|
|
|
# Marian is built in the same job where the regression tests are run to make sure that executables
|
2022-02-08 13:57:20 +03:00
|
|
|
# are compiled and run on a machine with the same CPU architecture, which is required for
|
2021-08-06 11:02:18 +03:00
|
|
|
# compilations with FBGEMM.
|
|
|
|
- stage: Tests
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
- job: TestWindows
|
2022-11-01 09:26:56 +03:00
|
|
|
cancelTimeoutInMinutes: 1
|
2021-08-06 11:02:18 +03:00
|
|
|
displayName: Windows CPU+FBGEMM
|
|
|
|
|
|
|
|
pool:
|
2022-04-08 20:15:56 +03:00
|
|
|
vmImage: windows-2019
|
2021-08-06 11:02:18 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
# Due to multiple checkouts this will be commonly cloned into D:\a\1\s\marian-dev
|
|
|
|
- checkout: self
|
|
|
|
submodules: true
|
|
|
|
|
|
|
|
- pwsh: |
|
|
|
|
C:\msys64\usr\bin\wget.exe -nv $(MKL_URL) -O mkl.zip
|
|
|
|
Expand-Archive -Force mkl.zip $(MKL_DIR)
|
|
|
|
displayName: Download MKL
|
|
|
|
|
|
|
|
# Cache for vcpkg packages
|
|
|
|
- task: Cache@2
|
|
|
|
displayName: Cache vcpkg
|
|
|
|
inputs:
|
|
|
|
# Change the first value (v0) to another value to clear the cache
|
|
|
|
key: '"v0" | "vcpkg" | "$(VCPKG_COMMIT)" | "$(VCPKG_PACKAGES)" | "$(Agent.OS)"'
|
|
|
|
path: $(VCPKG_DIR)
|
|
|
|
cacheHitVar: CACHE_VCPKG_RESTORED
|
|
|
|
|
|
|
|
- pwsh: |
|
|
|
|
git clone https://github.com/Microsoft/vcpkg.git $(VCPKG_DIR)
|
|
|
|
cd $(VCPKG_DIR)
|
|
|
|
git checkout $(VCPKG_COMMIT)
|
|
|
|
pushd
|
|
|
|
.\bootstrap-vcpkg.bat -disableMetrics
|
|
|
|
popd
|
|
|
|
# Install packages
|
|
|
|
.\vcpkg.exe install --triplet x64-windows-static $(VCPKG_PACKAGES)
|
|
|
|
# Clean to make the cache smaller
|
|
|
|
Remove-Item $(VCPKG_DIR)\downloads -Force -Recurse -ErrorAction SilentlyContinue
|
|
|
|
Remove-Item $(VCPKG_DIR)\buildtrees -Force -Recurse -ErrorAction SilentlyContinue
|
|
|
|
displayName: Prepare vcpkg
|
|
|
|
condition: ne(variables.CACHE_VCPKG_RESTORED, 'true')
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
:: Load VS environment
|
|
|
|
call "$(VS_PATH)/VC/Auxiliary/Build/vcvarsall.bat" x64
|
|
|
|
:: Create build directory
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
:: Run CMake
|
|
|
|
cmake .. -G Ninja ^
|
|
|
|
-DCMAKE_BUILD_TYPE="Slim" ^
|
|
|
|
-DCMAKE_C_COMPILER="cl.exe" ^
|
|
|
|
-DCMAKE_CXX_COMPILER="cl.exe" ^
|
|
|
|
-DCMAKE_MAKE_PROGRAM="ninja.exe" ^
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_DIR)\scripts\buildsystems\vcpkg.cmake" ^
|
|
|
|
-DVCPKG_TARGET_TRIPLET="x64-windows-static" ^
|
2022-02-08 13:57:20 +03:00
|
|
|
-DDETERMINISTIC="TRUE" ^
|
2021-08-06 11:02:18 +03:00
|
|
|
^
|
|
|
|
-DCOMPILE_CPU="TRUE" ^
|
|
|
|
-DCOMPILE_CUDA="FALSE" ^
|
|
|
|
^
|
|
|
|
-DUSE_FBGEMM="TRUE" ^
|
|
|
|
-DUSE_SENTENCEPIECE="TRUE" ^
|
|
|
|
-DUSE_STATIC_LIBS="TRUE"
|
|
|
|
displayName: Configure CMake
|
|
|
|
env:
|
|
|
|
# Set envvars so that CMake can find the installed packages
|
|
|
|
MKLROOT: $(MKL_DIR)
|
|
|
|
workingDirectory: marian-dev
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
pwd
|
|
|
|
call "$(VS_PATH)/VC/Auxiliary/Build/vcvarsall.bat" x64
|
|
|
|
ninja
|
|
|
|
displayName: Compile
|
|
|
|
workingDirectory: marian-dev/build
|
|
|
|
|
|
|
|
## Publish an artifact with Marian executables. Disabled because it is not portable due to
|
|
|
|
## fbgemm and not needed at the moment
|
|
|
|
#- pwsh: Compress-Archive -Path marian*.exe spm_*.exe -DestinationPath $(Build.SourcesDirectory)/marian-dev-ci_windows-x64_cpu.zip
|
|
|
|
#displayName: Prepare binaries
|
|
|
|
#workingDirectory: marian-dev/build
|
|
|
|
#- publish: marian-dev-ci_windows-x64_cpu.zip
|
|
|
|
#artifact: marian-dev-ci_windows-x64_cpu
|
|
|
|
#displayName: Publish binaries
|
|
|
|
|
|
|
|
# Running regression tests
|
|
|
|
# Due to multiple checkouts this will be commonly cloned into D:\a\1\s\marian-prod-tests
|
|
|
|
- checkout: git://Marian/marian-prod-tests
|
|
|
|
|
|
|
|
# Collect details about the CPU architecture, etc.
|
|
|
|
# Because the outputs goes to *.log files, they will be also included in the artifact with test outputs.
|
|
|
|
- script: bash -c "cat /proc/cpuinfo | tee cpuinfo.log"
|
|
|
|
displayName: Machine statistics
|
|
|
|
workingDirectory: marian-prod-tests
|
|
|
|
|
2022-09-02 08:55:20 +03:00
|
|
|
# The current SAS token will expire on 8/30/2023 and a new one will need to be set in Marian > Pipelines > Library
|
2021-08-06 11:02:18 +03:00
|
|
|
- bash: |
|
|
|
|
cd models
|
|
|
|
bash download-models.sh
|
|
|
|
ls
|
|
|
|
displayName: Prepare tests
|
|
|
|
env:
|
2022-11-01 13:07:40 +03:00
|
|
|
AZURE_STORAGE_SAS_TOKEN: $(blob-sas-token)
|
2021-08-06 11:02:18 +03:00
|
|
|
workingDirectory: marian-prod-tests
|
|
|
|
|
|
|
|
# Avoid using $(Build.SourcesDirectory) in bash tasks because on Windows pools it uses '\'
|
|
|
|
# instead of '/', which often breaks the job
|
2022-02-06 23:00:48 +03:00
|
|
|
- bash: MARIAN=../marian-dev/build TIMEOUT=10m bash ./run_mrt.sh '#cpu' '#basics' '#devops'
|
2021-08-06 11:02:18 +03:00
|
|
|
continueOnError: true
|
|
|
|
displayName: Run tests
|
|
|
|
workingDirectory: marian-prod-tests
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
# cut -c3- removes './' from paths making 7z to retain the directory structure
|
|
|
|
find . -type f \( -name "*.log" -o -name "*.out" -o -name "*.diff" \) -print | cut -c3- > listing.txt
|
|
|
|
echo "Creating an artifact with the following files:"
|
|
|
|
cat listing.txt
|
|
|
|
7z a -tzip ../regression-tests-ci_windows-x64_cpu.zip @listing.txt
|
|
|
|
displayName: Collect outputs
|
|
|
|
workingDirectory: marian-prod-tests
|
|
|
|
|
|
|
|
- publish: regression-tests-ci_windows-x64_cpu.zip
|
|
|
|
artifact: regression-tests-ci_windows-x64_cpu
|
|
|
|
displayName: Publish outputs
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
- job: TestLinux
|
2022-11-01 09:26:56 +03:00
|
|
|
cancelTimeoutInMinutes: 1
|
2021-08-06 11:02:18 +03:00
|
|
|
displayName: Linux CPU+FBGEMM
|
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
# Due to multiple checkouts this will be commonly cloned into D:\a\1\s\marian-dev
|
|
|
|
- checkout: self
|
|
|
|
submodules: true
|
|
|
|
|
|
|
|
# The following packages are already installed on Azure-hosted runners: build-essential openssl libssl-dev
|
|
|
|
# No need to install libprotobuf{17,10,9v5} on Ubuntu {20,18,16}.04 because it is installed together with libprotobuf-dev
|
2022-09-02 08:55:20 +03:00
|
|
|
- bash: sudo apt-get install -y libgoogle-perftools-dev libprotobuf-dev protobuf-compiler gcc-9 g++-9
|
2021-08-06 11:02:18 +03:00
|
|
|
displayName: Install packages
|
|
|
|
|
|
|
|
# https://software.intel.com/content/www/us/en/develop/articles/installing-intel-free-libs-and-python-apt-repo.html
|
|
|
|
- bash: |
|
|
|
|
wget -qO- "https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB" | sudo apt-key add -
|
|
|
|
sudo sh -c "echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list"
|
|
|
|
sudo apt-get update -o Dir::Etc::sourcelist="/etc/apt/sources.list.d/intel-mkl.list"
|
|
|
|
sudo apt-get install -y --no-install-recommends intel-mkl-64bit-2020.0-088
|
|
|
|
displayName: Install MKL
|
|
|
|
|
|
|
|
# Note that COMPILE_CPU=on and USE_SENTENCEPUECE=on are set explicitly to make them detectable
|
|
|
|
# by the regression tests framework (not sure if it is still required)
|
|
|
|
- bash: |
|
|
|
|
mkdir -p install
|
|
|
|
mkdir -p build
|
|
|
|
cd build
|
2022-09-02 08:55:20 +03:00
|
|
|
CC=/usr/bin/gcc-9 CXX=/usr/bin/g++-9 \
|
2021-08-06 11:02:18 +03:00
|
|
|
cmake .. \
|
|
|
|
-DCMAKE_BUILD_TYPE=slim \
|
|
|
|
-DCOMPILE_CPU=on \
|
|
|
|
-DCOMPILE_CUDA=off \
|
2022-02-08 13:57:20 +03:00
|
|
|
-DDETERMINISTIC=on \
|
2021-08-06 11:02:18 +03:00
|
|
|
-DUSE_FBGEMM=on \
|
|
|
|
-DUSE_SENTENCEPIECE=on \
|
|
|
|
-DUSE_STATIC_LIBS=on
|
|
|
|
displayName: Configure CMake
|
|
|
|
workingDirectory: marian-dev
|
|
|
|
|
|
|
|
- bash: make -j3
|
|
|
|
displayName: Compile
|
|
|
|
workingDirectory: marian-dev/build
|
|
|
|
|
|
|
|
## Publish an artifact with Marian executables. Disabled because it is not portable due to
|
|
|
|
## fbgemm and not needed at the moment
|
|
|
|
#- bash: zip $(Build.SourcesDirectory)/marian-dev-ci_linux-x64-static_cpu.zip marian* spm_*
|
|
|
|
#displayName: Prepare binaries
|
|
|
|
#workingDirectory: marian-dev/build
|
|
|
|
#- publish: marian-dev-ci_linux-x64-static_cpu.zip
|
|
|
|
#artifact: marian-dev-ci_linux-x64-static_cpu
|
|
|
|
#displayName: Publish binaries
|
|
|
|
|
|
|
|
# Running regression tests
|
|
|
|
# Due to multiple checkouts this will be commonly cloned into D:\a\1\s\marian-prod-tests
|
|
|
|
- checkout: git://Marian/marian-prod-tests
|
|
|
|
|
|
|
|
# Collect details about the CPU architecture, etc.
|
|
|
|
# Because the outputs goes to *.log files, they will be also included in the artifact with test outputs.
|
|
|
|
- bash: |
|
|
|
|
echo ">>> lscpu"
|
|
|
|
lscpu | tee lscpu.log
|
|
|
|
echo ">>> cpuinfo"
|
|
|
|
cat /proc/cpuinfo | tee cpuinfo.log
|
2022-09-02 08:55:20 +03:00
|
|
|
/usr/bin/gcc-9 --version | tee gcc.log
|
2021-08-06 11:02:18 +03:00
|
|
|
displayName: Machine statistics
|
|
|
|
workingDirectory: marian-prod-tests
|
|
|
|
|
2022-09-02 08:55:20 +03:00
|
|
|
# The current SAS token will expire on 8/30/2023 and a new one will need to be set in Marian > Pipelines > Library
|
2021-08-06 11:02:18 +03:00
|
|
|
- bash: |
|
|
|
|
cd models
|
|
|
|
bash download-models.sh
|
|
|
|
ls
|
|
|
|
displayName: Prepare tests
|
|
|
|
env:
|
2022-11-01 09:26:56 +03:00
|
|
|
AZURE_STORAGE_SAS_TOKEN: $(blob-sas-token)
|
2021-08-06 11:02:18 +03:00
|
|
|
workingDirectory: marian-prod-tests
|
|
|
|
|
2022-02-06 23:00:48 +03:00
|
|
|
- bash: MARIAN=../marian-dev/build bash ./run_mrt.sh '#cpu' '#basics' '#devops'
|
2021-08-06 11:02:18 +03:00
|
|
|
continueOnError: true
|
|
|
|
displayName: Run tests
|
|
|
|
workingDirectory: marian-prod-tests
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
# cut -c3- removes './' from paths making 7z to retain the directory structure
|
|
|
|
find . -type f \( -name "*.log" -o -name "*.out" -o -name "*.diff" \) -print | cut -c3- > listing.txt
|
|
|
|
echo "Creating an artifact with the following files:"
|
|
|
|
cat listing.txt
|
|
|
|
7z a -tzip ../regression-tests-ci_linux-x64-static_cpu.zip @listing.txt
|
|
|
|
displayName: Collect outputs
|
|
|
|
workingDirectory: marian-prod-tests
|
|
|
|
|
|
|
|
- publish: regression-tests-ci_linux-x64-static_cpu.zip
|
|
|
|
artifact: regression-tests-ci_linux-x64-static_cpu
|
|
|
|
displayName: Publish outputs
|