提交 f769c31d authored 作者: Frédéric Bastien's avatar Frédéric Bastien 提交者: GitHub

Merge pull request #6479 from abergeron/no_mpi_gpu

Don't initialize the GPU in MPI subprocesses.
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
BUILDBOT_DIR=$WORKSPACE/nightly_build BUILDBOT_DIR=$WORKSPACE/nightly_build
THEANO_PARAM="theano --with-timer --timer-top-n 10" THEANO_PARAM="theano --with-timer --timer-top-n 10"
# Exclude MPI tests that cannot complete properly
THEANO_PARAM="${THEANO_PARAM} -e test_mpi_roundtrip"
export THEANO_FLAGS=init_gpu_device=cuda export THEANO_FLAGS=init_gpu_device=cuda
# CUDA # CUDA
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
BUILDBOT_DIR=$WORKSPACE/nightly_build BUILDBOT_DIR=$WORKSPACE/nightly_build
THEANO_PARAM="theano --with-timer --timer-top-n 10 -v" THEANO_PARAM="theano --with-timer --timer-top-n 10 -v"
# Exclude MPI tests that cannot complete properly
THEANO_PARAM="${THEANO_PARAM} -e test_mpi_roundtrip"
export THEANO_FLAGS=init_gpu_device=cuda export THEANO_FLAGS=init_gpu_device=cuda
# CUDA # CUDA
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
BUILDBOT_DIR=$WORKSPACE/nightly_build BUILDBOT_DIR=$WORKSPACE/nightly_build
THEANO_PARAM="theano --with-timer --timer-top-n 10" THEANO_PARAM="theano --with-timer --timer-top-n 10"
# Exclude MPI tests that cannot complete properly
THEANO_PARAM="${THEANO_PARAM} -e test_mpi_roundtrip"
COMPILEDIR=$HOME/.theano/buildbot_theano_python3 COMPILEDIR=$HOME/.theano/buildbot_theano_python3
# Set test reports using nosetests xunit # Set test reports using nosetests xunit
XUNIT="--with-xunit --xunit-file=" XUNIT="--with-xunit --xunit-file="
......
...@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论