Commit Graph

6152 Commits

Author SHA1 Message Date
A. Unique TensorFlower
034633f23b PY2 removal cleanup
PiperOrigin-RevId: 352106691
Change-Id: I382d53c64f0d29da430b8cb6d2395a2cb281509e
2021-01-15 16:48:57 -08:00
Thomas O'Malley
186d9b18da PreprocessingLayers adapt API changes.
Changed methods:
- adapt(data, batch_size=None, steps=None, reset_state)
Added methods:
- update_state
- merge_state
- finalize_state
- compile
- make_adapt_function

Reimplements adapt on top of existing Model.fit utilities.
In follow-up changes, each subclass will be migrated to use the new API methods
directly, and the CombinerPreprocessingLayer class will be removed.

PiperOrigin-RevId: 352102154
Change-Id: If993c07e68b6652896010a25a21dad0560e93329
2021-01-15 16:12:40 -08:00
Mihai Maruseac
3229483cb1 Don't use $HOME, use ~.
Should fix `gpu_on_cpu` Docker build.

PiperOrigin-RevId: 352055331
Change-Id: I964f2cbca39d126b5043bd621b38fa288dddc416
2021-01-15 12:03:21 -08:00
Mihai Maruseac
21ee78c7c9 Excise remaining python2 and python3.5 names.
We already deprecated them, so they should no longer be used at all. We have CI failing as it picks a py3.5 default. Subsequent changes will fix broken CI jobs.

PiperOrigin-RevId: 352044870
Change-Id: I50a62d322ec05781beea78a27704ee7849c277e1
2021-01-15 11:14:00 -08:00
A. Unique TensorFlower
1059e04b92 Update clang in RBE dockerfile to the latest release.
PiperOrigin-RevId: 351971567
Change-Id: I775e3be354f896c9ccefc3339fd9737f479ceeaf
2021-01-15 02:49:56 -08:00
Matt Watson
5fb1d0e838 Support a mask_value argument for preprocessing.hashing
This argument will allow specifying a value which should always map to the zero
index. For now, this will only be supported for a single tensor input as the
desired behavior when crossing multiple inputs is unclear.

PiperOrigin-RevId: 351904657
Change-Id: I8ae3fd88ef94f7b1244cd1a6da7adbc2a40dfef1
2021-01-14 17:15:59 -08:00
Mihai Maruseac
754034e5de Install bazelisk in docker_cpu_pip.sh
Since caller scripts use Bazelisk, the docker job is broken if we want to use a bazel that is no longer the default one.

PiperOrigin-RevId: 351891433
Change-Id: I6caf0b5940934a3a90737f7fae288c42953a23f1
2021-01-14 15:44:53 -08:00
A. Unique TensorFlower
7e6ea327fe Update MLCompass scripts, a TF CI release script, and a Kokoro benchmark to install pip deps with python<x.x> instead of pip<x.x>.
PiperOrigin-RevId: 351862450
Change-Id: I44e20c77454face9e8f8c1fd9d43eb7a65a49055
2021-01-14 13:21:32 -08:00
A. Unique TensorFlower
9cbbc16a2f Update TF CI rel scripts to install pip deps with python<x.x> instead of pip<x.x>.
PiperOrigin-RevId: 351853846
Change-Id: I8d26b6fd3143225a9a646b827f452cbb606b35d8
2021-01-14 12:52:49 -08:00
Advait Jain
4491d6ee3a Move the bazel builds to the TFLM docker image.
Fixes 

PiperOrigin-RevId: 351832447
Change-Id: I287697d82f05d0a8375fdb3dd8dd2e86c83f084d
2021-01-14 10:59:17 -08:00
TensorFlower Gardener
e687cab616 Merge pull request from meteorcloudy:apple_silicon_build
PiperOrigin-RevId: 351822115
Change-Id: I423db3385e0b80709fc442d8c2991211186e4bcc
2021-01-14 10:10:23 -08:00
Advait Jain
f2922b713c Use clang instead of gcc for the bazel build.
Fixes 

