Commit Graph

355 Commits

Author SHA1 Message Date
Reed Wanderman-Milne
642c3e8498 Move mixed precision files out of experimental/ directory.
This is a purely mechanical change. All that is done is:
* Deleted python/keras/mixed_precision/experimental/__init__.py
* All other files in python/keras/mixed_precision/experimental/ are moved one directly up, out of the experimental/ folder
* All Python imports, BUILD dependencies, and other references to the old experimental files are adjusted to refer to the new location

This changes the API golden files, but there is no API change. The golden files referred to the full paths of the classes in "is_instance" sections, and the full paths have changed.

PiperOrigin-RevId: 338345459
Change-Id: I9eefc2bea49b71f26ef7ec3563364a3f1d54abe6
2020-10-21 15:19:21 -07:00
Rick Chao
32f35aabce PSv2: Export a few tf.distribute symbols related to TF2 parameter server training.
This change exports the following class symbols, and adds relevant documentation and example code to

tf.distribute.experimental.ParameterServerStrategy
tf.distribute.experimental.coordinator.ClusterCoordinator
tf.distribute.experimental.coordinator.PerWorkerValues
tf.distribute.experimental.coordinator.RemoteValue

PiperOrigin-RevId: 338151262
Change-Id: If2d1c513d30a999c728cecc2e73b75adda1948c2
2020-10-20 15:42:17 -07:00
Anna R
c0904b922d Expose stream_executor, kernel and op C APIs in pip package and tensorflow_framework shared object.
PiperOrigin-RevId: 337598160
Change-Id: I9eeffdcea14c78e14976673fc19d9f0b9d260c50
2020-10-16 16:34:50 -07:00
Mark Daoust
c8a9751c55 Remove saved_model test from examples.
PiperOrigin-RevId: 336914830
Change-Id: Ib15d58225c837d9550901eddc623961be028cac7
2020-10-13 11:23:37 -07:00
Gunhan Gulsoy
4c6e31c085 Remove depencencies on unnecessary aliases in tensorflow/core
Also remove the aforementioned aliases.

PiperOrigin-RevId: 336902647
Change-Id: I6695049d389b48c890329a0262408f9bbae7d3b1
2020-10-13 10:28:00 -07:00
TensorFlower Gardener
d3226b34b3 Merge pull request from yongtang:filesystem-deps
PiperOrigin-RevId: 333450054
Change-Id: I686d8c11d669c1ebf9786932de7c7683ed70af2c
2020-09-23 23:06:28 -07:00
Andrew Audibert
148e93cf70 [tf.data service] Split data_service_ops_test into ft and non-ft tests
Also, move the tests to experimental/kernel_tests where they belong.

PiperOrigin-RevId: 333177431
Change-Id: I04f415c08268c0f9113d9bbb342bd00bdf911956
2020-09-22 16:12:09 -07:00
TensorFlower Gardener
2ef1ff69d2 Merge pull request from duncanriach:deterministic-image-resize-bilinear
PiperOrigin-RevId: 333087088
Change-Id: Ia85994cc8bf62f1bd21b821f035dea0941d12f93
2020-09-22 08:54:54 -07:00
Yong Tang
3418685cf3 Update to include filesystem:filesystem_interface in libtensorflow_framework.so
While trying to build a modular file system from outside of TF code tree
(with pip install tf-nightly headers), the following error happens:
```
Symbol not found: _TF_SetStatus\n  Referenced
```

The reason for the error was caused by `filesystem:filesystem_interface`
dependency in bazel is not part of the .so.

This PR add `filesystem:filesystem_interface` as part of the dependency.

