models icon indicating copy to clipboard operation
models copied to clipboard

how to enable xla with estimator

Open zsk423200 opened this issue 7 years ago • 2 comments

cuda:9.0 tensorflow:1.12.0 What is the top-level directory of the model you are using: official/resnet Have I written custom code:No OS Platform and Distribution:Ubuntu16.04 MirroredStrategy TensorFlow installed from:pip install TensorFlow version:1.12.0 Bazel version: CUDA/cuDNN version:cuda9.0 GPU model and memory:v100 32G Exact command to reproduce : python imagenet_main.py --data_dir=/data/resnet-tf/tfrecord/ --batch_size=128 --ara='nccl' --num_gpus=2

in resnet_run_loop.py,i want to enable xla, so i add

session_config = tf.ConfigProto()
session_config.graph_options.optimizer_options.global_jit_level = tf.OptimizerOptions.ON_1

but when i train by one gpu, and the distribute strategy is OneDeviceStrategy("device:GPU:0"), xla is ok, but when i train by two gpus, and the distribute strategy is MirroredStrategy, xla has error:

2019-01-30 10:55:06.902650: W tensorflow/compiler/xla/service/gpu/nvptx_compiler.cc:402] *** WARNING *** You are using ptxas 9.0.176, which is older than 9.2.88. ptxas 9.x before 9.2.88 is known to miscompile XLA code, leading to incorrect results or invalid-address errors.

You do not need to update to CUDA 9.2.88; cherry-picking the ptxas binary is sufficient.
I0130 10:55:37.183267 140192737777408 tf_logging.py:115] Running local_init_op.
I0130 10:55:37.853480 140192737777408 tf_logging.py:115] Done running local_init_op.
I0130 10:56:25.948692 140192737777408 tf_logging.py:115] Saving checkpoints for 20020 into /tmp/model.ckpt.
2019-01-30 10:57:17.807557: E tensorflow/stream_executor/cuda/cuda_dnn.cc:373] Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
2019-01-30 10:57:17.807765: E tensorflow/compiler/xla/service/gpu/cudnn_convolution_algorithm_picker.cc:338] Internal: All algorithms tried for convolution %custom-call = (f32[64,256,56,56]{3,2,1,0}, u8[0]{0}) custom-call(f32[64,64,56,56]{3,2,1,0} %reduce-window.13518.10568, f32[1,1,64,256]{1,0,2,3} %copy.56), window={size=1x1}, dim_labels=bf01_01io->bf01, custom_call_target="__cudnn$convForward", backend_config="{\"convResultScale\":1}" failed.  Falling back to default algorithm.

or

*** WARNING *** You are using ptxas 9.0.176, which is older than 9.2.88. ptxas 9.x before 9.2.88 is known to miscompile XLA code, leading to incorrect results or invalid-address errors.

You do not need to update to CUDA 9.2.88; cherry-picking the ptxas binary is sufficient.
I0130 11:05:42.691364 140448661317376 tf_logging.py:115] Running local_init_op.
I0130 11:05:43.474775 140448661317376 tf_logging.py:115] Done running local_init_op.
I0130 11:06:26.442031 140448661317376 tf_logging.py:115] Saving checkpoints for 20020 into /tmp/model.ckpt.
I0130 11:07:53.810114 140448661317376 tf_logging.py:115] cross_entropy = 2.8381975, learning_rate = 0.02560256, train_accuracy = 0.390625
I0130 11:07:53.812137 140448661317376 tf_logging.py:115] loss = 6.150483, step = 20020

E0130 11:09:08.093458 140448661317376 tf_logging.py:105] Model diverged with loss = NaN.

zsk423200 avatar Jan 30 '19 02:01 zsk423200

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks. What is the top-level directory of the model you are using Have I written custom code OS Platform and Distribution TensorFlow installed from TensorFlow version Bazel version CUDA/cuDNN version GPU model and memory Exact command to reproduce

tensorflowbutler avatar Jan 31 '19 00:01 tensorflowbutler

Hi There, We are checking to see if you still need help on this, as this seems to be an old issue. Please update this issue with the latest information, code snippet to reproduce your issue and error you are seeing. If we don't hear from you in the next 7 days, this issue will be closed automatically. If you don't need help on this issue any more, please consider closing this.

tensorflowbutler avatar Mar 18 '20 21:03 tensorflowbutler