PiperOrigin-RevId: 351800994
Change-Id: I75ceaf6a6b46e147ea8a9f5de84ad89b6cf5d186
2021-01-14 08:09:34 -08:00
Scott Zhu
c4aab50762 Move the LossReduction class from tf to Keras.
PiperOrigin-RevId: 351654535
Change-Id: I405d4f79568c05ddeaa3755c3171960db633e6de
2021-01-13 13:40:14 -08:00
Andrew Audibert
706350f023 [tf.data service] Implement round-robin reads.
This enables a new mode of reading from the tf.data service, where consumers read from tasks in a coordinated fashion, instead of the normal first-come first-served.

The main use case for this is coordinated bucketization for synchronous training, where we want to ensure that at each step consumers get batches with elements of similar sizes. This mitigates the inefficiency of some consumers slowly training on large examples while others quickly train on small examples, then block waiting for the slower examples to be processed.

When `consumer_index` and `num_consumers` are specified to `distribute`, each task will enforce a strict round-robin order, where its first element goes to consumer 0, second element to consumer 1, and so on. This requires that all consumers consume the same number of elements.

PiperOrigin-RevId: 351625063
Change-Id: I9b400f55ad61406cb125af8225096e7ff5dc4b0c
2021-01-13 11:29:05 -08:00
A. Unique TensorFlower
de010e454b Update nightly releases to install pip deps with python<x.x> instead of pip<x.x>.
PiperOrigin-RevId: 351455050
Change-Id: I15e6ffa41e59480246cc92f98bf8e3c6478e0957
2021-01-12 15:16:53 -08:00
A. Unique TensorFlower
868d16e045 Add bash script install_ubuntu_16_python_pip_deps to incrementally replace install_ubuntu_16_pip_deps.
PiperOrigin-RevId: 351446270
Change-Id: I6a2191e572ee22830e9eb462bf0e572692050f0e
2021-01-12 14:38:55 -08:00
RJ Skerry-Ryan
6ae54f7c58 Do not cache variable scopes in legacy_tf_layers.base.Layer when Eager is enabled (regardless of the current context).
Caching the variable scope causes the layer to be "poisoned" when used within a tf.function, since if the layer is called for the first time inside a tf.function, then a FuncGraph scope is captured and then re-entered on every subsequent call. This caching was simply a graph-building (Python) performance optimization and can be skipped if Eager is enabled.

PiperOrigin-RevId: 351286068
Change-Id: Ia82958b8fca83bac36f6bc3ce4dd08a8e5011ca0
2021-01-11 19:43:17 -08:00
A. Unique TensorFlower
68024de2a7 Make is_resource_variable() an tf.__internal__ API.
PiperOrigin-RevId: 351272430
Change-Id: Ic628427e5ecc15628ef4f5d63e99a8b0604f3a81
2021-01-11 17:54:23 -08:00
Scott Zhu
86339436a7 Make is_resource_variable() an tf.__internal__ API.
PiperOrigin-RevId: 351249930
Change-Id: I4c8aa09d5584531c723f0f4919cbf5f30080f705
2021-01-11 15:38:06 -08:00
Yunlu Li
a0e249979f Converter API change to enable optimization with sparsity.
To enable optimization with sparsity, use:
converter.optimizations = [tf.lite.Optimize.SPARSITY]
converter.convert()