Also `filesystem:filesystem_interface` replaces `filesystem:modular_filesystem`
as dependency can be reduced to just need `filesystem:filesystem_interface`.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2020-09-21 14:20:54 +00:00
Rick Chao
96a993a650 PSv2: API update: Divide ParameterServerClient in user code to Client and ParameterServerStrategy objects, since we expect users to invoke methods on both objects per discussions. The implication is that we will be exposing both Client and ParameterServerStrategy APIs instead of only ParameterServerClient. Concretely,
[Before change]
```
client = tf.distribute.ParameterServerClient(cluster_resolver=...)
distributed_dataset = client.create_per_worker_dataset(dataset_fn=...)
with client.strategy.scope():
  model, optimizer, metrics = ...

@tf.function
def worker_fn(iterator):
  def train_fn(iterator):
    # grab a batch, calculate gradient, applying gradient, metrics update etc.
  client.strategy.run(train_fn, args=(iterator,))

for epoch in range(num_epoch):
  for step in range(steps_per_epoch):
    client.schedule(worker_fn, args=(distributed_iterator,))
  client.join()
```

[After change]
```
strategy = tf.distribute.experimental.ParameterServerStrategy(cluster_resolver=...)
client = tf.distribute.Client(strategy=strategy)
distributed_dataset = client.create_per_worker_dataset(dataset_fn=...)
with strategy.scope():
  model, optimizer, metrics = ...

@tf.function
def worker_fn(iterator):
  def train_fn(iterator):
    # grab a batch, calculate gradient, applying gradient, metrics update etc.
  strategy.run(train_fn, args=(iterator,))

for epoch in range(num_epoch):
  for step in range(steps_per_epoch):
    client.schedule(worker_fn, args=(distributed_iterator,))
  client.join()
```

PiperOrigin-RevId: 332065946
Change-Id: Ibce265e29d585fda8829f9c33409667992231480
2020-09-16 12:56:58 -07:00
Frank Chen
f33afc4822 Fix test failure in traverse_test by adding //tensorflow/tools/common:traverse dependency to BUILD file
PiperOrigin-RevId: 331825083
Change-Id: Ibf1d06d410f204df137082e7b39a852e3c286e02
2020-09-15 12:25:12 -07:00
Sanjoy Das
3cbb507689 Delete SYCL support
See discussion here:
https://github.com/tensorflow/tensorflow/issues/41809#issuecomment-688021592

Fixes .

PiperOrigin-RevId: 331808169
Change-Id: Ib0861cf250c92c20f0e8a22adce89a4dc4d3548a
2020-09-15 11:21:47 -07:00
Frank Chen
4acda67a99 Add back dependencies in tools/common:* accidentally deleted by cl/331201158
PiperOrigin-RevId: 331650639
Change-Id: I4c9814351ff2a09cddaad7ec91cc96b0b320bcbd
2020-09-14 16:50:42 -07:00
TensorFlower Gardener
86b67b8c82 Merge pull request from yongtang:filesystem
PiperOrigin-RevId: 331644590
Change-Id: Ib25cf90adf68e14fd7ebbcf71cfd96cf580a8fcc
2020-09-14 15:53:19 -07:00
Yong Tang
2f806187c1 Expose modular file system header in pip install package
This PR tries to expose modular file system header in pip install package
so that downstream packages could use the header files with pip install

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2020-09-12 02:40:02 +00:00
Mark Daoust
39d5167c28 Delete old doc generator.
PiperOrigin-RevId: 331201158
Change-Id: I546039f46edd0d11c6bda766cea856e63fa640c3
2020-09-11 12:56:46 -07:00
A. Unique TensorFlower
7921c4d517 Experimental support of _add_supported_value_type for RaggedTensor.
It allows RaggedTensor.values to have types other than just RaggedTensor and Tensor.

Based on draft implementation by edloper@.

PiperOrigin-RevId: 329733234
Change-Id: Iad61506d34a72e97a9611008cdc20258e1f2bd8e
2020-09-02 10:06:20 -07:00
Duncan Riach
116db3235a Add deterministic mode for resize_bilinear back-prop 2020-09-01 13:15:49 -07:00
Allen Lavoie
a9a692d221 Move loss_scale_optimizer_test and fix pip dependencies to unbreak the test on Windows
Seems like a problem with alias rules as pip dependencies

PiperOrigin-RevId: 329413866
Change-Id: If0262d86f66f5c0f39c2f343cd47e6359e40e010
2020-08-31 18:14:13 -07:00
Dan Moldovan
359db190bc Fix build rules for typing_extensions dependency.
PiperOrigin-RevId: 328530697
Change-Id: Ib258f70f231f73464c00f20dea67d6339f87e8ae
2020-08-26 07:56:22 -07:00
Rick Chao
f8875e952b PSv2: Add parameter_server_client_mpr_test to cover expected behavior at PS failure. Add utils for start_server convenient function.
PiperOrigin-RevId: 326527865
Change-Id: I952d92b87490763ffbba58affa0aa7cae838a7ab
2020-08-13 14:50:21 -07:00
Rick Chao
8148680637 PSv2: Move TF2 parameter server training main library code into OSS.
PiperOrigin-RevId: 324524057
Change-Id: Ifa033dd03b0f1ca830b6b5dcdc71a8ea34b67d08
2020-08-02 18:06:52 -07:00
Mihai Maruseac
a3c993eab7 PSv2: Move TF2 parameter server training main library code into OSS.
PiperOrigin-RevId: 324221520
Change-Id: I19922552dc9e804067f2aa077b5a08af68020eb5
2020-07-31 09:29:31 -07:00
Rick Chao
a4725be4a7 PSv2: Move TF2 parameter server training main library code into OSS.
PiperOrigin-RevId: 324103111
Change-Id: Ic6c9eb64e851873c1ee6e768f645b9367528470d
2020-07-30 16:18:16 -07:00
Anna R
4845b298f8 Removing networking C API from experimental directory. It is not used and probably lacks functionality to make it more useful.
PiperOrigin-RevId: 323685902
Change-Id: I088623a51c92df4f3482a1a5518ce08742342bb9
2020-07-28 17:22:35 -07:00
Yanhui Liang
b8e9182300 Split saved model benchmark tests into individual test to avoid timeout.
PiperOrigin-RevId: 321242864
Change-Id: I5ac6e9efec62e667f0b67f0e7f7e0c4029263de6
2020-07-14 15:10:12 -07:00
Mihai Maruseac
20982b2052 Revert Split saved model benchmark tests into individual test to avoid timeout.
PiperOrigin-RevId: 321144378
Change-Id: Icbdad7cdb1daa873c65ce4000e0ce68ed0f7a829
2020-07-14 06:13:41 -07:00
Yanhui Liang
88ce07f6fc Split saved model benchmark tests into individual test to avoid timeout.
PiperOrigin-RevId: 321061292
Change-Id: Iff5c7da73aec5f963b6cfb38cd16e05b09e4d2f9
2020-07-13 16:57:02 -07:00
Yanhui Liang
520604fb0b Rollback of PRs and as they break nightly builds
PiperOrigin-RevId: 320688173
Change-Id: I7f569d42a504dc5ff4f2b3befc68095fc889f8be
2020-07-10 15:37:47 -07:00
Scott Zhu
df16e58a7d Removing all the build deps from python/distribute to python/keras/distribute.
PiperOrigin-RevId: 320470540
Change-Id: I198071f175ff4bbd76923df86f7beb5786934bab
2020-07-09 14:58:40 -07:00
Mihai Maruseac
2bd19c69ae Move fft2d to stable fork
Release is at https://github.com/petewarden/OouraFFT/releases/tag/v1.0

PiperOrigin-RevId: 315986633
Change-Id: I94323922d827a79f3e1dce58acff7e91640b8e9c
2020-06-11 15:12:44 -07:00
Ran Chen
c674577870 Improve multi_process_runner
This is to prepare enabling it for OSS.

PiperOrigin-RevId: 315878874
Change-Id: Ib29bccf3c964462a7643df4b1cd011ddda79372b
2020-06-11 05:20:30 -07:00
Benoit Jacob
c254833717 Bump the ruy repository reference, getting in particular:
- Use of the cpuinfo thirdparty library to perform CPU feature detection, including detection of dot-product instructions on iOS and detection of cache sizes. Combined with the ARM64 build change below, this means that iPhone11/SE devices now use dot-product instructions. We measured 250 Gop/s on 1 Lightning core in iPhone 11 Pro.
- ARM32: @lissyx's fix in 
- ARM64: build the kNeonDotprod path unconditionally (used to be linux-only).
- x86-64: enabling AVX512 instructions in the general opensource build.

PiperOrigin-RevId: 315467315
Change-Id: I0788ddc68da8d0aa2eee71f820fb5d8c188d35b2
2020-06-09 05:59:44 -07:00
Gunhan Gulsoy
13e4d28155 Bump the ruy repository reference, getting in particular:
- ARM32: @lissyx's fix in 
- ARM64: enabling dotprod instructions outside of Linux.
- x86-64: enabling AVX512 instructions in the general opensource build. A previous version of this CL was rolled back due to lack of support for -march=skylake-avx512 in some toolchains. Hopefully this will fare better thanks to b68dcd8713 .

PiperOrigin-RevId: 314766242
Change-Id: I56027a328248f2d85c9c74d3d8e27328ac25f332
2020-06-04 11:23:08 -07:00
Benoit Jacob
f15d6e1efc Bump the ruy repository reference, getting in particular:
- ARM32: @lissyx's fix in 
- ARM64: enabling dotprod instructions outside of Linux.
- x86-64: enabling AVX512 instructions in the general opensource build. A previous version of this CL was rolled back due to lack of support for -march=skylake-avx512 in some toolchains. Hopefully this will fare better thanks to b68dcd8713 .

PiperOrigin-RevId: 314597853
Change-Id: Ia64d5aa5bb9e47140e084e0896a5685cac247886
2020-06-03 14:03:28 -07:00
Zhenyu Tan
cfd10f8b35 Bump the ruy repository reference, getting in particular @lissyx's fix in , and enabling dotprod instructions outside of Linux.
PiperOrigin-RevId: 314431523
Change-Id: I7c4ba417c45363bf735d6d00d88f88198b89be18
2020-06-02 16:59:24 -07:00
Benoit Jacob
6faecb105e Bump the ruy repository reference, getting in particular @lissyx's fix in , and enabling dotprod instructions outside of Linux.
PiperOrigin-RevId: 314363767
Change-Id: Idb34495d2f040792d795edb8050a20fbbe41a61c
2020-06-02 11:06:01 -07:00
Mehdi Amini
02dc6f8dce Bump the ruy repository reference.
PiperOrigin-RevId: 313866050
Change-Id: I6a3c97d6f4e74c6078eb3bcc1607e51fc1f4d784
2020-05-29 16:00:55 -07:00
Benoit Jacob
8738f2d4c0 Bump the ruy repository reference.
PiperOrigin-RevId: 313815027
Change-Id: Iee056840531149ec6735295b6384c32afb07672a
2020-05-29 13:18:51 -07:00
Andrew Audibert
4e4a4496b7 [tf.data service] Export server_lib in public API.
PiperOrigin-RevId: 313669209
Change-Id: Idaf84dc8360a03699e12c7d83511baa4c21d240b
2020-05-28 15:24:50 -07:00
Yong Tang
c4ab2d38bc Add mlir_graph_optimization_pass.h header to pip wheel
This PR adds mlir_graph_optimization_pass.h header to tf-nightly pip wheel.
mlir_graph_optimization_pass.h is a header file that allows to register
mlir based graph optimizaton (either part of the tensorflow, or externally
registered).
However, it is not part of the pip install so it is not possible
to register with installed version of tensorflow. This PR adds the header
file to be part of the pip install.
This PR is related to 39231

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2020-05-10 03:37:15 +00:00
Yong Tang
1d698878c2 Add missing mlir_passthrough_op in pip wheel install
While trying to following the example of MlirPassthroughOp in the docstring
(https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/api_def/base_api/api_def_MlirPassthroughOp.pbtxt):

```python
import tensorflow as tf
from tensorflow.compiler.mlir.tensorflow.gen_mlir_passthrough_op import mlir_passthrough_op

mlir_module = '''python
func @main(%arg0 : tensor<10xf32>, %arg1 : tensor<10xf32>) -> tensor<10x10xf32> {
   %add = "magic.op"(%arg0, %arg1) : (tensor<10xf32>, tensor<10xf32>) -> tensor<10x10xf32>
   return %ret : tensor<10x10xf32>
}
'''

@tf.function
def foo(x, y):
  return mlir_passthrough_op([x, y], mlir_module, Toutputs=[tf.float32])

graph_def = foo.get_concrete_function(tf.TensorSpec([10], tf.float32), tf.TensorSpec([10], tf.float32)).graph.as_graph_def()
```

The following error occurs in tf-nightly:
```
>>> from tensorflow.compiler.mlir.tensorflow.gen_mlir_passthrough_op import mlir_passthrough_op
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorflow.compiler.mlir'
>>>
>>>
```

The reason was that dependency `"//tensorflow/compiler/mlir/tensorflow:gen_mlir_passthrough_op_py"`
was not included in pip.

This PR fixes the issue.

This PR is more or less related to 38894, which fixes a typo in docstring itself.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2020-04-26 15:14:15 +00:00
Rohan Jain
65b4e47ece Do not create an extra GradientTape in custom_gradient/recompute_grad. The extra tape leads the tf.function gradient code to believe that the user intends to compute higher order derivatives. This requires generating a forward function with all possible side outputs which is expensive. This also doesn't work well with control flow and causes the added test to fail.
Instead, we create a VariableWatcher object that keeps track of variables that
have been accessed.

PiperOrigin-RevId: 307157027
Change-Id: Ifd628b421dc725ad2366af2f6f63cf52dd1511e9
2020-04-17 19:58:53 -07:00
Amit Patankar
5fb9558424 Removing the stale py_wrap_cc and swig compiler rules from TensorFlow.
PiperOrigin-RevId: 305535788
Change-Id: I86032bdb11c08e8a647ded3def75423bace80ca9
2020-04-08 12:56:03 -07:00
Benoit Jacob
3376402afd Reference ruy from its new location as a separate GitHub project.
PiperOrigin-RevId: 304653289
Change-Id: I2a3ce84177665a4d7f455d455c0e7d71d48a68e9
2020-04-03 11:17:08 -07:00
Andrew Audibert
8434a67458 Move server_lib under tensorflow/python to fix nightly pip build.
tf_python_pybind_extension requires that it be used under the tensorflow/python directory.

PiperOrigin-RevId: 304490055
Change-Id: If9e16aa20e4223149f1d1aa7d732db7bae033461
2020-04-02 15:32:00 -07:00
Andrew Audibert
503179f662 Fix pip build
PiperOrigin-RevId: 303784519
Change-Id: I88f66b8bd3ed34d5bf8931afbf73d08943314f77
2020-03-30 11:38:48 -07:00
Gunhan Gulsoy
37dfcf6e2a [TF] Expose C API in libtensorflow_framework.
While at it, expose the associated header files from tensorflow/c/ in pip package.

Note, we expose the subset of C API that doesn't require tensorflow/cc linkage;
specifically the core operations that exclude building while loops and gradient ops,
and also excluding the experimental API.

The experimental API can also be added in the future, by factoring it into
"core" and "non-core" targets.  Similarly for the C eager API.

PiperOrigin-RevId: 301601988
Change-Id: I97eac79e684fc42ce90e67ee901cdcf6f7e91cbe
2020-03-18 09:17:46 -07:00
Eugene Brevdo
6e62523b64 [TF] Expose C API in libtensorflow_framework.
While at it, expose the associated header files from tensorflow/c/ in pip package.

Note, we expose the subset of C API that doesn't require tensorflow/cc linkage;
specifically the core operations that exclude building while loops and gradient ops,
and also excluding the experimental API.

The experimental API can also be added in the future, by factoring it into
"core" and "non-core" targets.  Similarly for the C eager API.

PiperOrigin-RevId: 301430667
Change-Id: I5ae7f3cedfe9dc72184d39ef1147193450c3d92e
2020-03-17 12:43:04 -07:00
Scott Zhu
9d297ebabc Remove all frozen copy of Keras code.
PiperOrigin-RevId: 300795615
Change-Id: Ibe8e69cddeb992aaa00a87da4c6543c8804f7b14
2020-03-13 11:40:23 -07:00