You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Building Tensorflow from source with XLA enabled and without GPU #11122
Hi,
I built and installed tensorflow from source with XLA enabled and GPU disabled (basically I opted N for everything while configuring via ./config except XLA enabling as Y). There were lot of warnings regrding deprecated syntax while building. but the build was successful.
I am able to import tensorflow and run basic print command in session. But while I try to do some computation (for eg. simple addition) it gives me following error: 2017-06-28 15:09:22.366052: F tensorflow/compiler/xla/statusor.cc:41] Attempting to fetch value instead of handling error Not found: could not find registered computation placer for platform Executor -- check target linkage
Aborted
I did a bit of debugging and this error comes just after the call from client/sessions.py:1262 to pywrap_tensorflow: tf_session.TF_Run(session, options,
feed_dict, fetch_list, target_list,
status, run_metadata)
so I believe it's because it is unable to link to _pywrap_tensorflow_internal.so.
Can you please provide any fix to this or is there something am doing wrong here?
This is blocking my further task so any kind of help is appreciated!
changed the title [-]Building Tensorflow from source with XLA and without GPU[/-][+]Building Tensorflow from source with XLA enabled and without GPU[/+]on Jun 28, 2017
I encounter this also having built on MacOS. I noticed that the error goes away if running in a test block if that helps identify what is happening.
This code does not error:
import tensorflow as tf
class BugTest(tf.test.TestCase):
def bug_test(self):
with tf.Session() as sess: #this can also use self.test_session()
x1 = tf.random_normal(shape=[64, 64, 32, 32], seed=1.)
res = sess.run(x1)
if __name__ == '__main__':
tf.test.main()
This code gives the error:
import tensorflow as tf
with tf.Session() as sess:
x1 = tf.random_normal(shape=[64, 64, 32, 32], seed=1.)
res = sess.run(x1)
I meet this error when running cnn benchmark. I build tensorflow from source, enabled both gpu and xla, latest version is this commit. I'm in a cloud environment using nfs. @mikowals both programs are ok in my environment.
import os
os.environ['CUDA_VISIBLE_DEVICES']=''
import tensorflow as tf
from tensorflow.contrib.compiler import jit
tf.reset_default_graph()
jit_scope = jit.experimental_jit_scope
with jit_scope(compile_ops=True):
N = 500*1000*1000
x = tf.Variable(tf.random_uniform(shape=(N,)))
y = 0.1*x*x*x*x*x-0.5*x*x*x*x+.25*x*x*x+.75*x*x-1.5*x-2
y0 = y[0]
import time
sess = tf.Session()
sess.run(tf.global_variables_initializer())
sess.run(y.op)
start_time = time.time()
print(sess.run(y0))
end_time = time.time()
print("%.2f sec"%(end_time-start_time))
gives:
2017-06-29 14:37:05.431926: F tensorflow/compiler/xla/statusor.cc:41] Attempting to fetch value instead of handling error Not found: could not find registered computation placer for platform Executor -- check target linkage
After adding with tf.device('/cpu') it works:
import os
os.environ['CUDA_VISIBLE_DEVICES']=''
import tensorflow as tf
from tensorflow.contrib.compiler import jit
tf.reset_default_graph()
jit_scope = jit.experimental_jit_scope
with jit_scope(compile_ops=True):
N = 500*1000*1000
with tf.device("/cpu"):
x = tf.Variable(tf.random_uniform(shape=(N,)))
y = 0.1*x*x*x*x*x-0.5*x*x*x*x+.25*x*x*x+.75*x*x-1.5*x-2
y0 = y[0]
import time
sess = tf.Session()
sess.run(tf.global_variables_initializer())
sess.run(y.op)
start_time = time.time()
print(sess.run(y0))
end_time = time.time()
print("%.2f sec"%(end_time-start_time))
2017-06-29 14:52:30.979254: I tensorflow/compiler/xla/service/service.cc:193] XLA service 0x7ff440159ca0 executing computations on platform Host. Devices:
2017-06-29 14:52:30.979277: I tensorflow/compiler/xla/service/service.cc:201] StreamExecutor device (0): <undefined>, <undefined>
-2.7442
0.68 sec
Built from sources with XLA and CUDA, commit: 270a3e8
Please provide details about what platform you are using (operating system, architecture). Also include your TensorFlow version. Also, did you compile from source or install a binary? Make sure you also include the exact command if possible to produce the output included in your test case. If you are unclear what to include see the issue template displayed in the Github new issue template.
We ask for this in the issue submission template, because it is really difficult to help without that information. Thanks!
@suiyuan2009 No need to "try cpu version". The snippet @mikowals provided works fine without the explicit specification of the device if gpus are available. But if they are not available for some reason (e.g. CUDA_VISIBLE_DEVICES='') - the code requires such explicit specification. Interesting, that this breaks cifar10 code.
Without explicit device specification, example.py:
import tensorflow as tf
x = tf.random_normal(shape=[64, 64, 32, 32], seed=1.)
with tf.Session() as sess:
res = sess.run(x)
CUDA_VISIBLE_DEVICES='' python example.py crashes with Attempting to fetch value instead of handling error Not found: could not find registered computation placer for platform Executor -- check target linkage Aborted (core dumped)
Exact command I ran which gave the error were as simple:
a = tf.placeholder(tf.float32)
b = tf.placeholder(tf.float32)
adder_node = a + b # + provides a shortcut for tf.add(a, b)
print(sess.run(adder_node, {a: 3, b:4.5}))
I placed it in a file and ran python example.py
I debugged and found out that it goes till pywrap_tensorflow run method: tf_session.TF_Run(session, options,
feed_dict, fetch_list, target_list,
status, run_metadata)
Although I hope tensorflow resolves this issue as the workaround won't be of much help later as I am trying to play around LLVM and I would prefer to run it without any hacks.
After the pip installation, tryed to run a Keras project and got this error:
"Using TensorFlow backend.
2017-07-04 10:30:20.681180: F tensorflow/compiler/xla/statusor.cc:41] Attempting to fetch value instead of handling error Not found: could not find registered computation placer for platform Executor -- check target linkage
Tried this way and the standard way from TensorFlow website.
My computer info:
OS: Ubuntu 16.04.2 LTS (Linux 4.8.0-51-generic)
Processor: i3-2100 CPU
Memory: 16.4 GB
Looks like this came in with the ComputationPlacer in 7d3497a. Although it might have just been exposed by that commit.
Specifically, this check fails for the Executor plugin. The TransferManager registers itself in the executor plugin (like this) so bodging in a similar thing for ComputationPlacer fixes the network I see the reported error on. eg:
I have the same problem (built from source, XLA and GPU enabled).
(Note that this error doesn't occur in the binary version from the official website.)
Code to reproduce the issue:
importtensorflowastfx=tf.ones([2, 1])
y=tf.layers.dense(x, 3)
sv=tf.train.Supervisor()
sess=sv.prepare_or_wait_for_session() # this triggers error
The error message:
2017-07-06 14:41:11.341941: F tensorflow/compiler/xla/statusor.cc:41] Attempting to fetch value instead of handling error Not found: could not find registered computation placer for platform Executor -- check target linkage
Aborted (core dumped)
However, replacing the last 2 lines with the following won't trigger the error.
Activity
[-]Building Tensorflow from source with XLA and without GPU[/-][+]Building Tensorflow from source with XLA enabled and without GPU[/+]mikowals commentedon Jun 29, 2017
I encounter this also having built on MacOS. I noticed that the error goes away if running in a test block if that helps identify what is happening.
This code does not error:
This code gives the error:
suiyuan2009 commentedon Jun 29, 2017
I meet this error when running cnn benchmark. I build tensorflow from source, enabled both gpu and xla, latest version is this commit. I'm in a cloud environment using nfs. @mikowals both programs are ok in my environment.
ankitachandak commentedon Jun 29, 2017
@mikowals are you running the test with bazel?
ankitachandak commentedon Jun 29, 2017
@suiyuan2009 I think there's issue when we do it without GPU support. Have you tried that?
ramanishka commentedon Jun 29, 2017
Faced the same thing running cifar10 example from https://github.com/tensorflow/models.
Here is the snippet from @yaroslavvb, link
gives:
After adding
with tf.device('/cpu')it works:Built from sources with XLA and CUDA, commit: 270a3e8
mikowals commentedon Jun 30, 2017
Forcing ops on the CPU seems to be a workaround for my reproduction also on a CPU only build.
@ankitachandak I am not testing with bazel, just running with python.
This code works:
suiyuan2009 commentedon Jun 30, 2017
@ankitachandak , I didn't try cpu version, our training data is very large.
alive-zk commentedon Jun 30, 2017
Please provide details about what platform you are using (operating system, architecture). Also include your TensorFlow version. Also, did you compile from source or install a binary? Make sure you also include the exact command if possible to produce the output included in your test case. If you are unclear what to include see the issue template displayed in the Github new issue template.
We ask for this in the issue submission template, because it is really difficult to help without that information. Thanks!
ramanishka commentedon Jun 30, 2017
@suiyuan2009 No need to "try cpu version". The snippet @mikowals provided works fine without the explicit specification of the device if gpus are available. But if they are not available for some reason (e.g. CUDA_VISIBLE_DEVICES='') - the code requires such explicit specification. Interesting, that this breaks cifar10 code.
@Ali01
Without explicit device specification, example.py:
CUDA_VISIBLE_DEVICES='' python example.pycrashes withAttempting to fetch value instead of handling error Not found: could not find registered computation placer for platform Executor -- check target linkage Aborted (core dumped)At the same time the version from g8bbec0b works.
I would assume that something happened in between.
ankitachandak commentedon Jul 3, 2017
@Ali01 I compiled from the source
I followed the instructions from https://www.tensorflow.org/install/install_sources
So cloned the latest Tensorflow version
OS Platform and Distribution: Linux Ubuntu 16.04
Python version: 2.7
Bazel: 0.5.2
CUDA/cuDNN version: None (As I said I am installing CPU version)
GPU model and memory: N/A
Exact command I ran which gave the error were as simple:
a = tf.placeholder(tf.float32)
b = tf.placeholder(tf.float32)
adder_node = a + b # + provides a shortcut for tf.add(a, b)
print(sess.run(adder_node, {a: 3, b:4.5}))
I placed it in a file and ran python example.py
I debugged and found out that it goes till pywrap_tensorflow run method:
tf_session.TF_Run(session, options,
feed_dict, fetch_list, target_list,
status, run_metadata)
ankitachandak commentedon Jul 3, 2017
@ramanishka @mikowals Yes force setting CPU works! Thanks for the hack.
Although I hope tensorflow resolves this issue as the workaround won't be of much help later as I am trying to play around LLVM and I would prefer to run it without any hacks.
oxydron commentedon Jul 4, 2017
Used the following command, trying to guarantee that it uses the SSE4.[1,2] and AVX:
After the pip installation, tryed to run a Keras project and got this error:
"Using TensorFlow backend.
2017-07-04 10:30:20.681180: F tensorflow/compiler/xla/statusor.cc:41] Attempting to fetch value instead of handling error Not found: could not find registered computation placer for platform Executor -- check target linkage
Tried this way and the standard way from TensorFlow website.
My computer info:
OS: Ubuntu 16.04.2 LTS (Linux 4.8.0-51-generic)
Processor: i3-2100 CPU
Memory: 16.4 GB
darrengarvey commentedon Jul 5, 2017
Looks like this came in with the
ComputationPlacerin 7d3497a. Although it might have just been exposed by that commit.Specifically, this check fails for the Executor plugin. The
TransferManagerregisters itself in the executor plugin (like this) so bodging in a similar thing forComputationPlacerfixes the network I see the reported error on. eg:However unsurprisingly this bodge doesn't fix the other test cases in this ticket. For instance the simple test case:
Now provokes:
JeremyCCHsu commentedon Jul 6, 2017
I have the same problem (built from source, XLA and GPU enabled).
(Note that this error doesn't occur in the binary version from the official website.)
Code to reproduce the issue:
The error message:
However, replacing the last 2 lines with the following won't trigger the error.
This yielded normal output and did not trigger core dump.
Unlike what @ramanishka mentioned, using
with tf.device('/cpu')cannot prevent the error in my case.System Info
OS: Ubuntu 16.04
Tensorflow: 1.2.1, built from source
commit ee4259a
(and commit 43a819e)
Python: 3.5.3
Bazel: release 0.5.2
CUDA/cuDNN: 8.0/6.0
GPU: GeForce GTX TITAN X
michaelisard commentedon Jul 10, 2017
@hyouklee it looks as if you added the ComputationPlacer code: would you take a look?
kayzhu commentedon Jul 10, 2017
I will take a look at this, since @hyouklee is away this week.
kayzhu commentedon Jul 12, 2017
Have a fix: the priority of XLA_EXEC is set too high in https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/plugin/executor/device.cc#L50 changing it to lower (40 for eg.) fixes the problem.
A fix should be merged upstream soon.
kayzhu commentedon Jul 14, 2017
Thanks @frankchn for the merge. This should now be fixed, but please feel free to reopen if the same symptom remains.
[TF:XLA] Fix an issue where plugin/Executor backend is used by defaul…
PR #11122: [ROCm] Fix RCCL hang on rocm5.7
PR #11122: [ROCm] Fix RCCL hang on rocm5.7
PR #11122: [ROCm] Fix RCCL hang on rocm5.7
PR #11122: [ROCm] Fix RCCL hang on rocm5.7