Release 2.8.0
Major Features and Improvements
-
tf.lite:- Added TFLite builtin op support for the following TF ops:
tf.raw_ops.Bucketizeop on CPU.tf.whereop for data typestf.int32/tf.uint32/tf.int8/tf.uint8/tf.int64.tf.random.normalop for output data typetf.float32on CPU.tf.random.uniformop for output data typetf.float32on CPU.tf.random.categoricalop for output data typetf.int64on CPU.
- Added TFLite builtin op support for the following TF ops:
-
tensorflow.experimental.tensorrt:conversion_paramsis now deprecated insideTrtGraphConverterV2in favor of direct arguments:max_workspace_size_bytes,precision_mode,minimum_segment_size,maximum_cached_engines,use_calibrationandallow_build_at_runtime.- Added a new parameter called
save_gpu_specific_enginesto the.save()function insideTrtGraphConverterV2. WhenFalse, the.save()function won't save any TRT engines that have been built. WhenTrue(default), the original behavior is preserved. TrtGraphConverterV2provides a new API called.summary()which outputs a summary of the inference converted by TF-TRT. It namely shows eachTRTEngineOpwith their input(s)' and output(s)' shape and dtype. A detailed version of the summary is available which prints additionally all the TensorFlow OPs included in each of theTRTEngineOps.
-
tf.tpu.experimental.embedding:tf.tpu.experimental.embedding.FeatureConfignow takes an additional argumentoutput_shapewhich can specify the shape of the output activation for the feature.tf.tpu.experimental.embedding.TPUEmbeddingnow has the same behavior astf.tpu.experimental.embedding.serving_embedding_lookupwhich can take arbitrary rank of dense and sparse tensor. For ragged tensor, though the input tensor remains to be rank 2, the activations now can be rank 2 or above by specifying the output shape in the feature config or via the build method.
-
Add
tf.config.experimental.enable_op_determinism, which makes TensorFlow ops run deterministically at the cost of performance. Replaces theTF_DETERMINISTIC_OPSenvironmental variable, which is now deprecated. The "Bug Fixes and Other Changes" section lists more determinism-related changes. -
(Since TF 2.7) Add PluggableDevice support to TensorFlow Profiler.
Bug Fixes and Other Changes
-
tf.data:- The optimization
parallel_batchnow becomes default if not disabled by users, which will parallelize copying of batch elements. - Added the ability for
TensorSliceDatasetto identify and handle inputs that are files. This enables creating hermetic SavedModels when using datasets created from files.- The optimization
parallel_batchnow becomes default if not disabled by users, which will parallelize copying of batch elements. - Added the ability for
TensorSliceDatasetto identify and handle inputs that are files. This enables creating hermetic SavedModels when using datasets created from files.
- The optimization
- The optimization
-
tf.lite:- Adds GPU Delegation support for serialization to Java API. This boosts initialization time up to 90% when OpenCL is available.
- Deprecated
Interpreter::SetNumThreads, in favor ofInterpreterBuilder::SetNumThreads.
-
tf.keras:- Adds
tf.compat.v1.keras.utils.get_or_create_layerto aid migration to TF2 by enabling tracking of nested keras models created in TF1-style, when used with thetf.compat.v1.keras.utils.track_tf1_style_variablesdecorator. - Added a
tf.keras.layers.experimental.preprocessing.HashedCrossinglayer which applies the hashing trick to the concatenation of crossed scalar inputs. This provides a stateless way to try adding feature crosses of integer or string data to a model. - Removed
keras.layers.experimental.preprocessing.CategoryCrossing. Users should migrate to theHashedCrossinglayer or usetf.sparse.cross/tf.ragged.crossdirectly. - Added additional
standardizeandsplitmodes toTextVectorization:standardize="lower"will lowercase inputs.standardize="string_punctuation"will remove all puncuation.split="character"will split on every unicode character.
- Added an
output_modeargument to theDiscretizationandHashinglayers with the same semantics as other preprocessing layers. All categorical preprocessing layers now supportoutput_mode. - All preprocessing layer output will follow the compute dtype of a
tf.keras.mixed_precision.Policy, unless constructed withoutput_mode="int"in which case output will betf.int64. The output type of any preprocessing layer can be controlled individually by passing adtypeargument to the layer. tf.random.Generatorfor keras initializers and all RNG code.- Added 3 new APIs for enable/disable/check the usage of
tf.random.Generatorin keras backend, which will be the new backend for all the RNG in Keras. We plan to switch on the new code path by default in tf 2.8, and the behavior change will likely to cause some breakage on user side (eg if the test is checking against some golden nubmer). These 3 APIs will allow user to disable and switch back to legacy behavior if they prefer. In future (eg TF 2.10), we expect to totally remove the legacy code path (stateful random Ops), and these 3 APIs will be removed as well. tf.keras.callbacks.experimental.BackupAndRestoreis now available astf.keras.callbacks.BackupAndRestore. The experimental endpoint is deprecated and will be removed in a future release.tf.keras.experimental.SidecarEvaluatoris now available astf.keras.utils.SidecarEvaluator. The experimental endpoint is deprecated and will be removed in a future release.- Metrics update and collection logic in default
Model.train_step()is now customizable via overridingModel.compute_metrics(). - Losses computation logic in default
Model.train_step()is now customizable via overridingModel.compute_loss(). jit_compileadded toModel.compile()on an opt-in basis to compile the model's training step with XLA. Note thatjit_compile=Truemay not necessarily work for all models.
- Adds
-
Deterministic Op Functionality:
- Fix regression in deterministic selection of deterministic cuDNN convolution algorithms, a regression that was introduced in v2.5. Note that nondeterministic out-of-memory events while selecting algorithms could still lead to nondeterminism, although this is very unlikely. This additional, unlikely source will be eliminated in a later version.
- Add determinsitic GPU implementations of:
tf.function(jit_compile=True)'s that useScatter.- (since v2.7) Stateful ops used in
tf.data.Dataset - (since v2.7)
tf.convert_to_tensorwhen fed with (sparse)tf.IndexedSlices(because it usestf.math.unsorted_segment_sum) - (since v2.7)
tf.gatherbackprop (becausetf.convert_to_tensorreducestf.gather's (sparse)tf.IndexedSlicesgradients into its denseparamsinput) - (since v2.7)
tf.math.segment_mean - (since v2.7)
tf.math.segment_prod - (since v2.7)
tf.math.segment_sum - (since v2.7)
tf.math.unsorted_segment_mean - (since v2.7)
tf.math.unsorted_segment_prod - (since v2.7)
tf.math.unsorted_segment_sum - (since v2.7)
tf.math.unsorted_segment_sqrt - (since v2.7)
tf.nn.ctc_loss(resolved, possibly in prior release, and confirmed with tests) - (since v2.7)
tf.nn.sparse_softmax_crossentropy_with_logits
- (since v2.7) Run
tf.scatter_ndand other related scatter functions, such astf.tensor_scatter_nd_update, on CPU (with significant performance penalty). - Add determinism-unimplemented exception-throwing to the following ops. When op-determinism is expected (i.e. after
tf.config.experimental.enable_op_determinismhas been called), an attempt to use the specified paths through the following ops on a GPU will causetf.errors.UnimplementedError(with an understandable message), unless otherwise specified, to be thrown.FakeQuantWithMinMaxVarsGradientandFakeQuantWithMinMaxVarsPerChannelGradient- (since v2.7)
tf.compat.v1.get_seedif the global random seed has not yet been set (viatf.random.set_seed). ThrowsRuntimeErrorfrom Python orInvalidArgumentfrom C++ - (since v2.7)
tf.compat.v1.nn.fused_batch_normbackprop tooffsetwhenis_training=False - (since v2.7)
tf.image.adjust_contrastforward - (since v2.7)
tf.image.resizewithmethod=ResizeMethod.NEARESTbackprop - (since v2.7)
tf.linalg.svd - (since v2.7)
tf.math.bincount - (since v2.7)
tf.nn.depthwise_conv2dbackprop tofilterwhen not using cuDNN convolution - (since v2.7)
tf.nn.dilation2dgradient - (since v2.7)
tf.nn.max_pool_with_argmaxgradient - (since v2.7)
tf.raw_ops.DebugNumericSummaryandtf.raw_ops.DebugNumericSummaryV2 - (since v2.7)
tf.timestamp. ThrowsFailedPrecondition - (since v2.7)
tf.Variable.scatter_add(and other scatter methods, both on ref and resource variables) - (since v2.7) The random-number-generating ops in the
tf.randommodule when the global random seed has not yet been set (viatf.random.set_seed). ThrowsRuntimeErrorfrom Python orInvalidArgumentfrom C++
-
TensorFlow-oneDNN no longer supports explicit use of oneDNN blocked tensor format, e.g., setting the environment variable
TF_ENABLE_MKL_NATIVE_FORMATwill not have any effect. -
TensorFlow has been validated on Windows Subsystem for Linux 2 (aka WSL 2) for both GPUs and CPUs.
-
Due to security issues (see section below), all boosted trees code has been deprecated. Users should switch to TensorFlow Decision Forests. TF's boosted trees code will be eliminated before the branch cut for TF 2.9 and will no longer be present since that release.
Thanks to our Contributors
This release contains contributions from many people at Google, as well as:
8bitmp3, Adam Lanicek, ag.ramesh, alesapin, Andrew Goodbody, annasuheyla, Ariel Elkin, Arnab Dutta, Ben Barsdell, bhack, cfRod, Chengji Yao, Christopher Bate, dan, Dan F-M, David Korczynski, DEKHTIARJonathan, dengzhiyuan, Deven Desai, Duncan Riach, Eli Osherovich, Ewout Ter Hoeven, ez2take, Faijul Amin, fo40225, Frederic Bastien, gadagashwini, Gauri1 Deshpande, Georgiy Manuilov, Guilherme De Lázari, Guozhong Zhuang, H1Gdev, homuler, Hongxu Jia, Jacky_Yin, jayfurmanek, jgehw, Jhalak Patel, Jinzhe Zeng, Johan Gunnarsson, Jonathan Dekhtiar, Kaixi Hou, Kanvi Khanna, Kevin Cheng, Koan-Sin Tan, Kruglov-Dmitry, Kun Lu, Lemo, Lequn Chen, long.chen, Louis Sugy, Mahmoud Abuzaina, Mao, Marius Brehler, Mark Harfouche, Martin Patz, Maxiwell S. Garcia, Meenakshi Venkataraman, Michael Melesse, Mrinal Tyagi, Måns Nilsson, Nathan John Sircombe, Nathan Luehr, Nilesh Agarwalla, Oktay Ozturk, Patrice Vignola, Pawel-Polyai, Rama Ketineni, Ramesh Sampath, Reza Rahimi, Rob Suderman, Robert Kalmar, Rohit Santhanam, Sachin Muradi, Saduf2019, Samuel Marks, Shi,Guangyong, Sidong-Wei, Srinivasan Narayanamoorthy, Srishti Srivastava, Steven I Reeves, stevenireeves, Supernovae, Tamas Bela Feher, Tao Xu, Thibaut Goetghebuer-Planchon, Thomas Schmeyer, tilakrayal, Valery Mironov, Victor Guo, Vignesh Kothapalli, Vishnuvardhan Janapati, wamuir, Wang,Quintin, William Muir, William Raveane, Yash Goel, Yimei Sun, Yong Tang, Yuduo Wu
Release 2.8.0
Major Features and Improvements
tf.lite:- Added TFLite builtin op support for the following TF ops:
tf.raw_ops.Bucketizeop on CPU.tf.whereop for data typestf.int32/tf.uint32/tf.int8/tf.uint8/tf.int64.tf.random.normalop for output data typetf.float32on CPU.tf.random.uniformop for output data typetf.float32on CPU.tf.random.categoricalop for output data typetf.int64on CPU.
- Added TFLite builtin op support for the following TF ops:
tensorflow.experimental.tensorrt:conversion_paramsis now deprecated insideTrtGraphConverterV2in favor of direct arguments:max_workspace_size_bytes,precision_mode,minimum_segment_size,maximum_cached_engines,use_calibrationandallow_build_at_runtime.- Added a new parameter called
save_gpu_specific_enginesto the.save()function insideTrtGraphConverterV2. WhenFalse, the.save()function won't save any TRT engines that have been built. WhenTrue(default), the original behavior is preserved. TrtGraphConverterV2provides a new API called.summary()which outputs a summary of the inference converted by TF-TRT. It namely shows each TRTEngineOp with their input(s)' and output(s)' shape and dtype. A detailed version of the summary is available which prints additionally all the TensorFlow OPs included in each of the TRTEngineOPs.
tf.tpu.experimental.embedding:tf.tpu.experimental.embedding.FeatureConfignow takes an additional argumentoutput_shapewhich can specify the shape of the output activation for the feature.tf.tpu.experimental.embedding.TPUEmbeddingnow has the same behavior astf.tpu.experimental.embedding.serving_embedding_lookupwhich can take arbitrary rank of dense and sparse tensor. For ragged tensor, though the input tensor remains to be rank 2, the activations now can be rank 2 or above by specifying the output shape in the feature config or via the build method.
- Add
tf.config.experimental.enable_op_determinism, which makes TensorFlow ops run deterministically at the cost of performance. Replaces theTF_DETERMINISTIC_OPSenvironmental variable, which is now deprecated.- The "Bug Fixes and Other Changes" section lists more determinism-related changes.
Bug Fixes and Other Changes
-
tf.data:- The optimization
parallel_batchnow becomes default if not disabled by users, which will parallelize copying of batch elements. - Added the ability for
TensorSliceDatasetto identify and handle inputs that are files. This enables creating hermetic SavedModels when using datasets created from files.
- The optimization
-
tf.lite:- GPU
- Adds GPU Delegation support for serialization to Java API. This boosts initialization time upto 90% when OpenCL is available.
- Deprecated
Interpreter::SetNumThreads, in favor ofInterpreterBuilder::SetNumThreads.
- GPU
-
Adds
tf.compat.v1.keras.utils.get_or_create_layerto aid migration to TF2 by enabling tracking of nested keras models created in TF1-style, when used with thetf.compat.v1.keras.utils.track_tf1_style_variablesdecorator. -
tf.keras:- Preprocessing Layers
- Added a
tf.keras.layers.experimental.preprocessing.HashedCrossinglayer which applies the hashing trick to the concatenation of crossed scalar inputs. This provides a stateless way to try adding feature crosses of integer or string data to a model. - Removed
keras.layers.experimental.preprocessing.CategoryCrossing. Users should migrate to theHashedCrossinglayer or usetf.sparse.cross/tf.ragged.crossdirectly. - Added additional
standardizeandsplitmodes toTextVectorization.standardize="lower"will lowercase inputs.standardize="string_punctuation"will remove all puncuation.split="character"will split on every unicode character.
- Added an
output_modeargument to theDiscretizationandHashinglayers with the same semantics as other preprocessing layers. All categorical preprocessing layers now supportoutput_mode. - All preprocessing layer output will follow the compute dtype of a
tf.keras.mixed_precision.Policy, unless constructed withoutput_mode="int"in which case output will betf.int64. The output type of any preprocessing layer can be controlled individually by passing adtypeargument to the layer.
- Added a
tf.random.Generatorfor keras initializers and all RNG code.- Added 3 new APIs for enable/disable/check the usage of
tf.random.Generatorin keras backend, which will be the new backend for all the RNG in Keras. We plan to switch on the new code path by default in TF 2.8, and the behavior change will likely to cause some breakage on user side (eg. if the test is checking against some golden number). These 3 APIs will allow user to disable and switch back to legacy behavior if they prefer. In future (eg tf 2.10), we expect to totally remove the legacy code path (stateful random Ops), and these 3 APIs will be removed as well.
- Added 3 new APIs for enable/disable/check the usage of
tf.keras.callbacks.experimental.BackupAndRestoreis now available astf.keras.callbacks.BackupAndRestore. The experimental endpoint is deprecated and will be removed in a future release.tf.keras.experimental.SidecarEvaluatoris now available astf.keras.utils.SidecarEvaluator. The experimental endpoint is deprecated and will be removed in a future release.- Metrics update and collection logic in default
Model.train_step()is now customizable via overridingModel.compute_metrics(). - Losses computation logic in default
Model.train_step()is now customizable via overridingModel.compute_loss(). jit_compileadded toModel.compile()on an opt-in basis to compile the model's training step with XLA. Note thatjit_compile=Truemay not necessarily work for all models.
- Preprocessing Layers
-
Deterministic Op Functionality
- Add determinsitic GPU implementations of:
tf.function(jit_compile=True)'s that useScatter.- (since v2.7) Stateful ops used in
tf.data.Dataset - (since v2.7)
tf.convert_to_tensorwhen fed with (sparse)tf.IndexedSlices(because it usestf.math.unsorted_segment_sum) - (since v2.7)
tf.gatherbackprop (becausetf.convert_to_tensorreducestf.gather's (sparse)tf.IndexedSlicesgradients into its denseparamsinput) - (since v2.7)
tf.math.segment_mean - (since v2.7)
tf.math.segment_prod - (since v2.7)
tf.math.segment_sum - (since v2.7)
tf.math.unsorted_segment_mean - (since v2.7)
tf.math.unsorted_segment_prod - (since v2.7)
tf.math.unsorted_segment_sum - (since v2.7)
tf.math.unsorted_segment_sqrt - (since v2.7)
tf.nn.ctc_loss(resolved, possibly in prior release, and confirmed with tests) - (since v2.7)
tf.nn.sparse_softmax_crossentropy_with_logits
- (since v2.7) Run the following ops on CPU (with significant performance penalty):
tf.scatter_ndand other related scatter functions, such astf.tensor_scatter_nd_update
- Add determinism-unimplemented exception-throwing to the following ops. When op-determinism is expected (i.e. after
tf.config.experimental.enable_op_determinismhas been called), an attempt to use the specified paths through the following ops on a GPU will causetf.errors.UnimplementedError(with an understandable message), unless otherwise specified, to be thrown.FakeQuantWithMinMaxVarsGradientandFakeQuantWithMinMaxVarsPerChannelGradient- (since v2.7)
tf.compat.v1.get_seedif the global random seed has not yet been set (viatf.random.set_seed). ThrowsRuntimeErrorfrom Python orInvalidArgumentfrom C++ - (since v2.7)
tf.compat.v1.nn.fused_batch_normbackprop tooffsetwhenis_training=False - (since v2.7)
tf.image.adjust_contrastforward - (since v2.7)
tf.image.resizewithmethod=ResizeMethod.NEARESTbackprop - (since v2.7)
tf.linalg.svd - (since v2.7)
tf.math.bincount - (since v2.7)
tf.nn.depthwise_conv2dbackprop tofilterwhen not using cuDNN convolution - (since v2.7)
tf.nn.dilation2dgradient - (since v2.7)
tf.nn.max_pool_with_argmaxgradient - (since v2.7)
tf.raw_ops.DebugNumericSummaryandtf.raw_ops.DebugNumericSummaryV2 - (since v2.7)
tf.timestamp. ThrowsFailedPrecondition - (since v2.7)
tf.Variable.scatter_add(and other scatter methods, both on ref and resource variables) - (since v2.7) The random-number-generating ops in the
tf.randommodule when the global random seed has not yet been set (viatf.random.set_seed). ThrowsRuntimeErrorfrom Python orInvalidArgumentfrom C++
- Add determinsitic GPU implementations of:
-
Add
tf.config.experimental.enable_op_determinism, which makes TensorFlow ops run deterministically at the cost of performance. This is equivalent to setting the previously-existingTF_DETERMINISTIC_OPSenvironmental variable to1. The environmental variable is now deprecated, so theenable_op_determinismfunction should be used instead.
Thanks to our Contributors
This release contains contributions from many people at Google, as well as:
8bitmp3, Adam Lanicek, ag.ramesh, alesapin, Andrew Goodbody, annasuheyla, Ariel Elkin, Arnab Dutta, Ben Barsdell, bhack, cfRod, Chengji Yao, Christopher Bate, dan, Dan F-M, David Korczynski, DEKHTIARJonathan, dengzhiyuan, Deven Desai, Duncan Riach, Eli Osherovich, Ewout Ter Hoeven, ez2take, Faijul Amin, fo40225, Frederic Bastien, gadagashwini, Gauri1 Deshpande, Georgiy Manuilov, Guilherme De Lázari, Guozhong Zhuang, H1Gdev, homuler, Hongxu Jia, Jacky_Yin, jayfurmanek, jgehw, Jhalak Patel, Jinzhe Zeng, Johan Gunnarsson, Jonathan Dekhtiar, Kaixi Hou, Kanvi Khanna, Kevin Cheng, Koan-Sin Tan, Kruglov-Dmitry, Kun Lu, Lemo, Lequn Chen, long.chen, Louis Sugy, Mahmoud Abuzaina, Mao, Marius Brehler, Mark Harfouche, Martin Patz, Maxiwell S. Garcia, Meenakshi Venkataraman, Michael Melesse, Mrinal Tyagi, Måns Nilsson, Nathan John Sircombe, Nathan Luehr, Nilesh Agarwalla, Oktay Ozturk, Patrice Vignola, Pawel-Polyai, Rama Ketineni, Ramesh Sampath, Reza Rahimi, Rob Suderman, Robert Kalmar, Rohit Santhanam, Sachin Muradi, Saduf2019, Samuel Marks, Shi,Guangyong, Sidong-Wei, Srinivasan Narayanamoorthy, Srishti Srivastava, Steven I Reeves, stevenireeves, Supernovae, Tamas Bela Feher, Tao Xu, Thibaut Goetghebuer-Planchon, Thomas Schmeyer, tilakrayal, Valery Mironov, Victor Guo, Vignesh Kothapalli, Vishnuvardhan Janapati, wamuir, Wang,Quintin, William Muir, William Raveane, Yash Goel, Yimei Sun, Yong Tang, Yuduo Wu
Release 2.6.2
This release just fixes an issue where keras, tensorflow_estimator and tensorboard were missing proper upper bounds and resulted in broken installs after Keras 2.7 release for all packages in TensorFlow ecosystem
Release 2.7.0
Breaking Changes
-
tf.keras:- The methods
Model.fit(),Model.predict(), andModel.evaluate()will no longer uprank input data of shape(batch_size,)to become(batch_size, 1). This enablesModelsubclasses to process scalar data in theirtrain_step()/test_step()/predict_step()methods.
Note that this change may break certain subclassed models. You can revert back to the previous behavior by adding upranking yourself in thetrain_step()/test_step()/predict_step()methods, e.g.if x.shape.rank == 1: x = tf.expand_dims(x, axis=-1). Functional models as well as Sequential models built with an explicit input shape are not affected. - The methods
Model.to_yaml()andkeras.models.model_from_yamlhave been replaced to raise aRuntimeErroras they can be abused to cause arbitrary code execution. It is recommended to use JSON serialization instead of YAML, or, a better alternative, serialize to H5. LinearModelandWideDeepModelare moved to thetf.compat.v1.keras.models.namespace (tf.compat.v1.keras.models.LinearModelandtf.compat.v1.keras.models.WideDeepModel), and theirexperimentalendpoints (tf.keras.experimental.models.LinearModelandtf.keras.experimental.models.WideDeepModel) are being deprecated.- RNG behavior change for all
tf.keras.initializersclasses. For any class constructed with a fixed seed, it will no longer generate same value when invoked multiple times. Instead, it will return different value, but a determinisitic sequence. This change will make the initialize behavior align between v1 and v2.
- The methods
-
tf.lite:- Rename fields
SignatureDeftable in schema to maximize the parity with TF SavedModel's Signature concept. - Deprecate Makefile builds. Makefile users need to migrate their builds to CMake or Bazel. Please refer to the Build TensorFlow Lite with CMake and Build TensorFlow Lite for ARM boards for the migration.
- Deprecate
tflite::OpResolver::GetDelegates. The list returned by TfLite'sBuiltinOpResolver::GetDelegatesis now always empty. Instead, recommend using new methodtflite::OpResolver::GetDelegateCreatorsin order to achieve lazy initialization on TfLite delegate instances.
- Rename fields
-
TF Core:
tf.Graph.get_name_scope()now always returns a string, as documented. Previously, when called withinname_scope("")orname_scope(None)contexts, it returnedNone; now it returns the empty string.tensorflow/core/ir/contains a new MLIR-based Graph dialect that is isomorphic to GraphDef and will be used to replace GraphDef-based (e.g., Grappler) optimizations.- Deprecated and removed
attrs()function in shape inference. All attributes should be queried by name now (rather than range returned) to enable changing the underlying storage there. - The following Python symbols were accidentally added in earlier versions of TensorFlow and now are removed. Each symbol has a replacement that should be used instead, but note the replacement's argument names are different.
tf.quantize_and_dequantize_v4(accidentally introduced in TensorFlow 2.4): Usetf.quantization.quantize_and_dequantize_v2instead.tf.batch_mat_mul_v3(accidentally introduced in TensorFlow 2.6): Usetf.linalg.matmulinstead.tf.sparse_segment_sum_grad(accidentally introduced in TensorFlow 2.6): Usetf.raw_ops.SparseSegmentSumGradinstead. Directly calling this op is typically not necessary, as it is automatically used when computing the gradient oftf.sparse.segment_sum.
- Renaming of tensorflow::int64 to int_64_t in numerous places (the former is an alias for the latter) which could result in needing to regenerate selective op registration headers else execution would fail with unregistered kernels error.
-
Modular File System Migration:
- Support for S3 and HDFS file systems has been migrated to a modular file systems based approach and is now available in https://github.com/tensorflow/io. The
tensorflow-iopython package should be installed for S3 and HDFS support with tensorflow.
- Support for S3 and HDFS file systems has been migrated to a modular file systems based approach and is now available in https://github.com/tensorflow/io. The
Major Features and Improvements
-
Improvements to the TensorFlow debugging experience:
-
Previously, TensorFlow error stack traces involved many internal frames, which could be challenging to read through, while not being actionable for end users. As of TF 2.7, TensorFlow filters internal frames in most errors that it raises, to keep stack traces short, readable, and focused on what's actionable for end users (their own code).
This behavior can be disabled by calling
tf.debugging.disable_traceback_filtering(), and can be re-enabled viatf.debugging.enable_traceback_filtering(). If you are debugging a TensorFlow-internal issue (e.g. to prepare a TensorFlow PR), make sure to disable traceback filtering. You can check whether this feature is currently enabled by callingtf.debugging.is_traceback_filtering_enabled().Note that this feature is only available with Python 3.7 or higher.
-
Improve the informativeness of error messages raised by Keras
Layer.__call__(), by adding the full list of argument values passed to the layer in every exception.
-
-
Introduce the
tf.compat.v1.keras.utils.track_tf1_style_variablesdecorator, which enables using large classes of tf1-style variable_scope,get_variable, andcompat.v1.layer-based components from within TF2 models running with TF2 behavior enabled. -
tf.data:-
tf.data service now supports auto-sharding. Users specify the sharding policy with
tf.data.experimental.service.ShardingPolicyenum. It can be one ofOFF(equivalent to today's"parallel_epochs"mode),DYNAMIC(equivalent to today's"distributed_epoch"mode), or one of the static sharding policies:FILE,DATA,FILE_OR_DATA, orHINT(corresponding to values oftf.data.experimental.AutoShardPolicy).Static sharding (auto-sharding) requires the number of tf.data service workers be fixed. Users need to specify the worker addresses in
tensorflow.data.experimental.DispatcherConfig. -
tf.data.experimental.service.register_datasetnow accepts optionalcompressionargument.
-
-
Keras:
tf.keras.layers.Convnow includes a publicconvolution_opmethod. This method can be used to simplify the implementation of Conv subclasses. There are two primary ways to use this new method. The first is to use the method directly in your owncallmethod:Alternatively, you can overrideclass StandardizedConv2D(tf.keras.layers.Conv2D): def call(self, inputs): mean, var = tf.nn.moments(self.kernel, axes=[0, 1, 2], keepdims=True) return self.convolution_op(inputs, (self.kernel - mean) / tf.sqrt(var + 1e-10))
convolution_op:class StandardizedConv2D(tf.keras.Layer): def convolution_op(self, inputs, kernel): mean, var = tf.nn.moments(kernel, axes=[0, 1, 2], keepdims=True) # Author code uses std + 1e-5 return super().convolution_op(inputs, (kernel - mean) / tf.sqrt(var + 1e-10))
- Added
merge_state()method totf.keras.metrics.Metricfor use in distributed computations. - Added
sparseandraggedoptions totf.keras.layers.TextVectorizationto allow forSparseTensorandRaggedTensoroutputs from the layer.
-
distribute.experimental.rpc package:
-
distribute.experimental.rpc package introduces APIs to create a GRPC based server to register tf.function methods and a GRPC client to invoke remote registered methods. RPC APIs are intended for multi-client setups i.e. server and clients are started in separate binaries independently.
-
Example usage to create server:
server = tf.distribute.experimental.rpc.Server.create("grpc", "127.0.0.1:1234") @tf.function(input_signature=[ tf.TensorSpec([], tf.int32), tf.TensorSpec([], dtypes.int32) ]) def _remote_multiply(a, b): return tf.math.multiply(a, b) server.register("multiply", _remote_multiply)
-
Example usage to create client:
client = tf.distribute.experimental.rpc.Client.create("grpc", address) a = tf.constant(2, dtype=tf.int32) b = tf.constant(3, dtype=tf.int32) result = client.multiply(a, b)
-
-
tf.lite:- Add experimental API
experimental_from_jaxto support conversion from Jax models to TensorFlow Lite. - Support uint32 data type for cast op.
- Add experimental quantization debugger
tf.lite.QuantizationDebugger
- Add experimental API
-
Extension Types
- Add experimental API to define new Python classes that can be handled by TensorFlow APIs. To create an extension type, simply define a Python class with
tf.experimental.ExtensionTypeas its base, and use type annotations to specify the type for each field. E.g.:Theclass MaskedTensor(tf.experimental.ExtensionType): values: tf.Tensor mask: tf.Tensor
tf.ExtensionTypebase class works similarly totyping.NamedTupleand@dataclasses.dataclassfrom the standard Python library. - Extension types are supported by Keras, tf.data, TF-hub, SavedModel, tf.function, control flow ops, py_function, and distribution strategy.
- Add "dispatch decorators" that can be used to override the default behavior of TensorFlow ops (such as
tf.addortf.concat) when they are applied to ExtensionType values. - The
BatchableExtensionTypeAPI can be used to define extension types that support APIs that make use of batching, such astf.data.Datasetandtf.map_fn. - For more information, see the Extension types guide.
- Add experimental API to define new Python classes that can be handled by TensorFlow APIs. To create an extension type, simply define a Python class with
Bug Fixes and Other Changes
- TF Core:
- Random number generation (RNG) system
- Add argument
algtotf.random.stateless_*functions to explicitly select the RNG algorithm. - Add
tf.nn.experimental.stateless_dropout, a stateless version oftf.nn.dropout. tf.random.Generatornow can be created inside the scope oftf.distribute.experimental.ParameterServerStrategyandtf.distribute.experimental.CentralStorageStrategy.
- Add argument
- Add an experimental session config
tf.experimental.disable_functional_ops_loweringwhich disables functional control flow op lowering optimization. This is useful when executing within a portable runtime where control flow op kernels may not be loaded due to selective registration. - Add a new experimental argument
experimental_is_anonymoustotf.lookup.StaticHashTable.__init__to create the table in anonymous mode. In this mode, the table resource can only be accessed via resource handles (not resource names) and will be deleted automatically when all resource handles pointing to it are gone.
- Random number generation (RNG) system
tf.data:- Introduce the
tf.data.experimental.atAPI which provides random access for input pipelines that consist of transformations that support random access. The initial set of transformations that support random access includes:tf.data.Dataset.from_tensor_slices,tf.data.Dataset.shuffle,tf.data.Dataset.batch,tf.data.Dataset.shard,tf.data.Dataset.map, andtf.data.Dataset.range. - Promote
tf.data.Options.experimental_deterministicAPI totf.data.Options.deterministicand deprecate the experimental endpoint. - Move autotuning options from
tf.data.Options.experimental_optimization.autotune*to a newly createdtf.data.Options.autotune.*and remove support fortf.data.Options.experimental_optimization.autotune_buffers. - Add support for user-defined names of tf.data core Python API, which can be used to disambiguate tf.data events in TF Profiler Trace Viewer.
- Promote
tf.data.experimental.sample_from_datasetsAPI totf.data.Dataset.sample_from_datasetsand deprecate the experimental endpoint. - Added
TF_GPU_ALLOCATOR=cuda_malloc_asyncthat use cudaMallocAsync from CUDA 11.2. This could become the default in the future.
- Introduce the
- TF SavedModel:
- Custom gradients are now saved by default. See
tf.saved_model.SaveOptionsto disable this. - The saved_model_cli's
--input_examplesinputs are now restricted to
python literals to avoid code injection.
- Custom gradients are now saved by default. See
- XLA:
- Add a new API that allows custom call functions to signal errors. The old API will be deprecated in a future release. See https://www.tensorflow.org/xla/custom_call for details.
- XLA:GPU reductions are deterministic by default (reductions within
jit_compile=Trueare now deterministic). - XLA:GPU works with Horovod (OSS contribution by Trent Lo from NVidia)
tf.saved_model.save:- When saving a model, not specifying a namespace whitelist for custom ops with a namespace will now default to allowing rather than rejecting them all.
- Deterministic Op Functionality (enabled by setting the environment variable
TF_DETERMINISTIC_OPSto"true"or"1"):- Add determinsitic GPU implementations of:
tf.math.segment_sumtf.math.segment_prodtf.math.segment_meantf.math.unsorted_segment_sumtf.math.unsorted_segment_prodtf.math.unsorted_segment_sqrttf.math.unsorted_segment_meantf.gatherbackproptf.convert_to_tensorwhen fed with (sparse)tf.IndexedSlicestf.nn.sparse_softmax_crossentropy_with_logitstf.nn.ctc_loss(resolved, possibly in prior release, and confirmed with tests)- stateful ops used in
tf.data.Dataset
- Run the following ops on CPU (with significant performance penalty):
tf.scatter_ndand other related scatter functions, such astf.tensor_scatter_nd_update
- Add determinism-unimplemented exception-throwing to the following ops. When op-determinism is expected (i.e. when the environment variable
TF_DETERMINISTIC_OPSis set to"true"or"1"), an attempt to use the specified paths through the following ops on a GPU will causetf.errors.UnimplementedError(with an understandable message), unless otherwise specified, to be thrown.tf.compat.v1.nn.fused_batch_normbackprop tooffsetwhenis_training=Falsetf.image.adjust_contrastforwardtf.nn.depthwise_conv2dbackprop tofilterwhen not using cuDNN convolutiontf.image.resizewithmethod=ResizeMethod.NEARESTbackproptf.math.bincount- TODO: confirm exception addedtf.raw_ops.DebugNumericSummaryandtf.raw_ops.DebugNumericSummaryV2tf.Variable.scatter_add(and other scatter methods, both on ref and resource variables)tf.linalg.svdtf.nn.dilation2dgradienttf.nn.max_pool_with_argmaxgradienttf.timestamp. ThrowsFailedPrecondition- The random-number-generating ops in the
tf.randommodule when the global random seed has not yet been set (viatf.random.set_seed). ThrowsRuntimeErrorfrom Python orInvalidArgumentfrom C++ tf.compat.v1.get_seedif the global random seed has not yet been set (viatf.random.set_seed). ThrowsRuntimeErrorfrom Python orInvalidArgumentfrom C++
- Add determinsitic GPU implementations of:
Security
- Fixes a code injection issue in
saved_model_cli(CVE-2021-41228) - Fixes a vulnerability due to use of uninitialized value in Tensorflow (CVE-2021-41225)
- Fixes a heap OOB in
FusedBatchNormkernels (CVE-2021-41223) - Fixes an arbitrary memory read in
ImmutableConst(CVE-2021-41227) - Fixes a heap OOB in
SparseBinCount(CVE-2021-41226) - Fixes a heap OOB in
SparseFillEmptyRows(CVE-2021-41224) - Fixes a segfault due to negative splits in
SplitV(CVE-2021-41222) - Fixes segfaults and vulnerabilities caused by accesses to invalid memory during shape inference in
Cudnn*ops (CVE-2021-41221) - Fixes a null pointer exception when
Exitnode is not preceded byEnterop (CVE-2021-41217) - Fixes an integer division by 0 in
tf.raw_ops.AllToAll(CVE-2021-41218) - Fixes a use after free and a memory leak in
CollectiveReduceV2(CVE-2021-41220) - Fixes an undefined behavior via
nullptrreference binding in sparse matrix multiplication (CVE-2021-41219) - Fixes a heap buffer overflow in
Transpose(CVE-2021-41216) - Prevents deadlocks arising from mutually recursive
tf.functionobjects (CVE-2021-41213) - Fixes a null pointer exception in
DeserializeSparse(CVE-2021-41215) - Fixes an undefined behavior arising from reference binding to
nullptrintf.ragged.cross(CVE-2021-41214) - Fixes a heap OOB read in
tf.ragged.cross(CVE-2021-41212) - Fixes a heap OOB in shape inference for
QuantizeV2(CVE-2021-41211) - Fixes a heap OOB read in all
tf.raw_ops.QuantizeAndDequantizeV*ops (CVE-2021-41205) - Fixes an FPE in
ParallelConcat(CVE-2021-41207) - Fixes FPE issues in convolutions with zero size filters (CVE-2021-41209)
- Fixes a heap OOB read in
tf.raw_ops.SparseCountSparseOutput(CVE-2021-41210) - Fixes vulnerabilities caused by incomplete validation in boosted trees code (CVE-2021-41208)
- Fixes vulnerabilities caused by incomplete validation of shapes in multiple TF ops (CVE-2021-41206)
- Fixes a segfault produced while copying constant resource tensor (CVE-2021-41204)
- Fixes a vulnerability caused by unitialized access in
EinsumHelper::ParseEquation(CVE-2021-41201) - Fixes several vulnerabilities and segfaults caused by missing validation during checkpoint loading (CVE-2021-41203)
- Fixes an overflow producing a crash in
tf.range(CVE-2021-41202) - Fixes an overflow producing a crash in
tf.image.resizewhen size is large (CVE-2021-41199) - Fixes an overflow producing a crash in
tf.tilewhen tiling tensor is large (CVE-2021-41198) - Fixes a vulnerability produced due to incomplete validation in
tf.summary.create_file_writer(CVE-2021-41200) - Fixes multiple crashes due to overflow and
CHECK-fail in ops with large tensor shapes (CVE-2021-41197) - Fixes a crash in
max_pool3dwhen size argument is 0 or negative (CVE-2021-41196) - Fixes a crash in
tf.math.segment_*operations (CVE-2021-41195) - Updates
curlto7.78.0to handle
CVE-2021-22922,
CVE-2021-22923,
CVE-2021-22924,
CVE-2021-22925,
and
CVE-2021-22926.
Thanks to our Contributors
This release contains contributions from many people at Google, as well as:
8bitmp3, Abhilash Majumder, abhilash1910, AdeshChoudhar, Adrian Garcia Badaracco, Adrian Ratiu, ag.ramesh, Aleksandr Nikolaev, Alexander Bosch, Alexander Grund, Annie Tallund, Anush Elangovan, Artem Sokolovskii, azazhu, Balint Cristian, Bas Aarts, Ben Barsdell, bhack, cfRod, Cheney-Wang, Cheng Ren, Christopher Bate, collin, Danila Bespalov, David Datascientist, Deven Desai, Duncan Riach, Ehsan Kia, Ellie, Fan Du, fo40225, Frederic Bastien, fsx950223, Gauri1 Deshpande, geetachavan1, Guillaume Klein, guozhong.zhuang, helen, Håkon Sandsmark, japm48, jgehw, Jinzhe Zeng, Jonathan Dekhtiar, Kai Zhu, Kaixi Hou, Kanvi Khanna, Koan-Sin Tan, Koki Ibukuro, Kulin Seth, KumaTea, Kun-Lu, Lemo, lipracer, liuyuanqiang, Mahmoud Abuzaina, Marius Brehler, Maxiwell S. Garcia, mdfaijul, metarutaiga, Michal Szutenberg, nammbash, Neil Girdhar, Nishidha Panpaliya, Nyadla-Sys, Patrice Vignola, Peter Kasting, Philipp Hack, PINTO0309, Prateek Gupta, puneeshkhanna, Rahul Butani, Rajeshwar Reddy T, Reza Rahimi, RinozaJiffry, rmothukuru, Rohit Santhanam, Saduf2019, Samuel Marks, sclarkson, Sergii Khomenko, Sheng, Yang, Sidong-Wei, slowy07, Srinivasan Narayanamoorthy, Srishti Srivastava, stanley, Stella Alice Schlotter, Steven I Reeves, stevenireeves, svobora, Takayoshi Koizumi, Tamas Bela Feher, Thibaut Goetghebuer-Planchon, Trent Lo, Twice, Varghese, Jojimon, Vishnuvardhan Janapati, Wang Yanzhang, Wang,Quintin, William Muir, William Raveane, Yasir Modak, Yasuhiro Matsumoto, Yi Li, Yong Tang, zhaozheng09, Zhoulong Jiang, zzpmiracle
Release 2.6.1
This release introduces several vulnerability fixes:
- Fixes a code injection issue in
saved_model_cli(CVE-2021-41228) - Fixes a vulnerability due to use of uninitialized value in Tensorflow (CVE-2021-41225)
- Fixes a heap OOB in
FusedBatchNormkernels (CVE-2021-41223) - Fixes an arbitrary memory read in
ImmutableConst(CVE-2021-41227) - Fixes a heap OOB in
SparseBinCount(CVE-2021-41226) - Fixes a heap OOB in
SparseFillEmptyRows(CVE-2021-41224) - Fixes a segfault due to negative splits in
SplitV(CVE-2021-41222) - Fixes segfaults and vulnerabilities caused by accesses to invalid memory during shape inference in
Cudnn*ops (CVE-2021-41221) - Fixes a null pointer exception when
Exitnode is not preceded byEnterop (CVE-2021-41217) - Fixes an integer division by 0 in
tf.raw_ops.AllToAll(CVE-2021-41218) - Fixes a use after free and a memory leak in
CollectiveReduceV2(CVE-2021-41220) - Fixes an undefined behavior via
nullptrreference binding in sparse matrix multiplication (CVE-2021-41219) - Fixes a heap buffer overflow in
Transpose(CVE-2021-41216) - Prevents deadlocks arising from mutually recursive
tf.functionobjects (CVE-2021-41213) - Fixes a null pointer exception in
DeserializeSparse(CVE-2021-41215) - Fixes an undefined behavior arising from reference binding to
nullptrintf.ragged.cross(CVE-2021-41214) - Fixes a heap OOB read in
tf.ragged.cross(CVE-2021-41212) - Fixes a heap OOB in shape inference for
QuantizeV2(CVE-2021-41211) - Fixes a heap OOB read in all
tf.raw_ops.QuantizeAndDequantizeV*ops (CVE-2021-41205) - Fixes an FPE in
ParallelConcat(CVE-2021-41207) - Fixes FPE issues in convolutions with zero size filters (CVE-2021-41209)
- Fixes a heap OOB read in
tf.raw_ops.SparseCountSparseOutput(CVE-2021-41210) - Fixes vulnerabilities caused by incomplete validation in boosted trees code (CVE-2021-41208)
- Fixes vulnerabilities caused by incomplete validation of shapes in multiple TF ops (CVE-2021-41206)
- Fixes a segfault produced while copying constant resource tensor (CVE-2021-41204)
- Fixes a vulnerability caused by unitialized access in
EinsumHelper::ParseEquation(CVE-2021-41201) - Fixes several vulnerabilities and segfaults caused by missing validation during checkpoint loading (CVE-2021-41203)
- Fixes an overflow producing a crash in
tf.range(CVE-2021-41202) - Fixes an overflow producing a crash in
tf.image.resizewhen size is large (CVE-2021-41199) - Fixes an overflow producing a crash in
tf.tilewhen tiling tensor is large (CVE-2021-41198) - Fixes a vulnerability produced due to incomplete validation in
tf.summary.create_file_writer(CVE-2021-41200) - Fixes multiple crashes due to overflow and
CHECK-fail in ops with large tensor shapes (CVE-2021-41197) - Fixes a crash in
max_pool3dwhen size argument is 0 or negative (CVE-2021-41196) - Fixes a crash in
tf.math.segment_*operations (CVE-2021-41195) - Updates
curlto7.78.0to handle CVE-2021-22922, CVE-2021-22923, CVE-2021-22924, CVE-2021-22925, and CVE-2021-22926.
Release 2.5.2
This release introduces several vulnerability fixes:
- Fixes a code injection issue in
saved_model_cli(CVE-2021-41228) - Fixes a vulnerability due to use of uninitialized value in Tensorflow (CVE-2021-41225)
- Fixes a heap OOB in
FusedBatchNormkernels (CVE-2021-41223) - Fixes an arbitrary memory read in
ImmutableConst(CVE-2021-41227) - Fixes a heap OOB in
SparseBinCount(CVE-2021-41226) - Fixes a heap OOB in
SparseFillEmptyRows(CVE-2021-41224) - Fixes a segfault due to negative splits in
SplitV(CVE-2021-41222) - Fixes segfaults and vulnerabilities caused by accesses to invalid memory during shape inference in
Cudnn*ops (CVE-2021-41221) - Fixes a null pointer exception when
Exitnode is not preceded byEnterop (CVE-2021-41217) - Fixes an integer division by 0 in
tf.raw_ops.AllToAll(CVE-2021-41218) - Fixes an undefined behavior via
nullptrreference binding in sparse matrix multiplication (CVE-2021-41219) - Fixes a heap buffer overflow in
Transpose(CVE-2021-41216) - Prevents deadlocks arising from mutually recursive
tf.functionobjects (CVE-2021-41213) - Fixes a null pointer exception in
DeserializeSparse(CVE-2021-41215) - Fixes an undefined behavior arising from reference binding to
nullptrintf.ragged.cross(CVE-2021-41214) - Fixes a heap OOB read in
tf.ragged.cross(CVE-2021-41212) - Fixes a heap OOB read in all
tf.raw_ops.QuantizeAndDequantizeV*ops (CVE-2021-41205) - Fixes an FPE in
ParallelConcat(CVE-2021-41207) - Fixes FPE issues in convolutions with zero size filters (CVE-2021-41209)
- Fixes a heap OOB read in
tf.raw_ops.SparseCountSparseOutput(CVE-2021-41210) - Fixes vulnerabilities caused by incomplete validation in boosted trees code (CVE-2021-41208)
- Fixes vulnerabilities caused by incomplete validation of shapes in multiple TF ops (CVE-2021-41206)
- Fixes a segfault produced while copying constant resource tensor (CVE-2021-41204)
- Fixes a vulnerability caused by unitialized access in
EinsumHelper::ParseEquation(CVE-2021-41201) - Fixes several vulnerabilities and segfaults caused by missing validation during checkpoint loading (CVE-2021-41203)
- Fixes an overflow producing a crash in
tf.range(CVE-2021-41202) - Fixes an overflow producing a crash in
tf.image.resizewhen size is large (CVE-2021-41199) - Fixes an overflow producing a crash in
tf.tilewhen tiling tensor is large (CVE-2021-41198) - Fixes a vulnerability produced due to incomplete validation in
tf.summary.create_file_writer(CVE-2021-41200) - Fixes multiple crashes due to overflow and
CHECK-fail in ops with large tensor shapes (CVE-2021-41197) - Fixes a crash in
max_pool3dwhen size argument is 0 or negative (CVE-2021-41196) - Fixes a crash in
tf.math.segment_*operations (CVE-2021-41195) - Updates
curlto7.78.0to handle CVE-2021-22922, CVE-2021-22923, CVE-2021-22924, CVE-2021-22925, and CVE-2021-22926.
Release 2.4.4
NOTE: This is the last release in the 2.4.x line
This release introduces several vulnerability fixes:
- Fixes a code injection issue in
saved_model_cli(CVE-2021-41228) - Fixes a vulnerability due to use of uninitialized value in Tensorflow (CVE-2021-41225)
- Fixes a heap OOB in
FusedBatchNormkernels (CVE-2021-41223) - Fixes an arbitrary memory read in
ImmutableConst(CVE-2021-41227) - Fixes a heap OOB in
SparseBinCount(CVE-2021-41226) - Fixes a heap OOB in
SparseFillEmptyRows(CVE-2021-41224) - Fixes a segfault due to negative splits in
SplitV(CVE-2021-41222) - Fixes segfaults and vulnerabilities caused by accesses to invalid memory during shape inference in
Cudnn*ops (CVE-2021-41221) - Fixes a null pointer exception when
Exitnode is not preceded byEnterop (CVE-2021-41217) - Fixes an integer division by 0 in
tf.raw_ops.AllToAll(CVE-2021-41218) - Fixes an undefined behavior via
nullptrreference binding in sparse matrix multiplication (CVE-2021-41219) - Fixes a heap buffer overflow in
Transpose(CVE-2021-41216) - Prevents deadlocks arising from mutually recursive
tf.functionobjects (CVE-2021-41213) - Fixes a null pointer exception in
DeserializeSparse(CVE-2021-41215) - Fixes an undefined behavior arising from reference binding to
nullptrintf.ragged.cross(CVE-2021-41214) - Fixes a heap OOB read in
tf.ragged.cross(CVE-2021-41212) - Fixes a heap OOB read in all
tf.raw_ops.QuantizeAndDequantizeV*ops (CVE-2021-41205) - Fixes an FPE in
ParallelConcat(CVE-2021-41207) - Fixes FPE issues in convolutions with zero size filters (CVE-2021-41209)
- Fixes a heap OOB read in
tf.raw_ops.SparseCountSparseOutput(CVE-2021-41210) - Fixes vulnerabilities caused by incomplete validation in boosted trees code (CVE-2021-41208)
- Fixes vulnerabilities caused by incomplete validation of shapes in multiple TF ops (CVE-2021-41206)
- Fixes a segfault produced while copying constant resource tensor (CVE-2021-41204)
- Fixes a vulnerability caused by unitialized access in
EinsumHelper::ParseEquation(CVE-2021-41201) - Fixes several vulnerabilities and segfaults caused by missing validation during checkpoint loading (CVE-2021-41203)
- Fixes an overflow producing a crash in
tf.range(CVE-2021-41202) - Fixes an overflow producing a crash in
tf.image.resizewhen size is large (CVE-2021-41199) - Fixes an overflow producing a crash in
tf.tilewhen tiling tensor is large (CVE-2021-41198) - Fixes a vulnerability produced due to incomplete validation in
tf.summary.create_file_writer(CVE-2021-41200) - Fixes multiple crashes due to overflow and
CHECK-fail in ops with large tensor shapes (CVE-2021-41197) - Fixes a crash in
max_pool3dwhen size argument is 0 or negative (CVE-2021-41196) - Fixes a crash in
tf.math.segment_*operations (CVE-2021-41195) - Updates
curlto7.78.0to handle CVE-2021-22922, CVE-2021-22923, CVE-2021-22924, CVE-2021-22925, and CVE-2021-22926.
Release 2.7.0
Breaking Changes
-
tf.keras:- The methods
Model.fit(),Model.predict(), andModel.evaluate()will no longer uprank input data of shape(batch_size,)to become(batch_size, 1). This enablesModelsubclasses to process scalar data in theirtrain_step()/test_step()/predict_step()methods.
Note that this change may break certain subclassed models. You can revert back to the previous behavior by adding upranking yourself in thetrain_step()/test_step()/predict_step()methods, e.g.if x.shape.rank == 1: x = tf.expand_dims(x, axis=-1). Functional models as well as Sequential models built with an explicit input shape are not affected. - The methods
Model.to_yaml()andkeras.models.model_from_yamlhave been replaced to raise aRuntimeErroras they can be abused to cause arbitrary code execution. It is recommended to use JSON serialization instead of YAML, or, a better alternative, serialize to H5. LinearModelandWideDeepModelare moved to thetf.compat.v1.keras.models.namespace (tf.compat.v1.keras.models.LinearModelandtf.compat.v1.keras.models.WideDeepModel), and theirexperimentalendpoints (tf.keras.experimental.models.LinearModelandtf.keras.experimental.models.WideDeepModel) are being deprecated.- RNG behavior change for all
tf.keras.initializersclasses. For any class constructed with a fixed seed, it will no longer generate same value when invoked multiple times. Instead, it will return different value, but a determinisitic sequence. This change will make the initialize behavior align between v1 and v2.
- The methods
-
tf.lite:- Rename fields
SignatureDeftable in schema to maximize the parity with TF SavedModel's Signature concept. - Deprecate Makefile builds. Makefile users need to migrate their builds to CMake or Bazel. Please refer to the Build TensorFlow Lite with CMake and Build TensorFlow Lite for ARM boards for the migration.
- Deprecate
tflite::OpResolver::GetDelegates. The list returned by TfLite'sBuiltinOpResolver::GetDelegatesis now always empty. Instead, recommend using new methodtflite::OpResolver::GetDelegateCreatorsin order to achieve lazy initialization on TfLite delegate instances.
- Rename fields
-
TF Core:
tf.Graph.get_name_scope()now always returns a string, as documented. Previously, when called withinname_scope("")orname_scope(None)contexts, it returnedNone; now it returns the empty string.tensorflow/core/ir/contains a new MLIR-based Graph dialect that is isomorphic to GraphDef and will be used to replace GraphDef-based (e.g., Grappler) optimizations.- Deprecated and removed
attrs()function in shape inference. All attributes should be queried by name now (rather than range returned) to enable changing the underlying storage there. - The following Python symbols were accidentally added in earlier versions of TensorFlow and now are removed. Each symbol has a replacement that should be used instead, but note the replacement's argument names are different.
tf.quantize_and_dequantize_v4(accidentally introduced in TensorFlow 2.4): Usetf.quantization.quantize_and_dequantize_v2instead.tf.batch_mat_mul_v3(accidentally introduced in TensorFlow 2.6): Usetf.linalg.matmulinstead.tf.sparse_segment_sum_grad(accidentally introduced in TensorFlow 2.6): Usetf.raw_ops.SparseSegmentSumGradinstead. Directly calling this op is typically not necessary, as it is automatically used when computing the gradient oftf.sparse.segment_sum.
- Renaming of tensorflow::int64 to int_64_t in numerous places (the former is an alias for the latter) which could result in needing to regenerate selective op registration headers else execution would fail with unregistered kernels error.
-
Modular File System Migration:
- Support for S3 and HDFS file systems has been migrated to a modular file systems based approach and is now available in https://github.com/tensorflow/io. The
tensorflow-iopython package should be installed for S3 and HDFS support with tensorflow.
- Support for S3 and HDFS file systems has been migrated to a modular file systems based approach and is now available in https://github.com/tensorflow/io. The
Major Features and Improvements
-
Improvements to the TensorFlow debugging experience:
-
Previously, TensorFlow error stack traces involved many internal frames, which could be challenging to read through, while not being actionable for end users. As of TF 2.7, TensorFlow filters internal frames in most errors that it raises, to keep stack traces short, readable, and focused on what's actionable for end users (their own code).
This behavior can be disabled by calling
tf.debugging.disable_traceback_filtering(), and can be re-enabled viatf.debugging.enable_traceback_filtering(). If you are debugging a TensorFlow-internal issue (e.g. to prepare a TensorFlow PR), make sure to disable traceback filtering. You can check whether this feature is currently enabled by callingtf.debugging.is_traceback_filtering_enabled().Note that this feature is only available with Python 3.7 or higher.
-
Improve the informativeness of error messages raised by Keras
Layer.__call__(), by adding the full list of argument values passed to the layer in every exception.
-
-
Introduce the
tf.compat.v1.keras.utils.track_tf1_style_variablesdecorator, which enables using large classes of tf1-style variable_scope,get_variable, andcompat.v1.layer-based components from within TF2 models running with TF2 behavior enabled. -
tf.data:-
tf.data service now supports auto-sharding. Users specify the sharding policy with
tf.data.experimental.service.ShardingPolicyenum. It can be one ofOFF(equivalent to today's"parallel_epochs"mode),DYNAMIC(equivalent to today's"distributed_epoch"mode), or one of the static sharding policies:FILE,DATA,FILE_OR_DATA, orHINT(corresponding to values oftf.data.experimental.AutoShardPolicy).Static sharding (auto-sharding) requires the number of tf.data service workers be fixed. Users need to specify the worker addresses in
tensorflow.data.experimental.DispatcherConfig. -
tf.data.experimental.service.register_datasetnow accepts optionalcompressionargument.
-
-
Keras:
tf.keras.layers.Convnow includes a publicconvolution_opmethod. This method can be used to simplify the implementation of Conv subclasses. There are two primary ways to use this new method. The first is to use the method directly in your owncallmethod:Alternatively, you can overrideclass StandardizedConv2D(tf.keras.layers.Conv2D): def call(self, inputs): mean, var = tf.nn.moments(self.kernel, axes=[0, 1, 2], keepdims=True) return self.convolution_op(inputs, (self.kernel - mean) / tf.sqrt(var + 1e-10))
convolution_op:class StandardizedConv2D(tf.keras.Layer): def convolution_op(self, inputs, kernel): mean, var = tf.nn.moments(kernel, axes=[0, 1, 2], keepdims=True) # Author code uses std + 1e-5 return super().convolution_op(inputs, (kernel - mean) / tf.sqrt(var + 1e-10))
- Added
merge_state()method totf.keras.metrics.Metricfor use in distributed computations. - Added
sparseandraggedoptions totf.keras.layers.TextVectorizationto allow forSparseTensorandRaggedTensoroutputs from the layer.
-
distribute.experimental.rpc package:
-
distribute.experimental.rpc package introduces APIs to create a GRPC based server to register tf.function methods and a GRPC client to invoke remote registered methods. RPC APIs are intended for multi-client setups i.e. server and clients are started in separate binaries independently.
-
Example usage to create server:
server = tf.distribute.experimental.rpc.Server.create("grpc", "127.0.0.1:1234") @tf.function(input_signature=[ tf.TensorSpec([], tf.int32), tf.TensorSpec([], dtypes.int32) ]) def _remote_multiply(a, b): return tf.math.multiply(a, b) server.register("multiply", _remote_multiply)
-
Example usage to create client:
client = tf.distribute.experimental.rpc.Client.create("grpc", address) a = tf.constant(2, dtype=tf.int32) b = tf.constant(3, dtype=tf.int32) result = client.multiply(a, b)
-
-
tf.lite:- Add experimental API
experimental_from_jaxto support conversion from Jax models to TensorFlow Lite. - Support uint32 data type for cast op.
- Add experimental quantization debugger
tf.lite.QuantizationDebugger
- Add experimental API
-
Extension Types
- Add experimental API to define new Python classes that can be handled by TensorFlow APIs. To create an extension type, simply define a Python class with
tf.experimental.ExtensionTypeas its base, and use type annotations to specify the type for each field. E.g.:Theclass MaskedTensor(tf.experimental.ExtensionType): values: tf.Tensor mask: tf.Tensor
tf.ExtensionTypebase class works similarly totyping.NamedTupleand@dataclasses.dataclassfrom the standard Python library. - Extension types are supported by Keras, tf.data, TF-hub, SavedModel, tf.function, control flow ops, py_function, and distribution strategy.
- Add "dispatch decorators" that can be used to override the default behavior of TensorFlow ops (such as
tf.addortf.concat) when they are applied to ExtensionType values. - The
BatchableExtensionTypeAPI can be used to define extension types that support APIs that make use of batching, such astf.data.Datasetandtf.map_fn.
- Add experimental API to define new Python classes that can be handled by TensorFlow APIs. To create an extension type, simply define a Python class with
Bug Fixes and Other Changes
- TF Core:
- Random number generation (RNG) system
- Add argument
algtotf.random.stateless_*functions to explicitly select the RNG algorithm. - Add
tf.nn.experimental.stateless_dropout, a stateless version oftf.nn.dropout. tf.random.Generatornow can be created inside the scope oftf.distribute.experimental.ParameterServerStrategyandtf.distribute.experimental.CentralStorageStrategy.
- Add argument
- Add an experimental session config
tf.experimental.disable_functional_ops_loweringwhich disables functional control flow op lowering optimization. This is useful when executing within a portable runtime where control flow op kernels may not be loaded due to selective registration. - Add a new experimental argument
experimental_is_anonymoustotf.lookup.StaticHashTable.__init__to create the table in anonymous mode. In this mode, the table resource can only be accessed via resource handles (not resource names) and will be deleted automatically when all resource handles pointing to it are gone.
- Random number generation (RNG) system
tf.data:- Introduce the
tf.data.experimental.atAPI which provides random access for input pipelines that consist of transformations that support random access. The initial set of transformations that support random access includes:tf.data.Dataset.from_tensor_slices,tf.data.Dataset.shuffle,tf.data.Dataset.batch,tf.data.Dataset.shard,tf.data.Dataset.map, andtf.data.Dataset.range. - Promote
tf.data.Options.experimental_deterministicAPI totf.data.Options.deterministicand deprecate the experimental endpoint. - Move autotuning options from
tf.data.Options.experimental_optimization.autotune*to a newly createdtf.data.Options.autotune.*and remove support fortf.data.Options.experimental_optimization.autotune_buffers. - Add support for user-defined names of tf.data core Python API, which can be used to disambiguate tf.data events in TF Profiler Trace Viewer.
- Promote
tf.data.experimental.sample_from_datasetsAPI totf.data.Dataset.sample_from_datasetsand deprecate the experimental endpoint.
- Introduce the
- TF SavedModel:
- Custom gradients are now saved by default. See
tf.saved_model.SaveOptions
to disable this.
- Custom gradients are now saved by default. See
- XLA:
- Add a new API that allows custom call functions to signal errors. The old API will be deprecated in a future release. See https://www.tensorflow.org/xla/custom_call for details.
- XLA:GPU reductions are deterministic by default (reductions within
jit_compile=Trueare now deterministic). - XLA:GPU works with Horovod (OSS contribution by Trent Lo from NVidia)
tf.saved_model.save:- When saving a model, not specifying a namespace whitelist for custom ops with a namespace will now default to allowing rather than rejecting them all.
Thanks to our Contributors
This release contains contributions from many people at Google, as well as:
8bitmp3, Abhilash Majumder, abhilash1910, AdeshChoudhar, Adrian Garcia Badaracco, Adrian Ratiu, ag.ramesh, Aleksandr Nikolaev, Alexander Bosch, Alexander Grund, Annie Tallund, Anush Elangovan, Artem Sokolovskii, azazhu, Balint Cristian, Bas Aarts, Ben Barsdell, bhack, cfRod, Cheney-Wang, Cheng Ren, Christopher Bate, collin, Danila Bespalov, David Datascientist, Deven Desai, Ehsan Kia, Ellie, Fan Du, fo40225, Frederic Bastien, fsx950223, Gauri1 Deshpande, geetachavan1, Guillaume Klein, guozhong.zhuang, helen, Håkon Sandsmark, japm48, jgehw, Jinzhe Zeng, Jonathan Dekhtiar, Kai Zhu, Kaixi Hou, Kanvi Khanna, Koan-Sin Tan, Koki Ibukuro, Kulin Seth, KumaTea, Kun-Lu, Lemo, lipracer, liuyuanqiang, Mahmoud Abuzaina, Marius Brehler, Maxiwell S. Garcia, mdfaijul, metarutaiga, Michal Szutenberg, nammbash, Neil Girdhar, Nishidha Panpaliya, Nyadla-Sys, Patrice Vignola, Peter Kasting, Philipp Hack, PINTO0309, Prateek Gupta, puneeshkhanna, Rahul Butani, Rajeshwar Reddy T, Reza Rahimi, RinozaJiffry, rmothukuru, Rohit Santhanam, Saduf2019, Samuel Marks, sclarkson, Sergii Khomenko, Sheng, Yang, Sidong-Wei, slowy07, Srinivasan Narayanamoorthy, Srishti Srivastava, stanley, Stella Alice Schlotter, Steven I Reeves, stevenireeves, svobora, Takayoshi Koizumi, Tamas Bela Feher, Thibaut Goetghebuer-Planchon, Trent Lo, Twice, Varghese, Jojimon, Vishnuvardhan Janapati, Wang Yanzhang, Wang,Quintin, William Muir, William Raveane, Yasir Modak, Yasuhiro Matsumoto, Yi Li, Yong Tang, zhaozheng09, Zhoulong Jiang, zzpmiracle
Release 2.7.0
Breaking Changes
-
tf.keras:- The methods
Model.fit(),Model.predict(), andModel.evaluate()will no longer uprank input data of shape(batch_size,)to become(batch_size, 1). This enablesModelsubclasses to process scalar data in theirtrain_step()/test_step()/predict_step()methods.
Note that this change may break certain subclassed models. You can revert back to the previous behavior by adding upranking yourself in thetrain_step()/test_step()/predict_step()methods, e.g.if x.shape.rank == 1: x = tf.expand_dims(x, axis=-1). Functional models as well as Sequential models built with an explicit input shape are not affected. - The methods
Model.to_yaml()andkeras.models.model_from_yamlhave been replaced to raise aRuntimeErroras they can be abused to cause arbitrary code execution. It is recommended to use JSON serialization instead of YAML, or, a better alternative, serialize to H5. LinearModelandWideDeepModelare moved to thetf.compat.v1.keras.models.namespace (tf.compat.v1.keras.models.LinearModelandtf.compat.v1.keras.models.WideDeepModel), and theirexperimentalendpoints (tf.keras.experimental.models.LinearModelandtf.keras.experimental.models.WideDeepModel) are being deprecated.- RNG behavior change for all
tf.keras.initializersclasses. For any class constructed with a fixed seed, it will no longer generate same value when invoked multiple times. Instead, it will return different value, but a determinisitic sequence. This change will make the initialize behavior align between v1 and v2.
- The methods
-
tf.lite:- Rename fields
SignatureDeftable in schema to maximize the parity with TF SavedModel's Signature concept. - Deprecate Makefile builds. Makefile users need to migrate their builds to CMake or Bazel. Please refer to the Build TensorFlow Lite with CMake and Build TensorFlow Lite for ARM boards for the migration.
- Deprecate
tflite::OpResolver::GetDelegates. The list returned by TfLite'sBuiltinOpResolver::GetDelegatesis now always empty. Instead, recommend using new methodtflite::OpResolver::GetDelegateCreatorsin order to achieve lazy initialization on TfLite delegate instances.
- Rename fields
-
TF Core:
tf.Graph.get_name_scope()now always returns a string, as documented. Previously, when called withinname_scope("")orname_scope(None)contexts, it returnedNone; now it returns the empty string.tensorflow/core/ir/contains a new MLIR-based Graph dialect that is isomorphic to GraphDef and will be used to replace GraphDef-based (e.g., Grappler) optimizations.- Deprecated and removed
attrs()function in shape inference. All attributes should be queried by name now (rather than range returned) to enable changing the underlying storage there. - The following Python symbols were accidentally added in earlier versions of TensorFlow and now are removed. Each symbol has a replacement that should be used instead, but note the replacement's argument names are different.
tf.quantize_and_dequantize_v4(accidentally introduced in TensorFlow 2.4): Usetf.quantization.quantize_and_dequantize_v2instead.tf.batch_mat_mul_v3(accidentally introduced in TensorFlow 2.6): Usetf.linalg.matmulinstead.tf.sparse_segment_sum_grad(accidentally introduced in TensorFlow 2.6): Usetf.raw_ops.SparseSegmentSumGradinstead. Directly calling this op is typically not necessary, as it is automatically used when computing the gradient oftf.sparse.segment_sum.
- Renaming of tensorflow::int64 to int_64_t in numerous places (the former is an alias for the latter) which could result in needing to regenerate selective op registration headers else execution would fail with unregistered kernels error.
Major Features and Improvements
-
Improvements to the TensorFlow debugging experience:
-
Previously, TensorFlow error stack traces involved many internal frames, which could be challenging to read through, while not being actionable for end users. As of TF 2.7, TensorFlow filters internal frames in most errors that it raises, to keep stack traces short, readable, and focused on what's actionable for end users (their own code).
This behavior can be disabled by calling
tf.debugging.disable_traceback_filtering(), and can be re-enabled viatf.debugging.enable_traceback_filtering(). If you are debugging a TensorFlow-internal issue (e.g. to prepare a TensorFlow PR), make sure to disable traceback filtering. You can check whether this feature is currently enabled by callingtf.debugging.is_traceback_filtering_enabled().Note that this feature is only available with Python 3.7 or higher.
-
Improve the informativeness of error messages raised by Keras
Layer.__call__(), by adding the full list of argument values passed to the layer in every exception.
-
-
Introduce the
tf.compat.v1.keras.utils.track_tf1_style_variablesdecorator, which enables using large classes of tf1-style variable_scope,get_variable, andcompat.v1.layer-based components from within TF2 models running with TF2 behavior enabled. -
tf.data:-
tf.data service now supports auto-sharding. Users specify the sharding policy with
tf.data.experimental.service.ShardingPolicyenum. It can be one ofOFF(equivalent to today's"parallel_epochs"mode),DYNAMIC(equivalent to today's"distributed_epoch"mode), or one of the static sharding policies:FILE,DATA,FILE_OR_DATA, orHINT(corresponding to values oftf.data.experimental.AutoShardPolicy).Static sharding (auto-sharding) requires the number of tf.data service workers be fixed. Users need to specify the worker addresses in
tensorflow.data.experimental.DispatcherConfig. -
tf.data.experimental.service.register_datasetnow accepts optionalcompressionargument.
-
-
Keras:
-
tf.keras.layers.Convnow includes a publicconvolution_opmethod. This method can be used to simplify the implementation of Conv subclasses. There are two primary ways to use this new method. The first is to use the method directly in your owncallmethod:class StandardizedConv2D(tf.keras.layers.Conv2D): def call(self, inputs): mean, var = tf.nn.moments(self.kernel, axes=[0, 1, 2], keepdims=True) return self.convolution_op(inputs, (self.kernel - mean) / tf.sqrt(var + 1e-10))
Alternatively, you can override
convolution_op:class StandardizedConv2D(tf.keras.Layer): def convolution_op(self, inputs, kernel): mean, var = tf.nn.moments(kernel, axes=[0, 1, 2], keepdims=True) # Author code uses std + 1e-5 return super().convolution_op(inputs, (kernel - mean) / tf.sqrt(var + 1e-10))
-
Added
merge_state()method totf.keras.metrics.Metricfor use in distributed computations. -
Added
sparseandraggedoptions totf.keras.layers.TextVectorizationto allow forSparseTensorandRaggedTensoroutputs from the layer. -
distribute.experimental.rpc package:
-
distribute.experimental.rpc package introduces APIs to create a GRPC based server to register tf.function methods and a GRPC client to invoke remote registered methods. RPC APIs are intended for multi-client setups i.e. server and clients are started in separate binaries independently.
-
Example usage to create server:
server = tf.distribute.experimental.rpc.Server.create("grpc", "127.0.0.1:1234") @tf.function(input_signature=[ tf.TensorSpec([], tf.int32), tf.TensorSpec([], dtypes.int32) ]) def _remote_multiply(a, b): return tf.math.multiply(a, b) server.register("multiply", _remote_multiply)
-
Example usage to create client:
client = tf.distribute.experimental.rpc.Client.create("grpc", address) a = tf.constant(2, dtype=tf.int32) b = tf.constant(3, dtype=tf.int32) result = client.multiply(a, b)
-
-
tf.lite:- Add experimental API
experimental_from_jaxto support conversion from Jax models to TensorFlow Lite. - Support uint32 data type for cast op.
- Add experimental quantization debugger
tf.lite.QuantizationDebugger
- Add experimental API
-
Extension Types
- Add experimental API to define new Python classes that can be handled by TensorFlow APIs. To create an extension type, simply define a Python class with
tf.experimental.ExtensionTypeas its base, and use type annotations to specify the type for each field. E.g.:Theclass MaskedTensor(tf.experimental.ExtensionType): values: tf.Tensor mask: tf.Tensor
tf.ExtensionTypebase class works similarly totyping.NamedTupleand@dataclasses.dataclassfrom the standard Python library. - Extension types are supported by Keras, tf.data, TF-hub, SavedModel, tf.function, control flow ops, py_function, and distribution strategy.
- Add "dispatch decorators" that can be used to override the default behavior of TensorFlow ops (such as
tf.addortf.concat) when they are applied to ExtensionType values. - The
BatchableExtensionTypeAPI can be used to define extension types that support APIs that make use of batching, such astf.data.Datasetandtf.map_fn.
- Add experimental API to define new Python classes that can be handled by TensorFlow APIs. To create an extension type, simply define a Python class with
Bug Fixes and Other Changes
- TF Core:
- Random number generation (RNG) system
- Add argument
algtotf.random.stateless_*functions to explicitly select the RNG algorithm. - Add
tf.nn.experimental.stateless_dropout, a stateless version oftf.nn.dropout. tf.random.Generatornow can be created inside the scope oftf.distribute.experimental.ParameterServerStrategyandtf.distribute.experimental.CentralStorageStrategy.
- Add argument
- Add an experimental session config
tf.experimental.disable_functional_ops_loweringwhich disables functional control flow op lowering optimization. This is useful when executing within a portable runtime where control flow op kernels may not be loaded due to selective registration. - Add a new experimental argument
experimental_is_anonymoustotf.lookup.StaticHashTable.__init__to create the table in anonymous mode. In this mode, the table resource can only be accessed via resource handles (not resource names) and will be deleted automatically when all resource handles pointing to it are gone.
- Random number generation (RNG) system
tf.data:- Introduce the
tf.data.experimental.atAPI which provides random access for input pipelines that consist of transformations that support random access. The initial set of transformations that support random access includes:tf.data.Dataset.from_tensor_slices,tf.data.Dataset.shuffle,tf.data.Dataset.batch,tf.data.Dataset.shard,tf.data.Dataset.map, andtf.data.Dataset.range. - Promote
tf.data.Options.experimental_deterministicAPI totf.data.Options.deterministicand deprecate the experimental endpoint. - Move autotuning options from
tf.data.Options.experimental_optimization.autotune*to a newly createdtf.data.Options.autotune.*and remove support fortf.data.Options.experimental_optimization.autotune_buffers. - Add support for user-defined names of tf.data core Python API, which can be used to disambiguate tf.data events in TF Profiler Trace Viewer.
- Promote
tf.data.experimental.sample_from_datasetsAPI totf.data.Dataset.sample_from_datasetsand deprecate the experimental endpoint.
- Introduce the
- TF SavedModel:
- Custom gradients are now saved by default. See
tf.saved_model.SaveOptions
to disable this.
- Custom gradients are now saved by default. See
- XLA:
- Add a new API that allows custom call functions to signal errors. The old API will be deprecated in a future release. See https://www.tensorflow.org/xla/custom_call for details.
- XLA:GPU reductions are deterministic by default (reductions within
jit_compile=Trueare now deterministic). - XLA:GPU works with Horovod (OSS contribution by Trent Lo from NVidia)
tf.saved_model.save:- When saving a model, not specifying a namespace whitelist for custom ops with a namespace will now default to allowing rather than rejecting them all.
Thanks to our Contributors
This release contains contributions from many people at Google, as well as:
8bitmp3, Abhilash Majumder, abhilash1910, AdeshChoudhar, Adrian Garcia Badaracco, Adrian Ratiu, ag.ramesh, Aleksandr Nikolaev, Alexander Bosch, Alexander Grund, Annie Tallund, Anush Elangovan, Artem Sokolovskii, azazhu, Balint Cristian, Bas Aarts, Ben Barsdell, bhack, cfRod, Cheney-Wang, Cheng Ren, Christopher Bate, collin, Danila Bespalov, David Datascientist, Deven Desai, Ehsan Kia, Ellie, Fan Du, fo40225, Frederic Bastien, fsx950223, Gauri1 Deshpande, geetachavan1, Guillaume Klein, guozhong.zhuang, helen, Håkon Sandsmark, japm48, jgehw, Jinzhe Zeng, Jonathan Dekhtiar, Kai Zhu, Kaixi Hou, Kanvi Khanna, Koan-Sin Tan, Koki Ibukuro, Kulin Seth, KumaTea, Kun-Lu, Lemo, lipracer, liuyuanqiang, Mahmoud Abuzaina, Marius Brehler, Maxiwell S. Garcia, mdfaijul, metarutaiga, Michal Szutenberg, nammbash, Neil Girdhar, Nishidha Panpaliya, Nyadla-Sys, Patrice Vignola, Peter Kasting, Philipp Hack, PINTO0309, Prateek Gupta, puneeshkhanna, Rahul Butani, Rajeshwar Reddy T, Reza Rahimi, RinozaJiffry, rmothukuru, Rohit Santhanam, Saduf2019, Samuel Marks, sclarkson, Sergii Khomenko, Sheng, Yang, Sidong-Wei, slowy07, Srinivasan Narayanamoorthy, Srishti Srivastava, stanley, Stella Alice Schlotter, Steven I Reeves, stevenireeves, svobora, Takayoshi Koizumi, Tamas Bela Feher, Thibaut Goetghebuer-Planchon, Trent Lo, Twice, Varghese, Jojimon, Vishnuvardhan Janapati, Wang Yanzhang, Wang,Quintin, William Muir, William Raveane, Yasuhiro Matsumoto, Yi Li, Yong Tang, zhaozheng09, Zhoulong Jiang, zzpmiracle
Release 2.4.3
This release introduces several vulnerability fixes:
- Fixes a heap out of bounds access in sparse reduction operations (CVE-2021-37635)
- Fixes a floating point exception in
SparseDenseCwiseDiv(CVE-2021-37636) - Fixes a null pointer dereference in
CompressElement(CVE-2021-37637) - Fixes a null pointer dereference in
RaggedTensorToTensor(CVE-2021-37638) - Fixes a null pointer dereference and a heap OOB read arising from operations restoring tensors (CVE-2021-37639)
- Fixes an integer division by 0 in sparse reshaping (CVE-2021-37640)
- Fixes a division by 0 in
ResourceScatterDiv(CVE-2021-37642) - Fixes a heap OOB in
RaggedGather(CVE-2021-37641) - Fixes a
std::abortraised fromTensorListReserve(CVE-2021-37644) - Fixes a null pointer dereference in
MatrixDiagPartOp(CVE-2021-37643) - Fixes an integer overflow due to conversion to unsigned (CVE-2021-37645)
- Fixes a bad allocation error in
StringNGramscaused by integer conversion (CVE-2021-37646) - Fixes a null pointer dereference in
SparseTensorSliceDataset(CVE-2021-37647) - Fixes an incorrect validation of
SaveV2inputs (CVE-2021-37648) - Fixes a null pointer dereference in
UncompressElement(CVE-2021-37649) - Fixes a segfault and a heap buffer overflow in
{Experimental,}DatasetToTFRecord(CVE-2021-37650) - Fixes a heap buffer overflow in
FractionalAvgPoolGrad(CVE-2021-37651) - Fixes a use after free in boosted trees creation (CVE-2021-37652)
- Fixes a division by 0 in
ResourceGather(CVE-2021-37653) - Fixes a heap OOB and a
CHECKfail inResourceGather(CVE-2021-37654) - Fixes a heap OOB in
ResourceScatterUpdate(CVE-2021-37655) - Fixes an undefined behavior arising from reference binding to nullptr in
RaggedTensorToSparse(CVE-2021-37656) - Fixes an undefined behavior arising from reference binding to nullptr in
MatrixDiagV*ops (CVE-2021-37657) - Fixes an undefined behavior arising from reference binding to nullptr in
MatrixSetDiagV*ops (CVE-2021-37658) - Fixes an undefined behavior arising from reference binding to nullptr and heap OOB in binary cwise ops (CVE-2021-37659)
- Fixes a division by 0 in inplace operations (CVE-2021-37660)
- Fixes a crash caused by integer conversion to unsigned (CVE-2021-37661)
- Fixes an undefined behavior arising from reference binding to nullptr in boosted trees (CVE-2021-37662)
- Fixes a heap OOB in boosted trees (CVE-2021-37664)
- Fixes vulnerabilities arising from incomplete validation in
QuantizeV2(CVE-2021-37663) - Fixes vulnerabilities arising from incomplete validation in MKL requantization (CVE-2021-37665)
- Fixes an undefined behavior arising from reference binding to nullptr in
RaggedTensorToVariant(CVE-2021-37666) - Fixes an undefined behavior arising from reference binding to nullptr in unicode encoding (CVE-2021-37667)
- Fixes an FPE in
tf.raw_ops.UnravelIndex(CVE-2021-37668) - Fixes a crash in NMS ops caused by integer conversion to unsigned (CVE-2021-37669)
- Fixes a heap OOB in
UpperBoundandLowerBound(CVE-2021-37670) - Fixes an undefined behavior arising from reference binding to nullptr in map operations (CVE-2021-37671)
- Fixes a heap OOB in
SdcaOptimizerV2(CVE-2021-37672) - Fixes a
CHECK-fail inMapStage(CVE-2021-37673) - Fixes a vulnerability arising from incomplete validation in
MaxPoolGrad(CVE-2021-37674) - Fixes an undefined behavior arising from reference binding to nullptr in shape inference (CVE-2021-37676)
- Fixes a division by 0 in most convolution operators (CVE-2021-37675)
- Fixes vulnerabilities arising from missing validation in shape inference for
Dequantize(CVE-2021-37677) - Fixes an arbitrary code execution due to YAML deserialization (CVE-2021-37678)
- Fixes a heap OOB in nested
tf.map_fnwithRaggedTensors (CVE-2021-37679) - Fixes a division by zero in TFLite (CVE-2021-37680)
- Fixes an NPE in TFLite (CVE-2021-37681)
- Fixes a vulnerability arising from use of unitialized value in TFLite (CVE-2021-37682)
- Fixes an FPE in TFLite division operations (CVE-2021-37683)
- Fixes an FPE in TFLite pooling operations (CVE-2021-37684)
- Fixes an infinite loop in TFLite (CVE-2021-37686)
- Fixes a heap OOB in TFLite (CVE-2021-37685)
- Fixes a heap OOB in TFLite's
Gather*implementations (CVE-2021-37687) - Fixes an undefined behavior arising from null pointer dereference in TFLite (CVE-2021-37688)
- Fixes an undefined behavior arising from null pointer dereference in TFLite MLIR optimizations (CVE-2021-37689)
- Fixes a FPE in LSH in TFLite (CVE-2021-37691)
- Fixes a segfault on strings tensors with mismatched dimensions, arising in Go code (CVE-2021-37692)
- Fixes a use after free and a potential segfault in shape inference functions (CVE-2021-37690)
- Updates
curlto7.77.0to handle CVE-2021-22876, CVE-2021-22897, CVE-2021-22898, and CVE-2021-22901.