Skip to content

[Segmentation_UNet_Industrial/TensorFlow] Enabling XLA causes Memory error  #405

Description

@gherbox

I am running ./scripts/benchmarking/DGX1v_trainbench_FP32_1GPU.sh. I got the following memory error when I enabled XLA with the argument(--use_xla).

2020-02-20 11:49:21.373053: W tensorflow/core/common_runtime/bfc_allocator.cc:319] ***************__________________________________***************************************************
Traceback (most recent call last):
  File "/anaconda3_dell/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1356, in _do_call
    return fn(*args)
  File "/anaconda3_dell/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1341, in _run_fn
    options, feed_dict, fetch_list, target_list, run_metadata)
  File "/anaconda3_dell/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1429, in _call_tf_sessionrun
    run_metadata)
tensorflow.python.framework.errors_impl.ResourceExhaustedError: 2 root error(s) found.
  (0) Resource exhausted: Out of memory while trying to allocate 68852648264 bytes.
         [[{{node cluster_0_1/xla_run}}]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

         [[cluster_0_1/merge_oidx_11/_2257]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

  (1) Resource exhausted: Out of memory while trying to allocate 68852648264 bytes.
         [[{{node cluster_0_1/xla_run}}]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

0 successful operations.
0 derived errors ignored.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/DeepLearningExamples/TensorFlow/Segmentation/UNet_Industrial/scripts/benchmarking/../../main.py", line 146, in <module>
    is_benchmark=RUNNING_CONFIG.exec_mode == 'training_benchmark'
  File "/DeepLearningExamples/TensorFlow/Segmentation/UNet_Industrial/runtime/runner.py", line 515, in train
    hooks=training_hooks,
  File "/anaconda3_dell/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 367, in train
    loss = self._train_model(input_fn, hooks, saving_listeners)
  File /anaconda3_dell/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1158, in _train_model
    return self._train_model_default(input_fn, hooks, saving_listeners)
  File "/anaconda3_dell/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1192, in _train_model_default
    saving_listeners)
  File "/anaconda3_dell/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1484, in _train_with_estimator_spec
    _, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
  File "/anaconda3_dell/lib/python3.7/site-packages/tensorflow/python/training/monitored_session.py", line 754, in run
    run_metadata=run_metadata)
  File "/anaconda3_dell/lib/python3.7/site-packages/tensorflow/python/training/monitored_session.py", line 1252, in run
    run_metadata=run_metadata)
  File "/anaconda3_dell/lib/python3.7/site-packages/tensorflow/python/training/monitored_session.py", line 1353, in run
    raise six.reraise(*original_exc_info)
  File "/anaconda3_dell/lib/python3.7/site-packages/six.py", line 703, in reraise
    raise value
  File "/anaconda3_dell/lib/python3.7/site-packages/tensorflow/python/training/monitored_session.py", line 1338, in run
    return self._sess.run(*args, **kwargs)
  File "/anaconda3_dell/lib/python3.7/site-packages/tensorflow/python/training/monitored_session.py", line 1411, in run
    run_metadata=run_metadata)
  File "/anaconda3_dell/lib/python3.7/site-packages/tensorflow/python/training/monitored_session.py", line 1169, in run
    return self._sess.run(*args, **kwargs)
  File "/anaconda3_dell/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 950, in run
    run_metadata_ptr)
  File "/anaconda3_dell/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1173, in _run
    feed_dict_tensor, options, run_metadata)
  File "/anaconda3_dell/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1350, in _do_run
    run_metadata)
  File "/anaconda3_dell/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1370, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.ResourceExhaustedError: 2 root error(s) found.
  (0) Resource exhausted: Out of memory while trying to allocate 68852648264 bytes.
         [[{{node cluster_0_1/xla_run}}]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

         [[cluster_0_1/merge_oidx_11/_2257]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

  (1) Resource exhausted: Out of memory while trying to allocate 68852648264 bytes.
         [[{{node cluster_0_1/xla_run}}]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

Environment

  • Tensorflow 1.14:
  • CUDA 10.1:
  • openmpi 4.0.1

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions