Skip to content

TF2.x, Sympy Bool Support? #3

@jthestness

Description

@jthestness

While updating to TF2.x, we see the following error in small tests:

$ python catamount/tests/full/tf_dynamic_rnn.py 
WARN: Cannot import tensorflow.contrib.mpi_collectives... not built?
WARN: Cannot import tensorswift... not installed?
2021-05-18 13:25:43.177494: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2021-05-18 13:25:43.177537: E tensorflow/stream_executor/cuda/cuda_driver.cc:313] failed call to cuInit: UNKNOWN ERROR (-1)
2021-05-18 13:25:43.177570: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (joel-dev): /proc/driver/nvidia/version does not exist
2021-05-18 13:25:43.177805: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA
2021-05-18 13:25:43.184914: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 2499995000 Hz
2021-05-18 13:25:43.185084: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7fe074000b60 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2021-05-18 13:25:43.185106: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
WARN: Unknown dtype <dtype: 'resource'> for tensor Tensor("rnn/TensorArray:0", shape=(2,), dtype=resource)
WARN: Unknown dtype <dtype: 'resource'> for tensor Tensor("rnn/TensorArray_1:0", shape=(2,), dtype=resource)
WARN: Unknown op type: TensorArrayScatterV3 (op: rnn/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3)
WARN: Unknown dtype <dtype: 'resource'> for tensor Tensor("rnn/while/TensorArrayReadV3/Enter:0", shape=(2,), dtype=resource)
WARN: Unknown op type: TensorArrayReadV3 (op: rnn/while/TensorArrayReadV3)
WARN: Unknown dtype <dtype: 'resource'> for tensor Tensor("rnn/while/TensorArrayWrite/TensorArrayWriteV3/Enter:0", shape=(2,), dtype=resource)
WARN: Unknown op type: TensorArrayWriteV3 (op: rnn/while/TensorArrayWrite/TensorArrayWriteV3)
WARN: Unknown op type: TensorArraySizeV3 (op: rnn/TensorArrayStack/TensorArraySizeV3)
WARN: Unknown op type: TensorArrayGatherV3 (op: rnn/TensorArrayStack/TensorArrayGatherV3)
WARN: Graph contains unknown ops. Assuming 0 Flops, 0 bytes accessed, 0 memory footprint for all unknown!
Loaded Flops test:
    Catamount:   rnn/while/LoopCond_block::iters*(24*rnn/while/basic_rnn_cell/BiasAdd:0::dim_0 + 2304*rnn/while/basic_rnn_cell/MatMul:0::dim_0 + 144*rnn/while/basic_rnn_cell/Tanh:0::dim_0 + 5)
    Correct: rnn/while/LoopCond_block::iters*(24*rnn/while/basic_rnn_cell/BiasAdd:0::dim_0 + 2304*rnn/while/basic_rnn_cell/MatMul:0::dim_0 + 144*rnn/while/basic_rnn_cell/Tanh:0::dim_0 + 5)
Traceback (most recent call last):
  File "catamount/tests/full/tf_dynamic_rnn.py", line 52, in <module>
    test_tf_dynamic_rnn()
  File "catamount/tests/full/tf_dynamic_rnn.py", line 35, in test_tf_dynamic_rnn
    graph.bindShapesAndPropagate(bind_dict)
  File "build/bdist.linux-x86_64/egg/catamount/graph/__init__.py", line 201, in bindShapesAndPropagate
  File "build/bdist.linux-x86_64/egg/catamount/graph/__init__.py", line 90, in propagateTensorShapeNames
  File "build/bdist.linux-x86_64/egg/catamount/ops/math_ops.py", line 224, in propagateShapes
  File "build/bdist.linux-x86_64/egg/catamount/tensors/tensor.py", line 227, in setValue
AssertionError: Tensor Tensor(name: rnn/while/Less:0, shape: (), value: None) setting value to seq_length > 0 with type <class 'sympy.core.relational.StrictGreaterThan'>

This appears to be because we're trying to propagate a Sympy boolean expression rather than a boolean value through the output of a logical op (LessOp). Seems like this should be a valid possibility, but not yet supported. Maybe add?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions