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
Trying to build a C++ binary with tfcompile crashes with INVALID ARGUMENTS: Mising Exit successor to rnn/while/Switch if the graph contains tf.nn.dynamic_rnn, but it works with tf.nn.static_rnn. Why is this?
@carlthome What version of tensorflow are you using? Since XLA and tfcompile support is currently experimental, I'll suggest you build from sources at HEAD.
Also, can you provide a minimal test case that demonstrates the problem? Thanks!
I've been able to consistently reproduce the error INVALID ARGUMENTS: Missing Exit successor to rnn/while/Switch with master, thanks to @patrikohlsson's example. Perhaps @ebrevdo has some insight into what makes tf.nn.dynamic_rnn finicky with tfcompile?
The tf.nn.dynamic_rnn library uses TensorFlow control-flow, which isn't well supported by XLA. There's a little bit of special support in the JIT codepath, but the AOT (i.e. tfcompile) codepath doesn't support this at all right now.
Errors about Enter, Exit, Switch and Merge nodes are all symptoms of of this problem.
There is no workaround at the moment. There are some in-process discussions and prototyping about how to handle this. Our exact approach hasn't been fleshed out yet.
Cool. It would be nice if XLA AOT supported loops eventually. Is there a list in the documentation about what ops are not well supported at the moment? Particularly, the tf.nn stuff I'd expect to work as it's a core package.
For my particular use case with a recurrent neural network (RNN), it's fine to unroll it manually before tfcompile and pad/truncate test data as needed, but I'd imagine there are applications where that fix would not be straightforward.
Keep in mind that tf.nn.dynamic_rnn relies on tf.while_loop; there are now
some XLA primitives you can use (as of the last couple of days) in github
master; see, i.e.,
3e9cd2eeb1fe50
You'll want to download a tensorflow nightly if you want to try it.
Keep in mind this code will perform a *full unroll* internally on the XLA
side, and nested while_loops (while_loop inside a dynamic_rnn) are not
really supported.
You want to be really careful with this new, relatively untested, xla
bridge. See the new xla rnn unit tests for examples.
@ebrevdo What happens for a tf.nn.bidirectional_dynamic_rnn with no sequence_length argument? I am currently removing it because tfcompile chokes on Assert. This used to work quite well, but since r1.4, compiling with the recurrent layers, even very small ones, fails in a way that looks like infite loop consuming as much as CPU and memory as possible. Last time I tried master, it was exposing the same behavior.
My guess is that this is because of the lack of sequence_length, and thus it goes weird.
However, keeping the sequence_length fails this way:
2018-01-05 18:29:44.901953: F external/org_tensorflow/tensorflow/compiler/aot/tfcompile_main.cc:140] Non-OK-status: status status: Not found: Op type not registered 'Assert' in binary running on hostname. Make sure the Op and Kernel are registered in the binary running in this process.
On Fri, Jan 5, 2018 at 9:31 AM, lissyx ***@***.***> wrote:
@ebrevdo <https://github.com/ebrevdo> What happens for a
tf.nn.bidirectional_dynamic_rnn with no sequence_length argument? I am
currently removing it because tfcompile chokes on Assert. This used to
work quite well, but since r1.4, compiling with the recurrent layers, even
very small ones, fails in a way that looks like infite loop consuming as
much as CPU and memory as possible. Last time I tried master, it was
exposing the same behavior.
My guess is that this is because of the lack of sequence_length, and thus
it goes weird.
However, keeping the sequence_length fails this way:
2018-01-05 18:29:44.901953: F external/org_tensorflow/tensorflow/compiler/aot/tfcompile_main.cc:140] Non-OK-status: status status: Not found: Op type not registered 'Assert' in binary running on hostname. Make sure the Op and Kernel are registered in the binary running in this process.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11275 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABtim94v9vVSrpLY4dtR0F2-sx8nFxbXks5tHlxxgaJpZM4ONgEv>
.
Activity
drpngx commentedon Jul 4, 2017
@tatatodd any idea?
tatatodd commentedon Jul 6, 2017
@carlthome What version of tensorflow are you using? Since XLA and tfcompile support is currently experimental, I'll suggest you build from sources at HEAD.
Also, can you provide a minimal test case that demonstrates the problem? Thanks!
patrikohlsson commentedon Jul 7, 2017
I'm having the same issue with tfcompile and tf.nn.dynamic_rnn.
OS:
Ubuntu 16.04
TF version:
1.2.1 built from source without GPU support and no XLA JIT.
Test case:
outgraph.config.pbtxt:
BUILD file:
Command:
bazel build //tensorflow/compiler/aot/tests/test_dyn_rnn:test_dyn_rnnThe build command results in
INVALID ARGUMENTS: Missing Exit successor to encoder/rnn/while/Switch.Swapping to
tf.nn.static_rnnworks however.Here's a complete example.
carlthome commentedon Jul 11, 2017
I've been able to consistently reproduce the error
INVALID ARGUMENTS: Missing Exit successor to rnn/while/Switchwith master, thanks to @patrikohlsson's example. Perhaps @ebrevdo has some insight into what makestf.nn.dynamic_rnnfinicky with tfcompile?patrikohlsson commentedon Jul 13, 2017
With the XLA JIT fix posted by kayzhu in #11122 I can now reproduce the
Missing Exit successorwith XLA JIT enabled as well.tatatodd commentedon Jul 13, 2017
The
tf.nn.dynamic_rnnlibrary uses TensorFlow control-flow, which isn't well supported by XLA. There's a little bit of special support in the JIT codepath, but the AOT (i.e. tfcompile) codepath doesn't support this at all right now.Errors about
Enter,Exit,SwitchandMergenodes are all symptoms of of this problem.There is no workaround at the moment. There are some in-process discussions and prototyping about how to handle this. Our exact approach hasn't been fleshed out yet.
@hawkinsp may have some more details.
carlthome commentedon Jul 13, 2017
Cool. It would be nice if XLA AOT supported loops eventually. Is there a list in the documentation about what ops are not well supported at the moment? Particularly, the
tf.nnstuff I'd expect to work as it's a core package.For my particular use case with a recurrent neural network (RNN), it's fine to unroll it manually before tfcompile and pad/truncate test data as needed, but I'd imagine there are applications where that fix would not be straightforward.
tatatodd commentedon Jul 13, 2017
@carlthome Yeah, one way or another we'll have support for loops in XLA AOT; we just need to work out the technical details.
We don't have documentation about what TensorFlow ops we support via XLA AOT or JIT at the moment, but the implementation of all of the TF->XLA translations is here:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/compiler/tf2xla/kernels
And yes, thanks for mentioning unrolling. Indeed for some models, a workaround is to statically unroll your loops before feeding into XLA. An example for LSTMs is here:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/tests/lstm.py
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/tests/lstm_test.py
ebrevdo commentedon Jul 13, 2017
jart commentedon Jul 13, 2017
@tatatodd I'm assigning to you to take out of triage queue. Feel free to re-assign
carlthome commentedon Sep 19, 2017
ETA on tf.nn.dynamic_rnn support in XLA AOT?
13 remaining items
tensorflowbutler commentedon Jan 4, 2018
It has been 14 days with no activity and this issue has an assignee.Please update the label and/or status accordingly.
lissyx commentedon Jan 5, 2018
@ebrevdo What happens for a
tf.nn.bidirectional_dynamic_rnnwith nosequence_lengthargument? I am currently removing it becausetfcompilechokes onAssert. This used to work quite well, but since r1.4, compiling with the recurrent layers, even very small ones, fails in a way that looks like infite loop consuming as much as CPU and memory as possible. Last time I tried master, it was exposing the same behavior.My guess is that this is because of the lack of
sequence_length, and thus it goes weird.However, keeping the
sequence_lengthfails this way:ebrevdo commentedon Jan 5, 2018
tatatodd commentedon Jan 5, 2018
Last I heard, @prb12 was working on adding a no-op tf2xla kernel for tf.Assert, he would know more.
tensorflowbutler commentedon Jan 24, 2018
Nagging Assignee: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.
tensorflowbutler commentedon Feb 8, 2018
Nagging Assignee: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.
lissyx commentedon Feb 12, 2018
@ebrevdo So, it looks like with current master, it's not an issue anymore ? At least I can again use
tfcompileebrevdo commentedon Feb 12, 2018
carlthome commentedon Feb 12, 2018
Nice! Looking forward to testing this again. 🎉
lissyx commentedon Feb 13, 2018
@ebrevdo Is it supposed to be fixed on r1.5 as well ?
ebrevdo commentedon Feb 13, 2018