提交 df1715e2 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Don't initialize the GPU in MPI subprocesses.

上级 25dfa312
...@@ -46,17 +46,18 @@ def test_mpi_roundtrip(): ...@@ -46,17 +46,18 @@ def test_mpi_roundtrip():
if not mpi_enabled: if not mpi_enabled:
raise SkipTest('MPI not enabled') raise SkipTest('MPI not enabled')
theano_root = theano.__file__.split('__init__')[0] theano_root = theano.__file__.split('__init__')[0]
d = {} env = os.environ.copy()
if PY3: flags = env['THEANO_FLAGS']
# Is some not understood cases, the subprocess never finish. keep_flags = ','.join((f for f in flags.split(',') if not f.startswith('init_gpu_device')))
d = dict(timeout=5*60) env['THEANO_FLAGS'] = keep_flags
p = subprocess.Popen("mpiexec -np 2 python " + theano_root + p = subprocess.Popen("mpiexec -np 2 python " + theano_root +
"tensor/tests/_test_mpi_roundtrip.py", "tensor/tests/_test_mpi_roundtrip.py",
stdin=subprocess.PIPE, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, stderr=subprocess.PIPE,
shell=True, shell=True,
close_fds=True, **d) close_fds=True,
env=env)
(stdout, stderr) = p.communicate() (stdout, stderr) = p.communicate()
result = theano.compat.decode(stdout) result = theano.compat.decode(stdout)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论