-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
111 lines (94 loc) · 6.43 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# After changing this file, check it on:
# http://lint.travis-ci.org/
os: linux
dist: xenial
sudo: false
language: python
python:
- 3.6
- 3.7
matrix:
include:
- name: "Python 3.6.7 on Bionic/amd64"
os: linux
arch: amd64
dist: bionic
python: 3.6.7
# - name: "Python 3.6.8 on OSX"
# os: osx
# osx_image: xcode9.2
# language: generic
# python: 3.6
# env: WANTED_PYTHON_VERSION=3.6
addons:
apt:
packages:
- python-pip
sources:
- ubuntu-toolchain-r-test
before_install:
- |
if [ $TRAVIS_OS_NAME == "osx" ]; then
export SUDOH="sudo"
if [ "$WANTED_PYTHON_VERSION" == "2.7" ]; then
brew update # this swaps python versions and makes 3 the default one
brew reinstall python\@2 || brew link --overwrite python\@2 # install and link python2 and pip2 to /usr/local/bin
export PATH=/usr/local/opt/python\@2/bin:$PATH
export PYTHON_EXE=python
elif [ "$WANTED_PYTHON_VERSION" == "3.6" ]; then
curl https://www.python.org/ftp/python/3.6.8/python-3.6.8-macosx10.9.pkg -s -o /tmp/python.pkg
${SUDOH} installer -pkg /tmp/python.pkg -target /
ls -l /Library/Frameworks/Python.framework/Versions/3.6/bin
export PATH=/Library/Frameworks/Python.framework/Versions/3.6/bin:$PATH
export PYTHON_EXE=python3
else
echo "Other MacOS Pythons are not supported at the moment"
fi
export CK_PLATFORM_NAME="generic-macos " # used later by CK
else
export WANTED_PYTHON_VERSION=$TRAVIS_PYTHON_VERSION # since Python is supported in Linux, get it from Travis
export PYTHON_EXE=python
export CK_PLATFORM_NAME="generic-linux " # used later by CK (note the trailing space to make the choice unique)
fi
install:
- CWD=`pwd`
- THIS_REPO_NAME=ck-ml
- echo "TRAVIS_OS_NAME=${TRAVIS_OS_NAME}, WANTED_PYTHON_VERSION=${WANTED_PYTHON_VERSION}"
- echo "CWD=${CWD}, THIS_REPO_NAME=${THIS_REPO_NAME}, PATH=${PATH}"
- which "${PYTHON_EXE}"
- ${PYTHON_EXE} --version
- rm -f `which pip` # the file is removable, but not writeable
- ${SUDOH} ${PYTHON_EXE} -m pip install --ignore-installed --verbose pip setuptools # make sure pip is also up to date no matter what
- ${PYTHON_EXE} -m pip install -r requirements.txt # ck kernel itself and some essential components
- ck version
- ck pull repo:octoml@venv # test octoml@venv repo
- ck pull repo:octoml@mlops # use the main MLOps repo that will also pull this ck-ml repository
- echo "$CK_PLATFORM_NAME" | ck detect platform.os --update_platform_init # set the platform to generic-linux (1) or generic-macos (2)
- ck detect soft:compiler.python --full_path=`which ${PYTHON_EXE}` # pick the one Travis has set for us in the PATH
- ck install package --tags=lib,python-package,numpy # avoid detection by force-installing the package
- ck install package --tags=lib,python-package,scipy # avoid detection by force-installing the package
- ck install package --tags=lib,python-package,pillow # avoid detection by force-installing the package
- ck install package:lib-tensorflow-1.13.1-cpu # avoid manual selection
- ck install package:imagenet-2012-val-min # avoid manual selection
- ck install package --tags=dataset,imagenet,preprocessed,using-pillow,first.20 # we only need a short preprocessed subset
- ck install package --quiet --tags=lib,python-package,onnx
- ck install package --quiet --tags=model,image-classification,onnx,mobilenet,non-quantized,nchw,downloaded # MobileNet ONNX model, downloaded
- ck install package --quiet --tags=model,onnx,mobilenet,nhwc,converted # MobileNet ONNX model, converted from TF, in NHWC
- ck install package --quiet --tags=model,onnx,resnet,nchw,converted # ResNet50 ONNX model, converted from TF, in NCHW
- ck install package --quiet --tags=model,onnx,resnet,nhwc,converted # ResNet50 ONNX model, converted from TF, in NHWC
- ck install package --quiet --tags=lib,python-package,onnxruntime,cpu
- ck detect soft:compiler.gcc --full_path=`which gcc`
- ck install package --tags=tool,cmake,prebuilt --quiet
- ck install package --quiet --tags=mlperf,inference,src,r1.0
- ck install package --tags=lib,python-package,absl
- ck install package --tags=lib,python-package,mlperf,loadgen
- ck install package --tags=lib,mlperf,loadgen,static
script:
- ck show env # show everything that has been detected or installed
- ck compile program:cbench-automotive-susan --speed
- ck run program:cbench-automotive-susan --cmd_key=corners --dataset_uoa=image-pgm-0001 --repeat=1 --env.MY_ENV=123 --env.TEST=xyz --return_error_if_external_fail
- ck run program:image-classification-onnx-py --quiet --dep_add_tags.weights=mobilenet,converted --cmd_key=barebones --env.CK_BATCH_SIZE=3 --return_error_if_external_fail # internal preprocessing
- ck run program:image-classification-onnx-py --dep_add_tags.weights=mobilenet,downloaded --cmd_key=preprocessed --env.CK_BATCH_COUNT=2 --return_error_if_external_fail # external preprocessing
- ck run program:image-classification-onnx-py --dep_add_tags.weights=resnet,nchw,converted --cmd_key=preprocessed --return_error_if_external_fail # channels-first layout
- ck run program:image-classification-onnx-py --dep_add_tags.weights=resnet,nhwc,converted --cmd_key=preprocessed --return_error_if_external_fail # channels-last layout
- ck run program:image-classification-onnx-py --cmd_key=preprocessed --dep_add_tags.weights=resnet,nchw,converted --env.CK_IMAGE_FILE=ILSVRC2012_val_00000003.JPEG --return_error_if_external_fail # classify specific file