New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<release 2.4>-<rc2> cherry-pick request: [tf.data] Fix snapshot segfault when using repeat and prefetch. #49121
Conversation
PiperOrigin-RevId: 372390520 Change-Id: I1f0caa5bbda11862310a7c85e77f5df9e8fc3709
…fecth Similar to #49121 on `r2.4`. Needed manual cherrypick due to refactoring after `r2.5` branch cut
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
* Updates to account for the removal of $ROCM_PATH/include/hiprand,rocrand dirs The following dirs (which are soft-links really) will removed in a (near) future ROCm release. This commit updates `rocm_configure.bzl` to account for that change by explicitly copying over the header files (for `local_config_rocm` repo) from the following directories instead * $ROCM_PATH/hiprand/include * $ROCM_PATH/rocrand/include Unfortunately making the above change also breaks the build, if the directories that will be going away, are still present. This is because we end up with two `make_copy_dir_rule`s in `rocm_configure.bzl` that try to write to the same destination dirs ``` ERROR: Traceback (most recent call last): File "/root/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/external/local_config_rocm/rocm/BUILD", line 1588, column 8, in <toplevel> genrule( Error in genrule: generated file 'rocm/include/hiprand/hiprand.h' in rule 'hiprand-include' conflicts with existing generated file from rule 'rocm-include', defined at /root/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/external/local_config_rocm/rocm/BUILD:175:8 ``` In order to get around this error, this commit is also updating the `Dockerfile.rocm` to explicitly delete those two dirs from the `$ROCM_PATH/include` dir, immediately after installing ROCm * Updating rocm_configure.bzl to do the right thing based on whether or not the softlinks to <rocm_path>/include/[hiprand|rocrand] exist. Removing the workaroung to handle the same in Dockerfile.rocm, since that is no longer required (as a consequence of the change in rocm_configure.bzl * Merge pull request tensorflow#47491 from ROCmSoftwarePlatform:google_upstream_rocm_hiprand_rocrand_210301 PiperOrigin-RevId: 366329409 Change-Id: I3ac36219fab7735fc46e893f395263a2ed6335da * [CherryPick 2.5] 3.9 compatibility fix for AST unparsing * Disable pad_op_test for macos. Test times out during 2.5 release PiperOrigin-RevId: 370178263 Change-Id: I57989213810709d73d9e503b40b0f871e9006a05 * Fix 'Illegal ambiguous match' on Windows with `--config=nogcp/noaws`. * Revert "[Cherrypick:2.5]Switch absl to `lts_2021_03_24` LTS branch" * Fix the backward RNN layer with ragged inputs. PiperOrigin-RevId: 367698365 Change-Id: Ica5b4bae5a56f7e130110a29bb569ed4b1808a14 * [Cherry-pick:r2.5]Add -lrt to tf_cc_test linkopts on Linux platforms * disable irrelevant logging info for external users PiperOrigin-RevId: 369689465 Change-Id: Icfb10d47d88aecc9fcc4291628c0bed2e2b4f93e * Fix fetching of handle data in ResourceGather's gradient Adds some related tests for correct shape inference Fixes tensorflow#48430. PiperOrigin-RevId: 371793122 Change-Id: I61d8ff30eb46290188b32201d402a1fc173358e1 * Update version numbers to 2.5.0-rc3 * Run TensorFlow configure script in gpu_pip_on_cpu.sh Our other build scripts run pip_new.sh which runs configure at some point. I'm not sure which critical flags this introduces, but without it, bazel still builds a package for Python 2.7. PiperOrigin-RevId: 370521377 Change-Id: I36282f2487e4fb092bdd782fde7c8d8e0421a359 * Fix an invalid address vulnerability in `tf.raw_ops.RaggedBincount`. PiperOrigin-RevId: 368293153 Change-Id: I4b4e493d3fd05e7dc55a55de3a041a80a4f275c3 * Fix `tf.raw_ops.ResourceCountUpTo` null pointer dereference. PiperOrigin-RevId: 368294347 Change-Id: I2c16fbfc9b4966c402c3d8e311f0d665a9c852d8 * Validate `MatrixDiagV{2,3}` arguments to prevent breakage. PiperOrigin-RevId: 369056033 Change-Id: Ic2018c297d3dd6f252dc1dd3667f1ed5cb1eaa42 * Handle a special grappler case resulting in crash. It might happen that a malformed input could be used to trick Grappler into trying to optimize a node with no inputs. This, in turn, would produce a null pointer dereference and a segfault. PiperOrigin-RevId: 369242852 Change-Id: I2e5cbe7aec243d34a6d60220ac8ac9b16f136f6b * Fix `tf.raw_ops.RaggedTensorToVariant` invalid resize. PiperOrigin-RevId: 368299574 Change-Id: I751c186325aa0bab397928845e790e60c2d90918 * Fix 2 issues with `Conv3D`. We have an issue where the dimensions are not matching and this causes Eigen to crash on an assert. Then, we have an issue where we accidentally do a division by 0. PiperOrigin-RevId: 369242785 Change-Id: Ie94067b2d41f58699af99ebb5af335ad9defd931 * Fix `tf.raw_ops.GetSessionTensor` and `tf.raw_ops.DeleteSessionTensor` null pointer dereferences. PiperOrigin-RevId: 368294154 Change-Id: Ie10f07a0a9a1c2b685e08153d48a0ca4b93f9fc9 * Fix `tf.raw_ops.RaggedTensorToTensor` failing CHECK. PiperOrigin-RevId: 368706628 Change-Id: I5c9ea4833f38835ee183ca50d63251dc89c9f3bc * Fix `tf.raw_ops.RaggedTensorToTensor` failing CHECK in `tensor.cc`. PiperOrigin-RevId: 368300502 Change-Id: I91255d23c4bfd3aa3c029aac773937c09daf3c64 * Fix `tf.raw_ops.SparseCross` failing CHECK. PiperOrigin-RevId: 368701671 Change-Id: Id805729dd9ba0bda36e4bb309408129b55fb649d * Fix the segfault in `tf.raw_ops.SparseCountSparseOutput`. PiperOrigin-RevId: 369264941 Change-Id: I23a96a15b8370c01ee21ba3841e1c7dcbf55e93d * Validate some shape requirements for `Conv3DBackpropFilter*` and `Conv3DBackpropInput*` ops. Older versions of Eigen might otherwise crash / produce OOB read on specially crafted inputs. PiperOrigin-RevId: 369293977 Change-Id: I58f51445a93936d7cf8e616f75de17677df36718 * CherryPick2.5 error: could not apply 311403e... Eliminate a division by 0 in 3D convolutions * Fix overflow CHECK issue with `tf.raw_ops.AddManySparseToTensorsMap`. PiperOrigin-RevId: 369492969 Change-Id: I1d70d6c0c92e3d7a25bc3b3aa2a0c0ac9688bf81 * Prevent another division by zero. PiperOrigin-RevId: 369338598 Change-Id: I55471d363e401fdcf8d259670ad4eef672b731e2 * Prevent yet another division by zero PiperOrigin-RevId: 369343977 Change-Id: I1a60da4cf512e60fd91e069c16e026544632fe7f * Fix one more FPE. PiperOrigin-RevId: 369346568 Change-Id: I840fd575962adc879713a4c9cc59e6da3331caa7 * Fix one FPE and remove two CHECK-fails. PiperOrigin-RevId: 369349640 Change-Id: I1fedbfc2b5bab635c5cb51f103d7c9176f79831a * Fix one division by zero PiperOrigin-RevId: 369474832 Change-Id: I1082858ed78d9b2e4738ce30b231955973d49e1e * Remove `OP_REQUIRES` call from helper function. Since `OP_REQUIRES` macro expands to a `return;` (among other), calling it in a helper function only ends the helper function's execution earlier, but the kernel will still run from start to end. Thus, all the expected validations are actually broken/useless as the code ploughs through the next crash anyway. PiperOrigin-RevId: 369524386 Change-Id: I54f6cf9328445675ccc392e661b04336b229c9da * Fix heap buffer overflow caused by rounding. This was hard to fix. Due to the way we compute the pixels that influence an output pixel in resized images, for certain input configuration we might have issued a read to a pixel that is outside of boundary of the original image. This is because of floating errors that affected truncation results. PiperOrigin-RevId: 369757871 Change-Id: If89425fff930983829a2168203c11858883eebc9 * Fix null CHECK issue with `tf.raw_ops.EncodePng`. PiperOrigin-RevId: 369717714 Change-Id: I24136cd99c20b8466671f4f93b670ef6f6dd1250 * Fix out of bounds read in `ragged_cross_op.cc`. PiperOrigin-RevId: 369757702 Change-Id: Ie6e5d2c21513a8d56bf41fcf35960caf76e890f9 * Fix overflow CHECK issue with `tf.raw_ops.DrawBoundingBoxes`. PiperOrigin-RevId: 369753591 Change-Id: I3b45fc98ee0d28a3c20b7e9c995aa647c976ec40 * Validate inputs to `QuantizedMul` PiperOrigin-RevId: 369756982 Change-Id: I00d960cc3b9316fd7a86bd37a44e341c96e17624 * Fix overflow CHECK issue with `tf.raw_ops.AddManySparseToTensorsMap`. PiperOrigin-RevId: 369755048 Change-Id: Ia1663e49ef8387d84baa2c15dccf3506adffde84 * CherryPick:2.5 * Validate arguments to `QuantizedReshape`. Ensure that validations from `Reshape` also terminate `QuantizedReshape` on failure. PiperOrigin-RevId: 369775421 Change-Id: If8c5342267aceea65b7cb83a4b183304886f1ce8 * Fix issues in Conv2DBackpropFilter. PiperOrigin-RevId: 369772454 Change-Id: I49b465f2ae2ce91def61b56cea8000197d5177d8 * Enhance validation of ngram op and handle case of 0 tokens. PiperOrigin-RevId: 369940178 Change-Id: Ia82f42c09d14efe76e7dc013505b832a42282f0b * Fix `tf.raw_ops.QuantizeAndDequantizeV4Grad` CHECK failure. PiperOrigin-RevId: 370532425 Change-Id: I767721be266851b63d8fe55e7ac6be0af6017f6c * Fix `tf.raw_ops.CTCGreedyDecoder` CHECK failure. PiperOrigin-RevId: 369960465 Change-Id: If0b8b3264d5a47a24ac0970ed7b81ce6b4921fae * Fix crash in `SparseTensorToCSRSparseMatrixCPUFunctor` PiperOrigin-RevId: 370110290 Change-Id: I4451e92661a55c2180f80d38b67a9b50bf5edec5 * Prevent division by 0 in `QuantizedBiasAdd`. PiperOrigin-RevId: 370117454 Change-Id: I3804e2ac8dcc6d3afcc92e27853e2325a017ca4d * Add missing validation in `QuantizedBatchNormWithGlobalNormalization` PiperOrigin-RevId: 370123451 Change-Id: Id234d6dab1ec21230bb8e503dba30f899af87f33 * Validate work in `QuantizedAdd`, ensure at least one element. PiperOrigin-RevId: 370127996 Change-Id: I57c6f3e01afdeada84737820a131590137463855 * Fix divide by zero error in `fractional_pool_common.cc`. PiperOrigin-RevId: 371126221 Change-Id: Iea4b2f363aaeb116ab460e3bc592c687484af344 * Validate (and ensure validation sticks) inputs for `MatrixTriangularSolve`. PiperOrigin-RevId: 370282444 Change-Id: Iaed61a0b0727cc42c830658b72eb69f785f48dc5 * Fix `tf.raw_ops.SparseAdd ` invalid memory access failure. PiperOrigin-RevId: 370568774 Change-Id: I5f73b31c865f2948a1c8dfb7ebd22b3cfb6405bf * Fix `tf.raw_ops.QuantizeAndDequantizeV3` array index failure. PiperOrigin-RevId: 370577691 Change-Id: Ifeae64212f6bcd139435824fa2748d1329213c4c * Fix overflow CHECK issue with `tf.raw_ops.UnsortedSegmentJoin`. PiperOrigin-RevId: 370766155 Change-Id: I33e7c6626224e1060a8a4ab51ad5d861c6d4c63e * Fix FPE issue with `tf.raw_ops.FusedBatchNorm`. PiperOrigin-RevId: 370948185 Change-Id: If0c8e0320062ed6363e94ff5fe38e6a301f69ac2 * Fix FPE issue in external Eigen source code issue with `tf.raw_ops.SparseMatMul`. PiperOrigin-RevId: 370992919 Change-Id: Icfb276fef5fb40928b27c3e44608d2aca72c9fd7 * Fix OOB issue with `tf.raw_ops.SparseSparseMinimum`. PiperOrigin-RevId: 371005787 Change-Id: Ib686ccc077836e8b980b8b5a03936d36a8ecaf71 * Fix FPE issue with `tf.raw_ops.Reverse`. PiperOrigin-RevId: 371176973 Change-Id: Ic6d483bfc95313ec2299c2d1c956cfe96c96626c * Fix heap-buffer-overflow issue with `tf.raw_ops.SparseReshape`. PiperOrigin-RevId: 371218558 Change-Id: I6a6dc5bf15b50a1d05bdd95e9ba347cb39f40f45 * Fix heap-buffer-overflow issue with `tf.raw_ops.SparseSplit`. PiperOrigin-RevId: 371242872 Change-Id: I482bb3d12602c7c3cc9446f97fb9f584bb98e9a4 * Fix the CHECK failure in tf.raw_ops.QuantizeAndDequantizeV2. PiperOrigin-RevId: 371361603 Change-Id: Ia70e34d41adaadddf928e95e5e5c5c97d5bc60d0 * Fix heap buffer overflow in tf.raw_ops.UnicodeEncode. PiperOrigin-RevId: 371717714 Change-Id: If33443b28f158e58078f1268f6b92f2728d219e0 * Fix heap-buffer-overflow issue with `tf.raw_ops.RaggedTensorToTensor`. PiperOrigin-RevId: 371986929 Change-Id: I79ab962a22c5867f36f7f45b780a1ac881b1dbdd * Fix another Eigen missing validation PiperOrigin-RevId: 371833155 Change-Id: I5a23d451132cb1624ad916ef46ea01d0e88ec82c * Fix a check fail PiperOrigin-RevId: 372011072 Change-Id: I1062cfaed0aa16884e9a16312483794d188db76f * Fix a check fail in Fast Fourier implementation PiperOrigin-RevId: 372026629 Change-Id: Id05c3362aa575271bc3e06b16316c9037085fc11 * Prevent check fail in FFT PiperOrigin-RevId: 372031044 Change-Id: I50994e3e8a5d1342d01bde80256f6bf2730ca299 * Fix multiple issues in EditDistance PiperOrigin-RevId: 372033948 Change-Id: Ieb957c29894af05bdfeb1a0402fced808dfcfd7b * Add missing validations in dillation ops. PiperOrigin-RevId: 372037158 Change-Id: I4ee304c84a02550c030288a6534000b934fc1599 * Fix breakage in parameterized_truncated_normal_op.cc PiperOrigin-RevId: 372041718 Change-Id: Iff79e77a2bb27032423eefcb84211627b27dfe81 * Fix heap-buffer-overflow issue with `tf.raw_ops.SparseDenseCwiseMul`. PiperOrigin-RevId: 372054410 Change-Id: Ifcce0491e2e3816838c87e73be30a1e61b65174d * Fix out of bound read in requantization_range_op.cc PiperOrigin-RevId: 372129031 Change-Id: Ie684ab98a3840c5186ead3eafffc0e0ed0e8030d * Fix heap buffer overflow PiperOrigin-RevId: 372132844 Change-Id: Idef9895efaf145f2b1c23d31983601ec980cd5e4 * Fix memory corruption issue with `tf.raw_ops.DrawBoundingBoxesV2`. PiperOrigin-RevId: 372033910 Change-Id: I8a9f4efc1c8ddaacbc26ec1fbe4bfdd6791c226d * Add several missing validations in SDCA PiperOrigin-RevId: 372172877 Change-Id: Id366da962432e18dcbfac847d11e98488bebb70a * Add missing validations to reverse_sequence_op PiperOrigin-RevId: 372178683 Change-Id: Iac97ebab5b342f1262c77a7d9bcb4267b305ce5b * Don't do any work if output tensor is null (prevent div by 0) PiperOrigin-RevId: 372208700 Change-Id: Iea6b6293e887ade8538facfdb50fb931e17f511e * Add missing validation to pooling_ops_3d PiperOrigin-RevId: 372218727 Change-Id: I6b9ed4266aa7286c02f1f230d7bea922c1be547e * [CherryPick 2.5] Add missing validation to pooling_ops_3d and prevent heap OOB * Fix nullptr deref in `tf.raw_ops.CTCLoss`. PiperOrigin-RevId: 372266334 Change-Id: Ic52c3e9f13a38f54482d670907eda1688450862b * Fix OOB read issue with `tf.raw_ops.CTCLoss`. PiperOrigin-RevId: 372242187 Change-Id: I347228ed8c04e1d2eb9d2479ae52f51d1b512c6e * Fix assertion failure in pooling_ops_3d PiperOrigin-RevId: 372364504 Change-Id: Iecde4fe26b47a8fa935d6e2611b5585ed5777781 * Validate inputs of `FractionalAvgPoolGrad`. PiperOrigin-RevId: 372420640 Change-Id: Icc583928e6cdc3062e12498e4d2337a8fe3da016 * Validate arguments of `FractionalMaxPoolGrad` PiperOrigin-RevId: 372274982 Change-Id: If46b0c442efa4eaef635ce6a476717060420122c * Fix SEGV in CTC ops PiperOrigin-RevId: 372430279 Change-Id: I7ec2ad9d6f4d0980c33de45d27c6b17df5c6e26f * Prevent heap OOB error in `MaxPoolGrad` PiperOrigin-RevId: 372424854 Change-Id: Idac0f23867ad8b0601cafbaaa52d5e64269e63a7 * Fix heap OOB read in dequantize op. Also fixes SEGV in same op PiperOrigin-RevId: 372437896 Change-Id: I135e94d360c2a1ce374c10f7e0fed1af603dbc02 * Prevent overflow in sparse op PiperOrigin-RevId: 372442006 Change-Id: I60fe31cd7e56fb3501e97c63500caf902ddeee96 * Add missing valuidation to FusedBatchNorm. PiperOrigin-RevId: 372460336 Change-Id: Ic8c4e4de67c58a741bd87f2e182bed07247d1126 * Fix division by zero in TFLite padding. PiperOrigin-RevId: 370777494 Change-Id: Ic1331e4a1603b9e4c8aa183012a6c8237410aa0f * Prevent another div by 0 in optimized pooling implementations TFLite PiperOrigin-RevId: 370800091 Change-Id: I2119352f57fb5ca4f2051e0e2d749403304a979b * Prevent one more div by 0 in TFLite PiperOrigin-RevId: 370800114 Change-Id: I6b956aeb8c458cc6f514408d2e89ffacfe249e57 * Handle one more division by 0 in TFLite. PiperOrigin-RevId: 370800140 Change-Id: I9ab42e5aaccf02f226d1282611490a54cf7d273e * Fix another division by 0 in TFLite PiperOrigin-RevId: 370800181 Change-Id: I924809166a6131f5075e6d45c455106538d755f9 * Prevent a null pointer exception in TFLite PiperOrigin-RevId: 370800206 Change-Id: Idd437ebce4ff224120d8eefc1c14c062173b71d6 * Prevent a null pointer dereference in TFLite. PiperOrigin-RevId: 370800353 Change-Id: Ic9c9712ce5c6e384c954dcd640a5bd9ff05c9a05 * Prevent infinite loop/stack overflow in TFLite `while` op. PiperOrigin-RevId: 370800333 Change-Id: I6a2e4ff849da339545c449db2af7e11ce6ff02c3 * TFLite: Error out when the graph has a recurion. Recursion is currently unsupported. PiperOrigin-RevId: 371708957 Change-Id: I8dfad0d85cbfe08e39ae8ea7bad21254ddee5003 * [Cherrypick:2.5]Prevent division by 0 in TFLite * Prevent division by 0. PiperOrigin-RevId: 370962554 Change-Id: I0b9b62f4d8e1046dd88f9433f8dfeaf61a901680 * Prevent division by 0 PiperOrigin-RevId: 370966645 Change-Id: I831bfd96c7eb77b02d7ebb744335f59f6e5728cb * Prevent division by 0 PiperOrigin-RevId: 370979352 Change-Id: Ic79191c316d986fc6072ecaebfec9d5f2b924d00 * Prevent division by 0 PiperOrigin-RevId: 370984990 Change-Id: Ib324955bbeb1cbd97c82fd5d61a00a2697c9a2de * Prevent division by 0 PiperOrigin-RevId: 370995582 Change-Id: I670ffaf52d1ff8823ec31ea5f438f9125b402223 * Prevent division by 0 PiperOrigin-RevId: 370998952 Change-Id: I6b1d49079624ee1447d2d9b53a8976fb356cc8f5 * Prevent division by 0 in OneHot implementation If input indices is degenerate, the implementation would do a divide by zero. See https://github.com/tensorflow/tensorflow/blob/745d57df6d5e9bc568666a2a48ed8dd629c27241/tensorflow/lite/kernels/one_hot.cc#L68-L72 PiperOrigin-RevId: 370966870 Change-Id: Ie018337811c8016b5a1d3a277d00d5f2e19a2058 * Prevent divisions by 0 PiperOrigin-RevId: 371003153 Change-Id: Idef56c95b9fcaeb97f87e18c7a674dbeb5173204 * Prevent a division by 0 PiperOrigin-RevId: 371007407 Change-Id: Iecf2718de48d6bf5a69b02a9df9deda8ec1b19d3 * Fix integer overflow in TFLite concat PiperOrigin-RevId: 371013841 Change-Id: I6a4782ce7ca753e23ff31e7fb6aeb7f9d412cd29 * Fix a dangerous integer overflow and a malloc of negative size. PiperOrigin-RevId: 371254154 Change-Id: I250a98a3df26328770167025670235a963a72da0 * Prevent array write out-of-bounds. If user passes an invalid axis, then we copy one too many dimensions to the output in the loop below these checks. Even if we didn't do that, there will be further issues with an invalid axis, so we check for that right now. PiperOrigin-RevId: 371023299 Change-Id: I9eca37ffc2b29e8e48710f500701270ef0790224 * Prevent array OOB read/write PiperOrigin-RevId: 371026165 Change-Id: I26ac6372c87246e03c7eb8c94e84c84d86054b36 * Prevent memory overflow in ParseAttrValue from nested tensors. PiperOrigin-RevId: 370108442 Change-Id: I84d64a5e8895a6aeffbf4749841b4c54d51b5889 * Fix `tf.io.decode_raw` bugs and update documentation. Fixes cases where specifying `fixed_length` resulted in data loss and even segfault and corruption of the Python interpreter. The fix is subtle but needed due to pointer arithmetic rules. Makes sure that `fixed_length` does not change the output when present but not needed. Eliminates needless copy and cast in the main codepath. PiperOrigin-RevId: 371322725 Change-Id: I514ef67a2961c86422f69d05122d31615e87896c * Fix FPE issue with `tf.raw_ops.DenseCountSparseOutput`. PiperOrigin-RevId: 370946862 Change-Id: I3752584ad04aaecb327ff6793a9640ac56acfe7a * [CherryPick 2.5] Fix crash with tf.transpose when a is complex and conjugate is True * [CherryPick:2.5]Update jsoncpp to 1.9.4 * [CherryPick:2.5] Fix heap-buffer-overflow * Update tensorflow/workspace2.bzl * Update tensorflow/core/kernels/pooling_ops_3d.cc * Update version numbers to 2.5.0 * Fix heap OOB / undefined behavior in `RaggedTensorToTensor` PiperOrigin-RevId: 373244623 Change-Id: I2d6cbbc8c67b238a8815bf58097f7586d87c54f2 * Validate that a and b are proper sparse tensors PiperOrigin-RevId: 373248068 Change-Id: I0a2041a0747901b3f00387a6a3bce9bca6b0b3b1 * [tf.data][cherrypick] Fix snapshot segfault when using repeat and prefecth Similar to tensorflow#49121 on `r2.4`. Needed manual cherrypick due to refactoring after `r2.5` branch cut * Ensure validation sticks in banded_triangular_solve_op PiperOrigin-RevId: 373275480 Change-Id: Id7717cf275b2d6fdb9441fbbe166d555182d2e79 * Validate that a and b are proper sparse tensors PiperOrigin-RevId: 373274848 Change-Id: I3a665ac3a29dee9fb69bdf408a939330cb93ea75 * Update snapshot_dataset_op.cc * Patch build error due to old version of ruy dependency Co-authored-by: Mihai Maruseac <mihaimaruseac@google.com> Co-authored-by: Deven Desai <deven.desai.amd@gmail.com> Co-authored-by: TensorFlower Gardener <gardener@tensorflow.org> Co-authored-by: Dan Moldovan <mdan@google.com> Co-authored-by: Geeta Chavan <geetac@google.com> Co-authored-by: Adam Hillier <7688302+AdamHillier@users.noreply.github.com> Co-authored-by: Mihai Maruseac <mihai.maruseac@gmail.com> Co-authored-by: Scott Zhu <scottzhu@google.com> Co-authored-by: Allen Lavoie <allenl@google.com> Co-authored-by: TensorFlow Release Automation <jenkins@tensorflow.org> Co-authored-by: Austin Anderson <angerson@google.com> Co-authored-by: Amit Patankar <amitpatankar@google.com> Co-authored-by: Laura Pak <lpak@google.com> Co-authored-by: Yu-Cheng Ling <ycling@google.com>
[tf.data] Fix snapshot segfault when using repeat and prefetch.
Fixes: #48903.
input_->MakeIterator
refs the dataset intensorflow/tensorflow/core/framework/dataset.cc
Line 679 in a9cf3a0
So we don't need to call
input_->Ref()
. Otherwise, ifSnapshotDatasetV2Op::Dataset::Iterator::Reader::Initialize
returns an error,input_->Ref()
isn't called, but the destructor still callsinput_->Unref()
.If
InitializeIterator
returns an error, the iterator_ needs to be reset tonullptr. Otherwise, if GetNextInternal is called a second time,
iterator_->GetNext
may dereference a nullinput_impl_
.@ashahab