2020-10-30 07:39:34 +03:00
|
|
|
# To reduce debug cost, steps are sorted differently on each platform,
|
|
|
|
# so that a bug in any module will cause at least one platform to fail quickly.
|
|
|
|
|
|
|
|
jobs:
|
2020-12-11 13:07:12 +03:00
|
|
|
- job: ubuntu_latest
|
2020-10-30 07:39:34 +03:00
|
|
|
pool:
|
2021-01-05 06:33:22 +03:00
|
|
|
vmImage: ubuntu-latest
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
# This platform tests lint and doc first.
|
|
|
|
|
|
|
|
steps:
|
2020-12-11 13:07:12 +03:00
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
2021-01-05 06:33:22 +03:00
|
|
|
versionSpec: 3.8
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: Configure Python version
|
|
|
|
|
2020-10-30 07:39:34 +03:00
|
|
|
- script: |
|
|
|
|
set -e
|
2021-01-05 06:33:22 +03:00
|
|
|
python -m pip install --upgrade pip setuptools
|
|
|
|
python -m pip install pytest coverage
|
|
|
|
python -m pip install pylint flake8
|
2020-10-30 07:39:34 +03:00
|
|
|
echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: Install Python tools
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
2021-01-05 06:33:22 +03:00
|
|
|
python setup.py develop
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: Install NNI
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
cd ts/nni_manager
|
|
|
|
yarn eslint
|
|
|
|
cd ../webui
|
|
|
|
yarn eslint
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: ESLint
|
2020-10-30 07:39:34 +03:00
|
|
|
|
2021-01-05 06:33:22 +03:00
|
|
|
# FIXME: temporarily fixed to pytorch 1.6 as 1.7 won't work with compression
|
|
|
|
|
2020-10-30 07:39:34 +03:00
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
sudo apt-get install -y pandoc
|
2021-01-05 06:33:22 +03:00
|
|
|
python -m pip install --upgrade pygments
|
|
|
|
python -m pip install "torch==1.6.0+cpu" "torchvision==0.7.0+cpu" -f https://download.pytorch.org/whl/torch_stable.html
|
|
|
|
python -m pip install tensorflow
|
|
|
|
python -m pip install gym onnx peewee thop graphviz
|
|
|
|
python -m pip install sphinx==3.3.1 sphinx-argparse==0.2.5 sphinx-rtd-theme==0.4.2 sphinxcontrib-websupport==1.1.0 nbsphinx
|
|
|
|
sudo apt-get remove swig -y
|
|
|
|
sudo apt-get install swig3.0 -y
|
|
|
|
sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
|
|
|
|
python -m pip install -e .[SMAC,BOHB]
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: Install extra dependencies
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
2021-01-05 06:33:22 +03:00
|
|
|
python -m pylint --rcfile pylintrc nni
|
|
|
|
python -m flake8 nni --count --select=E9,F63,F72,F82 --show-source --statistics
|
2020-10-30 07:39:34 +03:00
|
|
|
EXCLUDES=examples/trials/mnist-nas/*/mnist*.py,examples/trials/nas_cifar10/src/cifar10/general_child.py
|
2021-01-05 06:33:22 +03:00
|
|
|
python -m flake8 examples --count --exclude=$EXCLUDES --select=E9,F63,F72,F82 --show-source --statistics
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: pylint and flake8
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
cd docs/en_US
|
|
|
|
sphinx-build -M html . _build -W --keep-going -T
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: Check Sphinx documentation
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
2021-01-05 06:33:22 +03:00
|
|
|
set -e
|
2020-10-30 07:39:34 +03:00
|
|
|
cd test
|
2021-01-05 06:33:22 +03:00
|
|
|
python -m pytest ut --ignore=ut/sdk/test_pruners.py \
|
|
|
|
--ignore=ut/sdk/test_compressor_tf.py \
|
|
|
|
--ignore=ut/sdk/test_compressor_torch.py
|
|
|
|
python -m pytest ut/sdk/test_pruners.py
|
|
|
|
python -m pytest ut/sdk/test_compressor_tf.py
|
|
|
|
python -m pytest ut/sdk/test_compressor_torch.py
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: Python unit test
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
cd ts/nni_manager
|
|
|
|
yarn test
|
|
|
|
cd ../nasui
|
|
|
|
CI=true yarn test
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: TypeScript unit test
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
cd test
|
2021-01-05 06:33:22 +03:00
|
|
|
python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: Simple integration test
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
|
2020-12-11 13:07:12 +03:00
|
|
|
- job: ubuntu_legacy
|
2020-10-30 07:39:34 +03:00
|
|
|
pool:
|
2020-12-11 13:07:12 +03:00
|
|
|
vmImage: ubuntu-18.04
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
# This platform runs integration test first.
|
|
|
|
|
|
|
|
steps:
|
2020-12-11 13:07:12 +03:00
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: 3.6
|
|
|
|
displayName: Configure Python version
|
|
|
|
|
2020-10-30 07:39:34 +03:00
|
|
|
- script: |
|
|
|
|
set -e
|
2020-12-11 13:07:12 +03:00
|
|
|
python -m pip install --upgrade pip setuptools
|
|
|
|
python -m pip install pytest coverage
|
2020-10-30 07:39:34 +03:00
|
|
|
echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: Install Python tools
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
2020-12-11 13:07:12 +03:00
|
|
|
python setup.py develop
|
|
|
|
displayName: Install NNI
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
2020-12-11 13:07:12 +03:00
|
|
|
python -m pip install torch==1.5.0+cpu torchvision==0.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
|
|
|
|
python -m pip install tensorflow==1.15.4
|
|
|
|
python -m pip install keras==2.1.6
|
|
|
|
python -m pip install gym onnx peewee
|
2020-10-30 07:39:34 +03:00
|
|
|
sudo apt-get install swig -y
|
2020-12-11 20:53:48 +03:00
|
|
|
python -m pip install -e .[SMAC,BOHB]
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: Install extra dependencies
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
cd test
|
2020-12-11 13:07:12 +03:00
|
|
|
python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
|
|
|
|
displayName: Simple integration test
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
cd test
|
2020-12-11 13:07:12 +03:00
|
|
|
python -m pytest ut
|
|
|
|
displayName: Python unit test
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
cd ts/nni_manager
|
|
|
|
yarn test
|
|
|
|
cd ../nasui
|
|
|
|
CI=true yarn test
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: TypeScript unit test
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
|
2020-12-11 13:07:12 +03:00
|
|
|
- job: macos
|
2020-10-30 07:39:34 +03:00
|
|
|
pool:
|
2020-12-11 13:07:12 +03:00
|
|
|
vmImage: macOS-10.15
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
# This platform runs TypeScript unit test first.
|
|
|
|
|
|
|
|
steps:
|
2020-11-19 07:15:24 +03:00
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: 3.8
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: Configure Python version
|
2020-11-19 07:15:24 +03:00
|
|
|
|
2020-10-30 07:39:34 +03:00
|
|
|
- script: |
|
|
|
|
set -e
|
2020-11-19 07:15:24 +03:00
|
|
|
echo "##vso[task.setvariable variable=PATH]${PATH}:${HOME}/.local/bin"
|
2020-12-11 13:07:12 +03:00
|
|
|
python -m pip install --upgrade pip setuptools wheel
|
|
|
|
python -m pip install pytest coverage
|
|
|
|
displayName: Install Python tools
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
2020-12-11 13:07:12 +03:00
|
|
|
python setup.py develop
|
|
|
|
displayName: Install NNI
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
2020-11-19 07:15:24 +03:00
|
|
|
export CI=true
|
|
|
|
(cd ts/nni_manager && yarn test)
|
|
|
|
(cd ts/nasui && yarn test)
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: TypeScript unit test
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
# pytorch Mac binary does not support CUDA, default is cpu version
|
2020-12-11 13:07:12 +03:00
|
|
|
python -m pip install torchvision==0.6.0 torch==1.5.0
|
|
|
|
python -m pip install tensorflow==2.3.1
|
2020-10-30 07:39:34 +03:00
|
|
|
brew install swig@3
|
|
|
|
rm -f /usr/local/bin/swig
|
|
|
|
ln -s /usr/local/opt/swig\@3/bin/swig /usr/local/bin/swig
|
2020-12-11 20:53:48 +03:00
|
|
|
python -m pip install -e .[SMAC]
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: Install extra dependencies
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
cd test
|
2020-12-11 13:07:12 +03:00
|
|
|
python -m pytest ut
|
|
|
|
displayName: Python unit test
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
cd test
|
2020-12-11 13:07:12 +03:00
|
|
|
python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
|
|
|
|
displayName: Simple integration test
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
# FIXME: Windows UT is still under debugging
|
|
|
|
|
2020-12-11 13:07:12 +03:00
|
|
|
- job: windows
|
2020-10-30 07:39:34 +03:00
|
|
|
pool:
|
2020-12-11 13:07:12 +03:00
|
|
|
vmImage: windows-2019
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
# This platform runs Python unit test first.
|
|
|
|
|
|
|
|
steps:
|
2020-12-11 13:07:12 +03:00
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: 3.8
|
|
|
|
displayName: Configure Python version
|
|
|
|
|
2020-10-30 07:39:34 +03:00
|
|
|
- script: |
|
2020-12-11 13:07:12 +03:00
|
|
|
python -m pip install --upgrade pip setuptools
|
|
|
|
python -m pip install pytest coverage
|
|
|
|
displayName: Install Python tools
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
2020-11-09 09:54:49 +03:00
|
|
|
python setup.py develop --no-user
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: Install NNI
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
2020-12-11 13:07:12 +03:00
|
|
|
python -m pip install scikit-learn==0.23.2
|
|
|
|
python -m pip install torch==1.5.0+cpu torchvision==0.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
|
|
|
|
python -m pip install tensorflow==2.3.1
|
|
|
|
displayName: Install extra dependencies
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
cd test
|
|
|
|
python -m pytest ut
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: Python unit test
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
cd ts/nni_manager
|
|
|
|
yarn test
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: TypeScript unit test
|
2020-10-30 07:39:34 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
cd test
|
|
|
|
python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
|
2020-12-11 13:07:12 +03:00
|
|
|
displayName: Simple integration test
|
2020-11-09 09:54:49 +03:00
|
|
|
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
branches:
|
|
|
|
exclude: [ l10n_master ]
|