-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathtox.ini
124 lines (115 loc) · 5.5 KB
/
tox.ini
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
112
113
114
115
116
117
118
119
120
121
122
123
124
; For all tests that run in Github Actions, see
; .github/workflows/cpu-ci.yml for the workflow definition.
[tox]
envlist = py38-gpu,py38-multi-gpu
[testenv]
commands =
pip install --upgrade pip
pip install -e .[all]
[testenv:py38-gpu]
; Runs in: Github Actions
; Runs GPU-based tests.
deps =
-rrequirements/test.txt
setenv =
CUDA_VISIBLE_DEVICES=0
TF_GPU_ALLOCATOR=cuda_malloc_async
sitepackages=true
commands =
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git@{posargs:main}
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/dataloader.git@{posargs:main}
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/nvtabular.git@{posargs:main}
python -m pytest --cov-report term --cov merlin -rxs tests/unit/
[testenv:py38-multi-gpu]
; Runs in: Github Actions
; Runs GPU-based tests.
allowlist_externals =
bash
horovodrun
passenv =
OPAL_PREFIX
setenv =
TF_GPU_ALLOCATOR=cuda_malloc_async
sitepackages=true
commands =
# Install Merlin packages
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git@{posargs:main}
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/dataloader.git@{posargs:main}
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/nvtabular.git@{posargs:main}
# Install distributed embeddings and check build
# TODO: Move distributed-embeddings installation to CI runner.
bash examples/usecases/multi-gpu/install_distributed_embeddings.sh {envtmpdir}
# Run multi-gpu tests marked with `horovod` marker
horovodrun -np 2 sh examples/usecases/multi-gpu/hvd_wrapper.sh python -m pytest -m horovod -rxs tests/unit
[testenv:py38-horovod-cpu]
setenv =
HOROVOD_WITH_MPI=1
HOROVOD_WITH_TENSORFLOW=1
PATH={env:PATH}{:}{envdir}/env/bin
LD_LIBRARY_PATH={env:LD_LIBRARY_PATH}{:}{envdir}/env/lib
commands =
conda update --yes --name base --channel defaults conda
conda env create --prefix {envdir}/env --file requirements/horovod-cpu-environment.yml --force
# Install horovod and check build
{envdir}/env/bin/python -m pip install horovod --no-cache-dir
{envdir}/env/bin/horovodrun --check-build
# Install Merlin packages
{envdir}/env/bin/python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git
{envdir}/env/bin/python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/dataloader.git
{envdir}/env/bin/python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/nvtabular.git
# Run multi-gpu tests marked with `horovod` marker
{envdir}/env/bin/horovodrun -np 2 sh examples/usecases/multi-gpu/hvd_wrapper.sh {envdir}/env/bin/python -m pytest -m horovod -rxs tests/unit
[testenv:py38-nvtabular-cpu]
passenv=GIT_COMMIT
allowlist_externals = git
deps =
-rrequirements/base.txt
-rrequirements/dev.txt
commands =
; the GIT_COMMIT env is the current commit of the models repo
git clone --depth 1 --branch {posargs:main} https://github.com/NVIDIA-Merlin/NVTabular.git nvtabular-{env:GIT_COMMIT}
python -m pip install --upgrade "./nvtabular-{env:GIT_COMMIT}"
python -m pip install --upgrade -r "./nvtabular-{env:GIT_COMMIT}/requirements/test.txt"
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git@{posargs:main}
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/dataloader.git@{posargs:main}
python -m pip install .
python -m pytest nvtabular-{env:GIT_COMMIT}/tests/unit
[testenv:py38-systems-cpu]
passenv=GIT_COMMIT
allowlist_externals = git
deps =
-rrequirements/base.txt
-rrequirements/dev.txt
commands =
; the GIT_COMMIT env is the current commit of the core repo
git clone --depth 1 --branch {posargs:main} https://github.com/NVIDIA-Merlin/systems.git systems-{env:GIT_COMMIT}
python -m pip install --upgrade "./systems-{env:GIT_COMMIT}"
python -m pip install --upgrade -r "./systems-{env:GIT_COMMIT}/requirements/test-cpu.txt"
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git@{posargs:main}
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/dataloader.git@{posargs:main}
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/NVTabular.git@{posargs:main}
python -m pip install .
python -m pytest -m "not notebook" systems-{env:GIT_COMMIT}/tests/unit
[testenv:docs]
; Runs in: Github Actions
; Generates documentation with sphinx. There are other steps in the Github Actions workflow
; to publish the documentation on release.
changedir = {toxinidir}
deps = -rrequirements/docs.txt
{[testenv:py38-gpu]deps}
commands =
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/dataloader.git
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/nvtabular.git
python -m sphinx.cmd.build -E -P -b html docs/source docs/build/html
[testenv:docs-multi]
; Run the multi-version build that is shown on GitHub Pages.
changedir = {toxinidir}
deps = -rrequirements/docs.txt
{[testenv:py38-gpu]deps}
commands =
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/dataloader.git
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/nvtabular.git
sphinx-multiversion --dump-metadata docs/source docs/build/html | jq "keys"
sphinx-multiversion docs/source docs/build/html