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

_pkgname=horovod
pkgname=python-horovod
pkgver=0.28.0
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
  python-build
  python-installer
  python-pytorch-cuda
  python-setuptools
  python-tensorflow-cuda
  python-wheel
)
optdepends=(
  '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')

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_BUILD_CUDA_CC_LIST="60,61,62,70,72,75,80,86,89,90"
  export HOROVOD_CPU_OPERATIONS=GLOO
  export HOROVOD_CUDA_HOME=/opt/cuda
  export HOROVOD_GPU=CUDA
  export HOROVOD_GPU_OPERATIONS=NCCL
  export HOROVOD_NCCL_LINK=SHARED
  export HOROVOD_WITHOUT_MXNET=1
  export HOROVOD_WITH_GLOO=1
  export HOROVOD_WITH_MPI=1
  export HOROVOD_WITH_PYTORCH=1
  export HOROVOD_WITH_TENSORFLOW=1
  export CC=/opt/cuda/bin/gcc
  export CXX=/opt/cuda/bin/g++
  # fix https://github.com/horovod/horovod/issues/3923
  cd "third_party/gloo"
  git pull https://github.com/facebookincubator/gloo.git
}

build() {
  cd "${_pkgname}-${pkgver}"
  python -m build --wheel --no-isolation -x
}

package() {
  cd "${_pkgname}-${pkgver}"
  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
# vim:set ts=2 sw=2 et: