This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathrun_cupy_combination_test.py
executable file
·69 lines (54 loc) · 1.96 KB
/
run_cupy_combination_test.py
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
#!/usr/bin/env python
import argparse
import os
import random
import argconfig
import docker
import shuffle
import version
params = {
'base': None,
'cuda_libs': docker.get_cuda_libs_choices('cupy'),
'numpy': docker.get_numpy_choices(),
'scipy': docker.get_scipy_choices(),
}
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Test script for multi-environment')
parser.add_argument('--id', type=int, required=True)
parser.add_argument('--no-cache', action='store_true')
parser.add_argument('--timeout', default='4h')
parser.add_argument('--interactive', action='store_true')
parser.add_argument(
'--clone-chainer', action='store_true',
help='clone chainer repository based on cupy version.')
argconfig.setup_argument_parser(parser)
args = parser.parse_args()
if version.is_master_branch('cupy'):
params['base'] = docker.base_choices_master_cupy
else:
params['base'] = docker.base_choices_stable_cupy
if args.clone_chainer:
version.clone_chainer()
conf = shuffle.make_shuffle_conf(params, args.id)
# pip has dropped Python 3.4 support since 19.2.
# TODO(niboshi): More generic and elegant approach to handle special requirements.
pip_require = 'pip<19.2' if docker.get_python_version(conf['base'])[:2] == (3, 4) else 'pip'
conf['requires'] = [
'setuptools<42',
pip_require,
'cython==0.29.22'
] + conf['requires']
volume = []
env = {'CUDNN': conf['cudnn']}
argconfig.parse_args(args, env, conf, volume)
argconfig.setup_coverage(args, env)
if args.interactive:
docker.run_interactive(
conf, no_cache=args.no_cache, volume=volume, env=env,
use_root=args.root)
else:
docker.run_with(
conf, './test_cupy.sh', no_cache=args.no_cache, volume=volume,
env=env, timeout=args.timeout, gpu_id=args.gpu_id,
use_root=args.root)