`tf.vectorized_map` fallback cause
See original GitHub issueThis is the current list of fallback we have on master with the related cause for our KPLs ~(it needs tensorflow/tensorflow#55562 or tf-nightly when merged)~:
pytest -rP keras_cv/layers/preprocessing/ | grep while_loop | sort | uniq
WARNING tensorflow:pfor.py:1082 Using a while_loop for converting AdjustHue cause Input "delta" of op 'AdjustHue' expected to be loop invariant.
WARNING tensorflow:pfor.py:1082 Using a while_loop for converting AdjustSaturation cause Input "scale" of op 'AdjustSaturation' expected to be loop invariant.
WARNING tensorflow:pfor.py:1082 Using a while_loop for converting DepthwiseConv2dNative cause Input "filter" of op 'DepthwiseConv2dNative' expected to be not loop invariant.
WARNING tensorflow:pfor.py:1082 Using a while_loop for converting DynamicPartition cause there is no register converter for this op.
WARNING tensorflow:pfor.py:1082 Using a while_loop for converting DynamicStitch cause there is no register converter for this op.
WARNING tensorflow:pfor.py:1082 Using a while_loop for converting HistogramFixedWidth cause there is no register converter for this op.
WARNING tensorflow:pfor.py:1082 Using a while_loop for converting ImageProjectiveTransformV3 cause there is no register converter for this op.
WARNING tensorflow:pfor.py:1082 Using a while_loop for converting RandomShuffle cause there is no register converter for this op.
WARNING tensorflow:pfor.py:1082 Using a while_loop for converting StridedSlice cause Input "input" of op 'StridedSlice' expected to be not loop invariant.
You can find exactly which test is involed running:
pytest -rP keras_cv/layers/preprocessing/
Some of these could be fixed with a refactor in our code, others need a contribution (trivial or not) for a registered converter (e.g. See https://github.com/keras-team/keras-cv/issues/259#issuecomment-1094140155)
I think that we could care about this:
- monitor how many fallback we are accumulating directly in the CI, with a Github Action, so that we could check this at the PR stage
- contribute the (trivial?) converters that we care about in https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/parallel_for/pfor.py#L920-L997
- (extra) extend the same policy to
jit_compile
when we have our compile API ready
Issue Analytics
- State:
- Created a year ago
- Comments:28 (15 by maintainers)
Top Results From Across the Web
tf.vectorized_map | TensorFlow v2.11.0
Note that this fallback only happens for unsupported ops and other parts of fn are still vectorized. If false, on encountering an unsupported...
Read more >tf.vectorized_map - TensorFlow 2.3 - W3cubDocs
If true, on failing to vectorize an operation, the unsupported op is wrapped in a tf.while_loop to execute the map iterations. Note that...
Read more >tf.vectorized_map does not concat variable length tensors ...
I am running into a "InvalidArgumentError: PartialTensorShape: Incompatible shapes during merge" error when I try to tf.
Read more >Release 2.12.0 - Google Git
Fixes a CHECK failure in tf.reshape caused by overflows (CVE-2022-35934) ... To fall back to default settings, unset the environment variable.
Read more >TensorFlow v2.10.0 Release - GitClear
tf.lite : · tf.keras : · tf.distribute : · tf.math : · tf.train : · tf.vectorized_map : · XLA: MWMS is now compilable...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, we still lack a primary owner of
tf.vectorized_map
, but @ishark is the secondary owner of it now.Hello, my apologies, I missed github notifications. Will go through the issue history and get back to you. Thanks.