Skip to content

Commit 378add5

Browse files
authored
Disable GPU for parameter process (#121)
1 parent c4abcae commit 378add5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def read(fname):
4949
'Programming Language :: Python :: 3.6',
5050
],
5151

52-
install_requires=['sagemaker-containers>==2.3.1', 'numpy', 'scipy', 'sklearn',
52+
install_requires=['sagemaker-containers>=2.3.4', 'numpy', 'scipy', 'sklearn',
5353
'pandas', 'Pillow', 'h5py'],
5454
extras_require={
5555
'test': ['tox', 'flake8', 'pytest', 'pytest-cov', 'pytest-xdist', 'mock',

src/sagemaker_tensorflow_container/training.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ def _env_vars_with_tf_config(env, ps_task):
9999

100100
def _run_ps(env):
101101
env_vars = _env_vars_with_tf_config(env, ps_task=True)
102+
# Parameter server processes should always run on CPU. Sets CUDA_VISIBLE_DEVICES to '-1' forces
103+
# TensorFlow to use CPU.
104+
env_vars['CUDA_VISIBLE_DEVICES'] = json.dumps(-1)
102105
framework.entry_point.run(env.module_dir, env.user_entry_point,
103106
env.to_cmd_args(), env_vars, wait=False)
104107

0 commit comments

Comments
 (0)