Skip to content

Test with Chainer v6 on CI #247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 5 additions & 43 deletions .flexci/config.pbtxt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
configs {
key: "onnxchainer.chainer-stable"
key: "onnxchainer.chainerv6"
value {
requirement {
cpu: 4
Expand All @@ -11,51 +11,13 @@ configs {
seconds: 600
}
command: "sh .flexci/run_test.sh"
environment_variables {
key: "PYTHON_VER"
value: "37"
}
environment_variables {
key: "CHAINER_INSTALL"
value: ""
}
environment_variables {
key: "EXAMPLE_ARGS"
value: "-G 0"
}
}
}

configs {
key: "onnxchainer.chainer-pre"
value {
requirement {
cpu: 4
disk: 10
memory: 16
gpu: 1
}
time_limit {
seconds: 600
}
command: "sh .flexci/run_test.sh"
environment_variables {
key: "PYTHON_VER"
value: "37"
}
environment_variables {
key: "CHAINER_INSTALL"
value: "--pre"
}
environment_variables {
key: "EXAMPLE_ARGS"
value: "-G 0"
}
environment_variables { key: "PYTHON_VER" value: "37" }
environment_variables { key: "GPU" value: "0" }
}
}

configs {
key: "onnxchainer.win.chainer-pre"
key: "onnxchainer.win.chainerv6"
value {
requirement {
cpu: 4
Expand All @@ -67,6 +29,6 @@ configs {
time_limit {
seconds: 600
}
command: ".flexci\\run_test.bat 10_0 37"
command: ".flexci\\run_test.bat 10.1 37"
}
}
13 changes: 0 additions & 13 deletions .flexci/run_example.sh

This file was deleted.

8 changes: 4 additions & 4 deletions .flexci/run_test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

set CUDA_VER=%1
set PY_VER=%2
set CUDA_PATH=CUDA_PATH_V%CUDA_VER%
set "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VER%"
set PY_PATH=C:\Development\Python\Python%PY_VER%
set PATH=%CUDA_PATH%\bin;%CUDA_PATH%\libnvvp;%PY_PATH%;%PY_PATH%\Scripts\%PATH%

pip install --pre cupy-cuda100
pip install --pre chainer
pip install -U -e .[flexci]
pip install "cupy-cuda101<7.0.0"
pip install "chainer<7.0.0"
pip install -e .[flexci]
pip list -v

pytest -x -s -vvvs tests --cov onnx_chainer
33 changes: 27 additions & 6 deletions .flexci/run_test.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
#! /usr/bin/env sh
set -eux

export INSTALL_CUPY=""
export EXAMPLE_ARGS=""
export DOCKER_RUNTIME_ARG=""
export PYTEST_ARGS="-m \"not gpu\""
if [ -n "${GPU+x}" ]; then
export INSTALL_CUPY="on"
export EXAMPLE_ARGS="-G "${GPU}
export DOCKER_RUNTIME_ARG="--runtime=nvidia"
export PYTEST_ARGS=""
fi
if [ -z "${ONNX_VER+x}" ]; then export ONNX_VER=""; fi

cat <<EOM >test_script.sh
set -eux

pip install ${CHAINER_INSTALL} cupy-cuda101
pip install ${CHAINER_INSTALL} chainer
pip install -U -e .[flexci]
pytest -x -s -vvvs tests/ --cov onnx_chainer
if [[ "${INSTALL_CUPY}" == "on" ]]; then pip install 'cupy-cuda101<7.0.0'; fi
pip install 'chainer<7.0.0'
pip install -e .[flexci]
if [[ "${ONNX_VER}" != "" ]]; then pip install onnx==${ONNX_VER}; fi
pip list -v
pytest -x -s -vvvs ${PYTEST_ARGS} tests/ --cov onnx_chainer

. .flexci/run_example.sh "${EXAMPLE_ARGS}"
pip install chainercv
export CHAINERCV_DOWNLOAD_REPORT="OFF"
for dir in \`ls examples\`
do
if [[ -f examples/\${dir}/export.py ]]; then
python examples/\${dir}/export.py -T ${EXAMPLE_ARGS}
fi
done
EOM

docker run --runtime=nvidia -i --rm \
docker run ${DOCKER_RUNTIME_ARG} -i --rm \
-v $(pwd):/root/onnx-chainer --workdir /root/onnx-chainer \
disktnk/onnx-chainer:ci-py${PYTHON_VER} \
/bin/bash /root/onnx-chainer/test_script.sh
22 changes: 5 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,18 @@ language: python

matrix:
include:
- name: "Py35, Chainer stable"
- name: "Py35, Chainer v6"
python: "3.5"
- name: "Py36, Chainer stable, ONNX 1.4.1"
- name: "Py36, Chainer v6, ONNX 1.4.1"
python: "3.6"
env:
- ONNX_VER="1.4.1"
- name: "Py36, Chainer stable"
- name: "Py36, Chainer v6"
python: "3.6"
- name: "Py37, Chainer stable"
- name: "Py37, Chainer v6"
python: "3.7"
env:
- ONNX_CHAINER_DEPLOY_JOB=1
- name: "Py35, Chainer pre-release"
python: "3.5"
env:
- CHAINER_INSTALL="--pre"
- name: "Py36, Chainer pre-release"
python: "3.6"
env:
- CHAINER_INSTALL="--pre"
- name: "Py37, Chainer pre-release"
python: "3.7"
env:
- CHAINER_INSTALL="--pre"

addons:
apt:
Expand All @@ -40,7 +28,7 @@ notifications:
email: false

before_install:
- pip install $CHAINER_INSTALL chainer
- pip install 'chainer<7.0.0'
- pip install -U -e .[travis]
- if [[ $ONNX_VER != "" ]]; then pip install onnx==$ONNX_VER; fi
- pip list -v
Expand Down