-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
/
Copy pathtest-python-wheel-impl.sh
executable file
·75 lines (67 loc) · 2.09 KB
/
test-python-wheel-impl.sh
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
#!/bin/bash
## Companion script for ops/pipeline/test-python-wheel.sh
set -eo pipefail
if [[ "$#" -lt 1 ]]
then
echo "Usage: $0 {gpu|mgpu|cpu|cpu-arm64}"
exit 1
fi
suite="$1"
# Cannot set -u before Conda env activation
case "$suite" in
gpu|mgpu)
source activate gpu_test
;;
cpu)
source activate linux_cpu_test
;;
cpu-arm64)
source activate aarch64_test
;;
*)
echo "Unrecognized argument: $suite"
exit 1
;;
esac
set -xu
export PYSPARK_DRIVER_PYTHON=$(which python)
export PYSPARK_PYTHON=$(which python)
export SPARK_TESTING=1
pip install -v ./wheelhouse/*.whl
case "$suite" in
gpu)
echo "-- Run Python tests, using a single GPU"
python -c 'from cupy.cuda import jitify; jitify._init_module()'
pytest -v -s -rxXs --fulltrace --durations=0 -m 'not mgpu' tests/python-gpu
;;
mgpu)
echo "-- Run Python tests, using multiple GPUs"
python -c 'from cupy.cuda import jitify; jitify._init_module()'
export NCCL_RAS_ENABLE=0
pytest -v -s -rxXs --fulltrace --durations=0 -m 'mgpu' tests/python-gpu
pytest -v -s -rxXs --fulltrace --durations=0 -m 'mgpu' \
tests/test_distributed/test_gpu_with_dask
pytest -v -s -rxXs --fulltrace --durations=0 -m 'mgpu' \
tests/test_distributed/test_gpu_with_spark
pytest -v -s -rxXs --fulltrace --durations=0 -m 'mgpu' \
tests/test_distributed/test_gpu_federated
;;
cpu)
echo "-- Run Python tests (CPU)"
export RAY_OBJECT_STORE_ALLOW_SLOW_STORAGE=1
pytest -v -s -rxXs --fulltrace --durations=0 tests/python
pytest -v -s -rxXs --fulltrace --durations=0 tests/test_distributed/test_with_dask
pytest -v -s -rxXs --fulltrace --durations=0 tests/test_distributed/test_with_spark
pytest -v -s -rxXs --fulltrace --durations=0 tests/test_distributed/test_federated
;;
cpu-arm64)
echo "-- Run Python tests (CPU, ARM64)"
pytest -v -s -rxXs --fulltrace --durations=0 \
tests/python/test_basic.py tests/python/test_basic_models.py \
tests/python/test_model_compatibility.py
;;
*)
echo "Unrecognized argument: $suite"
exit 1
;;
esac