forked from horovod/horovod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
62 lines (53 loc) · 1.86 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
dist: trusty
language: python
python:
- "2.7"
- "3.4"
- "3.6"
before_install:
- sudo apt-get -qq update
- if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then pip install --upgrade pip; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then pip3 install --upgrade pip; fi
# upgrade numpy to make sure `import tensorflow` does not cause numpy version error
# RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa
- if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then pip install -U numpy; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then pip3 install -U numpy; fi
env:
matrix:
- TF_PACKAGE=tensorflow==1.1.0 MPI=OpenMPI
- TF_PACKAGE=tensorflow==1.3.0 MPI=OpenMPI
- TF_PACKAGE=tf-nightly MPI=OpenMPI
- TF_PACKAGE=tensorflow==1.1.0 MPI=MPICH
matrix:
fast_finish: true
exclude:
- python: "3.4"
env: TF_PACKAGE=tensorflow==1.1.0 MPI=MPICH
- python: "3.6"
env: TF_PACKAGE=tensorflow==1.1.0 MPI=MPICH
- python: "3.6"
env: TF_PACKAGE=tf-nightly MPI=OpenMPI
install:
- |
if [ $MPI == "OpenMPI" ]; then
# openmpi
wget https://www.open-mpi.org/software/ompi/v2.1/downloads/openmpi-2.1.1.tar.gz
gunzip -c openmpi-2.1.1.tar.gz | tar xf -
pushd openmpi-2.1.1 && ./configure --prefix=/usr/local && make -j8 all && sudo make all install && popd && sudo ldconfig
else
# installs mpich version 3.0.4
sudo apt-get install mpich
fi
# tensorflow
- if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then pip install $TF_PACKAGE; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then pip3 install $TF_PACKAGE; fi
# horovod
- python setup.py sdist
- pip install dist/horovod-*.tar.gz
script:
- |
if [ $MPI == "OpenMPI" ]; then
mpirun -allow-run-as-root -np 2 python horovod/tensorflow/mpi_ops_test.py
else
mpirun -np 2 python horovod/tensorflow/mpi_ops_test.py
fi