Note:
1) This feature is experimental
2) It requires the use of during training pruning to be effective.
3) Not all kernels have been optimized for sparse execution, so the initial benefit will primarily be in the model size on disk.
PiperOrigin-RevId: 351245576
Change-Id: I2a771f2a5ead92bdf93821af9f8058b0957b5aef
2021-01-11 15:20:52 -08:00
Francois Chollet
9349a096eb Add smart_resize option to image_dataset_from_directory.
PiperOrigin-RevId: 351188455
Change-Id: Ifb24fabc529c266f5c99d9486f191b40ebfd76cf
2021-01-11 11:24:34 -08:00
A. Unique TensorFlower
d69dd992bd Add -march=native to kokoro tests.
PiperOrigin-RevId: 351177587
Change-Id: I9b995db41ae35e9768001fcb03ce58360e586ad5
2021-01-11 10:08:29 -08:00
Peng Wang
587ac71f68 Allows creating tf.random.Generator under distribution-strategy scopes. Different replicas will get different random-number streams.
All strategies are supported except for CentralStorageStrategy and ParameterServerStrategy.

This CL also removes the CompositeTensor superclass from Generator. Generator is a wrapper around tf.Variable, and because tf.Variable is not a CompositeTensor, Generator can't be a CompositeTensor in theory. Previously we made it a CompositeTensor by returning Variable.handle, but that breaks down when the variable is a DistributedVariable (in cross-replica context).

PiperOrigin-RevId: 350851648
Change-Id: I5f4d77ddb990557fcc9c7336987203ecdaec5b9a
2021-01-08 15:58:22 -08:00
Adrian Kuegel
6a848f27ab Create a new ROCM RBE Docker image with ROCM 4.0.
Update the hash accordingly.

PiperOrigin-RevId: 350711537
Change-Id: I8ef9a84d59831c377e867bb6c88dd4307953b365
2021-01-08 00:09:30 -08:00
Francois Chollet
33910c7d76 Graduate to core the following experimental learning rate schedules: CosineDecay, CosineDecayRestarts.
Remove from the API the following experimental learning rate schedules: LinearCosineDecay, NoisyLinearCosineDecay.

PiperOrigin-RevId: 350704711
Change-Id: Iebe9bc0eff38f79684e8d2f030fd838d06176494
2021-01-07 22:58:42 -08:00
Yun Peng
bab0d14036 Make TensorFlow build on Apple Silicon 2021-01-07 16:26:58 +01:00
TensorFlower Gardener
14246bd028 Merge pull request from ROCmSoftwarePlatform:google_upstream_rocm_raise_cap_2GB
PiperOrigin-RevId: 350549950
Change-Id: I3149989eb89ad572a054906e16f780f8aec8b526
2021-01-07 06:52:34 -08:00
Scott Zhu
8b65e66f2f Update docstring for base layer in Keras.
1. Suggest the typical `call()` method signature for base layer, make it clear that *args and **kwargs are not needed unless necessary.
2. Add *args to the `call()` method signature to make it align with the docstring.
3. Add reference to the tf guide for custom layer from the docstring.

PiperOrigin-RevId: 350499593
Change-Id: I4066d335a4a337cf7923bffc1e4f090f15e3f30f
2021-01-06 23:59:28 -08:00
Jacques Pienaar
4de058963e Add show_debug_info flag to MLIR testing functions
mlir.convert_* are experimental, testing interface that returns a textual version of input function/graph. Enable dumping location information as well.

PiperOrigin-RevId: 350450836
Change-Id: Ifc9d3377b7ceee186cd09b010ce4fd4371607e81
2021-01-06 16:39:48 -08:00
TensorFlower Gardener
02d1dd100d Merge pull request from ROCmSoftwarePlatform:google_upstream_rocm_update_run_pip_tests
PiperOrigin-RevId: 350441145
Change-Id: Ifc0efa7dc77eee37bed815b48fe353e6a287a72e
2021-01-06 15:44:37 -08:00
TensorFlower Gardener
991b6592c1 Merge pull request from sanjoy:ld-library-path-stub-fix
PiperOrigin-RevId: 350417397
Change-Id: Ia3f57cfb4dba6d8ce13b0f5397aab2166ff424d2
2021-01-06 13:37:27 -08:00
Dan Moldovan
e2395993d0 Upgrade to gast 0.4.
With thanks to @bhack for contributions in .

PiperOrigin-RevId: 350377724
Change-Id: If1dbc77b9c2c7d640720f847292586aca39da80d
2021-01-06 10:17:47 -08:00
TensorFlower Gardener
9b3f838c23 Merge pull request from Intel-tensorflow:ganand1/build_openssh_path_fix
PiperOrigin-RevId: 350375677
Change-Id: I18a550699191428fdec146207a097d86d7cb8cc3
2021-01-06 10:07:45 -08:00
Deven Desai
4574fb2176 [ROCm] Raising the memory allocation cap for GPU unit tests from 1GB to 2GB
This PR/commit updates the `parallel_gpu_execute.sh` script to raise the GPU memory allocation cap from 1GB to 2GB when running unit-tests.

Recently a couple of unit tests started failing on the ROCm platform because they were running out of memory

```
//tensorflow/python/kernel_tests:extract_image_patches_grad_test_gpu
//tensorflow/python/ops/numpy_ops:np_interop_test_gpu
```

GPU unit tests (atleast on the ROCm platform) are run with a cap that is set and implemented as shown here :

* https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/ci_build/gpu_build/parallel_gpu_execute.sh#L26-L32
* https://github.com/tensorflow/tensorflow/blob/master/tensorflow/stream_executor/stream_executor_pimpl.cc#L130-L137
* https://github.com/tensorflow/tensorflow/blob/master/tensorflow/stream_executor/stream_executor_pimpl.cc#L151
* https://github.com/tensorflow/tensorflow/blob/master/tensorflow/stream_executor/stream_executor_pimpl.cc#L487-L503

It does not seem that the `parallel_gpu_execute.sh` is being used on the CUDA platform (anymore...think it was in the past). There does not seem to be any reference to it in the `Invocation Details` tab of the `Linux GPU` CI job.

for e.g - https://source.cloud.google.com/results/invocations/09d63e6a-f7a9-4fc6-9708-2fdd40b8b193/details

It also does not seem that GPU unit tests on the CUDA platform are being subjected to the 1GB memory cap. This can be verified by looking the at `Target Log` for the `//tensorflow/python/ops/numpy_ops:np_interop_test_gpu` test in the `Linux GPU` CI job (actually any GPU unit test)

for e.g. - https://source.cloud.google.com/results/invocations/09d63e6a-f7a9-4fc6-9708-2fdd40b8b193/targets/%2F%2Ftensorflow%2Fpython%2Fops%2Fnumpy_ops:np_interop_test_gpu/log

On the ROCm platform, we see the following log messages which are generated as a consequence of the memory cap (when TF tried to grab the entire available GPU memory on startup)

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/stream_executor/stream_executor_pimpl.cc#L488-L494

```
 W tensorflow/stream_executor/stream_executor_pimpl.cc:490] Not enough memory to allocate 16133306368 on device 0 within provided limit. [used=0, limit=1073741824]
 W tensorflow/stream_executor/stream_executor_pimpl.cc:490] Not enough memory to allocate 14519974912 on device 0 within provided limit. [used=0, limit=1073741824]
 W tensorflow/stream_executor/stream_executor_pimpl.cc:490] Not enough memory to allocate 13067976704 on device 0 within provided limit. [used=0, limit=1073741824]
 W tensorflow/stream_executor/stream_executor_pimpl.cc:490] Not enough memory to allocate 11761178624 on device 0 within provided limit. [used=0, limit=1073741824]
...
...
...
```

