summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cc79a41bd6f5709fb2f8f9ed972f9be6354e8d2c (plain)
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
# Maintainer: Butui Hu <hot123tea123@gmail.com>

_pkgname=horovod
pkgname=python-horovod
pkgver=0.21.3
pkgrel=1
pkgdesc='Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet'
arch=('x86_64')
url='https://github.com/horovod/horovod'
license=('Apache')
depends=(
  cuda
  cudnn
  nccl
  openmpi
  python-cloudpickle
  python-h5py
  python-mock
  python-mpi4py
  python-psutil
  python-pycparser
  python-pyaml
  python-scipy
  python-six
  python-tqdm
)
makedepends=(
  cmake
  git
  mxnet-cuda
  python-pip
  python-pytorch-cuda
  python-setuptools
  python-tensorflow-cuda
)
optdepends=(
  'mxnet-cuda: mxnet framework'
  'python-pytorch-cuda: pytorch framework'
  'python-tensorflow-cuda: tensorflow framework'
)
source=("${_pkgname}-${pkgver}::git+https://github.com/horovod/horovod.git#tag=v${pkgver}")
sha512sums=('SKIP')

get_pyver() {
  python -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))'
}

prepare() {
  cd "${_pkgname}-${pkgver}"
  git submodule update --init --recursive
# modify these environment variable as you need, see also https://github.com/horovod/horovod/blob/master/docs/install.rst
  export HOROVOD_CUDA_HOME=/opt/cuda
  export HOROVOD_CPU_OPERATIONS=GLOO
  export HOROVOD_GPU=CUDA
  export HOROVOD_GPU_ALLREDUCE=NCCL
  export HOROVOD_GPU_BROADCAST=NCCL
  export HOROVOD_WITH_GLOO=1
  export HOROVOD_WITH_MPI=1
  export HOROVOD_WITH_MXNET=1
  export HOROVOD_WITH_PYTORCH=1
  export HOROVOD_WITH_TENSORFLOW=1
  export HOROVOD_BUILD_CUDA_CC_LIST="52,53,60,61,62,70,72,75,80"
  export CC=/opt/cuda/bin/gcc
  export CXX=/opt/cuda/bin/g++
  export MAKEFLAGS="-j1"
}

build() {
  cd "${_pkgname}-${pkgver}"
  python setup.py build
}

package() {
  cd "${_pkgname}-${pkgver}"
  python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
  install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
# vim:set ts=2 sw=2 et: