Because changes like this could accidentally cause TensorFlow to lose its link to XLA, I've added a check that `//third_party/tensorflow/python/eager:def_function` depends on XLA.
PiperOrigin-RevId: 354426190
Change-Id: Ie6e687fa49e3fdb62146d79f38b72e7862054083
While working on modular file systems, noticed that the logging
C API headers are not included in tensorflow pip packages.
This limit the ability for plugins to add logging in the file system.
This PR adds logging C API header in pip package.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
dialect
The pass is registered globally and only invoked when the op was not
registered. If the composition of the op is available, the original op will be
expanded.
PiperOrigin-RevId: 336921199
Change-Id: Ie2d509a1a565c04844e73f00b991942208db8e88
The pass is registered globally and only invoked when the kernel was not found
for the op. If the composition of the op is available, the original op will be
rewritten to a function call op, which calls to the function derived from the
composition. Inside the pass, the function def is added to the eager context.
After the pass is returned, the new op will do a device placement again to
locate the function def.
The op expansion is cached for the op with the same attributes, so we should do
the op expansion repeately.
PiperOrigin-RevId: 336888128
Change-Id: If6a35c599d224d927d2f98e90c6d65dab9c1c74c
This PR is part of the effort for modular file system.
In modular file system `RegisterFilesystemPlugin` was a C++
API and there is no directly way to call this API through python.
This PR exposes C API `TF_RegisterFilesystemPlugin`, so that
it can be used in python bindings.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This will be used to check health of peers for MultiWorkerMirroredStrategy. I chose to add a python binding instead of an Op because I don't it to be exposed in tf.raw_ops, nor be subject to GraphDef compatibility requirement.
This difference between this and the existing ContextCheckAlive is that this is specific to multi client training. We need to tell if a worker has failed and restarted. EagerContext uses context_id for this purpose, but in MWMS we don't create EagerContext on peers. Collectives tracks device incarnations of peers, so we use that instead.
For now the check health will be in an all-to-all style, we can use more complicated topology in the future if needed.
PiperOrigin-RevId: 328843814
Change-Id: Id1281074cf0a79d1339bb4fd73caa6f6e68f518f
With the std::string -> tensorflow::tstring migration in tensorflow core complete, we now have an ABI stable string type with associated C accessors/modifiers. The packing/unpacking of string tensors across the C-API is now superfluous and can be removed. This is an ABI breaking change; updates to language bindings in tensorflow/ are included in this CL.
PiperOrigin-RevId: 318933001
Change-Id: I3c99cf70834ba0b6cefc4ba39a35d6c168e880db
This is plumbing just enough to pass all the unit-tests.
The conversion to the function library is quite inefficient, but it isn't
clear if we want to optimize this or just focus on TFRT moving forward.
PiperOrigin-RevId: 313356850
Change-Id: I83815317d4958786d0103168b5d88498f89511ed
We'll want this for implementing copy for `TF_AbstractOp`s backed by `TFE_Op`s (since we want to copy the type/attributes but not the inputs).
PiperOrigin-RevId: 309756974
Change-Id: I07a8c48f50ab6d3c8a7d7db972fb60202b86434d
Since the struct lifetime is bound to the wrapped pointer this is fine.
PiperOrigin-RevId: 308941521
Change-Id: I0604fff4fcba6a03cc4a2242ab9f182fbfbf8bae
This change splits many (but not all) of the function-related targets into separate cc_library targets. The main changes are:
* Move "graph/graph_constructor.{h,cc}" to "common_runtime/graph_constructor.{h,cc}" and leave a forwarding header. This code depends on common_runtime and is built as part of it, so it makes sense to move it across. The "graph_constructor" library includes "shape_refiner.{h,cc}", "graph_runner.{h,cc}", and "eval_const_tensor.{h,cc}" because of a circular dependency between these modules.
* Split "function.{h,cc}" into "function_body.{h,cc}", "function_utils.{h,cc}", and "inline_function_utils.{h,cc}" (plus the original, slimmed-down module). This enables other targets in common_runtime to depend on just the function utilities they need, without the whole runtime, which breaks some cycles.
* New fine-grained targets for "constant_folding", "function_optimization_registry", and "graph_optimizer".
PiperOrigin-RevId: 308651243
Change-Id: Iac59c1db4ebdd16609f89d6caee6b7e6ba7ff0a1
This commit contains:
1. the C API headers (under tf/c/experimental/saved_model/public),
2. the C -> C++ implementation glue code (under tf/c/experimental/saved_model/internal)
3. the C++ implementation (under tf/c/experimental/saved_model/core)
The C++ implementation (3) is currently a stub.
Please note: The C++ header-only API wrapping the C API will be added in a subsequent change.
Certain aspects of this C API are expected to change heavily (mainly regarding ConcreteFunction execution).
PiperOrigin-RevId: 307419836
Change-Id: I6755fca97394d47c09799c534236ac17a30410d1