These messsage are not present in unit tests logs for `Linux GPU` CI job, which seems to suggest that the env var `TF_PER_DEVICE_MEMORY_LIMIT_MB` is not set when the unit tests are run. Either that or the GPU on which the tests are being run has 1GB total memory which is unlikely.
2021-01-06 15:33:12 +00:00
ganand1
6def8adb8b Path fix for local build of openssh 2021-01-05 19:10:42 -08:00
TensorFlower Gardener
46da928d5c Merge pull request from markub3327:master
PiperOrigin-RevId: 350243935
Change-Id: If5fc021f3c55b16f7649d6e3ac92e8e64cb6fb4c
2021-01-05 16:41:43 -08:00
Sanjoy Das
b9c3a9a30d [Dockerfile] move stubs to the end of LD_LIBRARY_PATH
This lands PR .
2021-01-05 16:00:53 -08:00
Tomer Kaftan
1b94fd1b8a Add support for creating Keras.inputs from arbitrary TypeSpecs. (Including TypeSpecs that don't have a dtype)
PiperOrigin-RevId: 350200835
Change-Id: I06772c1d6ece689f17a72d787dcd12c6f611e7e3
2021-01-05 12:58:49 -08:00
Ran Chen
f9ad300525 Add tblib and dill to TEST_PACKAGES
Fixes 

PiperOrigin-RevId: 350193487
Change-Id: Ia5182c86c9712da15ac24f55b1dc1582b663f614
2021-01-05 12:20:04 -08:00
TensorFlower Gardener
dde9b61feb Merge pull request from ROCmSoftwarePlatform:google_upstream_rocm_switch_to_rocm40
PiperOrigin-RevId: 350140370
Change-Id: Ic33f95a7e829d06bf860c54eb0bd8c5fdcf198e8
2021-01-05 08:05:33 -08:00
TensorFlower Gardener
df7465d3f1 Merge pull request from Intel-tensorflow:ganand1/master_icx_launch
PiperOrigin-RevId: 350040548
Change-Id: I7bc616fb7d1e01e073b3d4da3977be2e5523f71f
2021-01-04 13:16:59 -08:00
Martin Kubovčík
f13ea73a9e
Update build_pip_package.sh 2021-01-04 19:44:00 +01:00
ganand1
763c2064ca
Update tensorflow/tools/ci_build/linux/mkl/install_openmpi_horovod.sh
Co-authored-by: Penporn Koanantakool <38085909+penpornk@users.noreply.github.com>
2020-12-31 19:16:10 -08:00
ganand1
1e3889340f Merge branch 'ganand1/master_icx_launch' of https://github.com/Intel-tensorflow/tensorflow into ganand1/master_icx_launch 2020-12-31 12:04:52 -08:00
TensorFlower Gardener
0f814d9262 Merge pull request from bhack:grpcio_1.34.0
PiperOrigin-RevId: 349669443
Change-Id: Icdcf14d355d17ede21a610e8dc8793f0410d7844
2020-12-31 05:21:11 -08:00
TensorFlower Gardener
82c642bcbb Merge pull request from ashahba:ashahba/fix-horovod
PiperOrigin-RevId: 349669397
Change-Id: Id4c9fc84d774e1db26f85196dee018251ff9819a
2020-12-31 05:15:22 -08:00
Sanjoy Das
c7aa1c84f9 Don't explicitly include //tensorflow/compiler/mlir/lite/...
It is included as part of //tensorflow/...

PiperOrigin-RevId: 349570938
Change-Id: If683c7ac2104dc235a79d611bd5380466dc294f9
2020-12-30 10:05:31 -08:00
Sanjoy Das
ee02937dab Make DEFAULT_BAZEL_TARGETS multi-line
This makes diffs more readable.

PiperOrigin-RevId: 349569970
Change-Id: I32a35e2e701d3fa5df4cc3b7642b87df57260d30
2020-12-30 09:56:33 -08:00
bhack
d0ef373958 Upgrade grpcio to 1.34.0 2020-12-28 20:21:36 +00:00
Scott Zhu
0817aac6be Fork the implementation of tf.initializer to keras.
Since the implementation between tf.initializer and keras.initializer are just duplicates, copy the function to keras so that it is standalone. This allows us to freely delete the code in tf if preferred. Also update the build dependency to be more explicit.

PiperOrigin-RevId: 349305978
Change-Id: Ic49a160037a5a0a77bc8826c597ffd7fbeaa5011
2020-12-28 11:13:42 -08:00