| Commit message (Collapse) | Author | Age |
... | |
|
|
|
|
|
|
|
|
|
| |
conversions.
That is, instances of sp.ToString() are replaced with string(sp).
This will allow tensorflow::StringPiece::ToString to be removed, which is necessary before it can be replaced with absl::string_view.
PiperOrigin-RevId: 210394878
|
|
|
|
| |
PiperOrigin-RevId: 210368536
|
|\
| |
| |
| | |
PiperOrigin-RevId: 210184219
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This basically exposes the GPU EventMgr::ThenExecute function to code
that can be compiled without explicitly depending on StreamExecutor and
similar. It allows some corner cases in GPU memory use to be handled in
code that is not just GPU-specific.
PiperOrigin-RevId: 210010480
|
| |
| |
| |
| | |
PiperOrigin-RevId: 209679086
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, a function instantiation error (e.g. in `Dataset.map()`) would lead
to an error in each GetNext() call that attempted to use the function. Moving this
to iterator instantiation time has the benefit that the error will be reported
once when the initialization op is executed, which has a more helpful stack
trace, since it should not be conflated with other potential op failures.
PiperOrigin-RevId: 209633511
|
| |
| |
| |
| | |
PiperOrigin-RevId: 209606318
|
| |
| |
| |
| | |
PiperOrigin-RevId: 209411916
|
| |
| |
| |
| |
| |
| |
| |
| | |
references.
This method is currently duplicated in Python code and will be used for TypeScript generation.
PiperOrigin-RevId: 209207139
|
| |
| |
| |
| |
| |
| |
| |
| | |
This will enable switching out the default stats collection mechanism
(based on strings and protocol buffers) for a lighter-weight
implementation that can be used in other settings.
PiperOrigin-RevId: 208851452
|
| |
| |
| |
| | |
PiperOrigin-RevId: 208600876
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- replacing `OpKernelContext` with newly introduced `DatasetContext` in `DatasetBase` constructor to make it possible to instantiate `DatasetBase` in places where an instance of `OpKernelContext` is not available
- replacing `dataset::MakeIteratorContext(OpKernelContext* ctx)` factory with `IteratorContext(OpKernelContext *ctx)` constructor.
- folding `GraphDatasetBase` into `DataseBase` and removing the default implementation of `AsGraphDefInternal`, making it the responsibility of the derived class to implement it to encourage/hint developers to provide serialization logic
PiperOrigin-RevId: 208560010
|
| |
| |
| |
| |
| |
| |
| |
| | |
This CL:
- changes the `OptimizeDataset` checkpointing logic to checkpoint the optimized dataset (as opposed to the original dataset + the optimizations, re-running optimization every time a checkpoint is restored)
- replaces `OpKernelContext` with newly introduced `SerializationContext` in the signature of `AsGraphDefInternal` to reduce the scope of the context and also simplify the logic for overriding the `FunctionLibraryDefinition` when optimizations take place
PiperOrigin-RevId: 208282562
|
| |
| |
| |
| |
| |
| | |
Renaming `AddParentDataset`, `SaveParent`, and `RestoreParent` to `AddInputDataset`, `SaveInput`, and `RestoreInput`.
PiperOrigin-RevId: 208272695
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The eager runtime mutates the FunctionLibraryRuntime's FunctionLibraryDefinition, which is shared across threads; at the same time, OpKernels might read the FunctionLibraryDefinition. This is not thread-safe unless FunctionLibraryDefinition is thread-safe.
This change makes FunctionLibraryDefinition, which is basically a map from function names to FunctionDefs, thread-safe. This is almost entirely accomplished by guarding the map with a mutex. There is however one complication: Find and RemoveFunction cannot be made thread-safe in a straightforward way (Find returns a raw pointer to a FunctionDef while Remove can delete the corresponding FunctionDef). In light of the fact that clients only ever call RemoveFunction when they in fact want to replace an existing function with a new one, we make the following modifications to FunctionLibraryDefinition's API:
1. A Contains method is added to check for the existence of a function.
2. A ReplaceFunction method is added.
3. RemoveFunction and RemoveGradient are made private.
We also update clients of the FunctionLibraryDefinition to use Contains & ReplaceFunction instead of Find and RemoveFunction.
PiperOrigin-RevId: 208271076
|
|\ \
| | |
| | |
| | | |
PiperOrigin-RevId: 208133320
|
|\ \ \
| | | |
| | | |
| | | | |
PiperOrigin-RevId: 207988541
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
bunch of dataset / iterator kernel registrations for XLA.
PiperOrigin-RevId: 207802858
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This patch introduces MapAndFilterFusion optimization, e.g:
map(map_fun).filter(filter_fun)
It moves computation of filter_fun to the map_fun, which returns the computed element and computed predicate. Filter is replaced with FilterByLastComponentDataset, which
filters by the boolean, resulting in:
map(fused_fun).FilterByLastComponent()
where:
fused_fun(x):
r = map_function(x)
return (r, filter_fun(r))
The micro benchmark shows around 68% improvement (chain of 50 map-filter)
PiperOrigin-RevId: 207624667
|
| | | |
| | | |
| | | |
| | | | |
PiperOrigin-RevId: 207490563
|
| | | |
| | | |
| | | |
| | | | |
PiperOrigin-RevId: 207284323
|
| | | |
| | | |
| | | |
| | | | |
PiperOrigin-RevId: 206973087
|
| | | |
| | | |
| | | |
| | | | |
PiperOrigin-RevId: 206938428
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This change will enable the definition of specialized datasets that map a C++ function across their inputs. In addition, this change refactors the `DatasetIterator<DatasetType>` template class to create a non-templated base class that contains the non-`DatasetType`-specific portions of the class.
PiperOrigin-RevId: 206869786
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
to the data type, add test cases, and put Intel's changes from pull request #20196 back. (ExpectClose wouldn't compile without DT_HALF support.)
#20196
PiperOrigin-RevId: 206795382
|
| |_|/
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
If OP_REQUIRES or OP_REQUIRES_OK are used in an override of AsyncOpKernel::ComputeAsync() and the condition does not hold, the process will deadlock because the `done` callback is never called. This change raises a fatal error with an actionable error message in this case.
PiperOrigin-RevId: 206373312
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The format used is as follows:
{{node <node_name>}}
PiperOrigin-RevId: 206370355
|
| | |
| | |
| | |
| | |
| | |
| | | |
MutableGraphView was implemented so that the view could be updated when new nodes are added or connections changed. The current passes do not require it only because they do not do any optimization on already optimized nodes, but optimizations like MapFusion require it.
PiperOrigin-RevId: 206046420
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
decide
whether bfloat16 casts should use truncation or rounding.
This is a preparatory change before we switch the default float ==> bfloat16 cast
to use rounding instead of truncation. The attribute added can then be specified
on casts that rely on the truncation, e.g., the TensorFlow send/receive operations.
It later emerged that the choice of doing truncation is useful more generally.
Therefore, this change allows the new attribute to be used by all relevant casts
to use truncation instead of rounding.
PiperOrigin-RevId: 205996367
|
|\ \ \
| | | |
| | | |
| | | | |
PiperOrigin-RevId: 205881436
|
| |/ /
|/| | |
|
| | |
| | |
| | |
| | | |
PiperOrigin-RevId: 205732423
|
| | |
| | |
| | |
| | |
| | |
| | | |
Because this file is included in lots of places, this generates a large number of warnings during compilation.
PiperOrigin-RevId: 205673744
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
GetFilteredRegisteredKernels makes it easier for users to query at runtime which kernels are available which match some predicate. The most common usage will be querying which kernels are available for a given op, so we add the specialized GetRegisteredKernelsForOp.
This is part of the work to make available kernels possible to query, to support Swift For TensorFlow. There are also a number of github issues asking for the functionality.
I will add C API and Python API support in upcoming changes.
PiperOrigin-RevId: 205656251
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
in preparation for using NUMA node specific allocators.
Also, add stub NUMA functions on the platform interface to
platform/windows/port.cc.
PiperOrigin-RevId: 205413998
|
| | |
| | |
| | |
| | |
| | |
| | | |
TF_CALL_INTEGRAL_TYPES.
PiperOrigin-RevId: 205165086
|
| | |
| | |
| | |
| | | |
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
|
| | |
| | |
| | |
| | | |
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
|
| | |
| | |
| | |
| | | |
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
|
| | |
| | |
| | |
| | | |
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
|
| | |
| | |
| | |
| | | |
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| | |
This fix fixes the issue raised in 20751
where tf.Print may miss `...` at the end with `summarize`.
This fix fixes 20751
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
It seems to me that OpKernelContext::is_output_dead is not necessary.
We only set it for Recv nodes and in those cases the output tensor is
unset as well.
PiperOrigin-RevId: 204325763
|
| |
| |
| |
| | |
PiperOrigin-RevId: 203871388
|
| |
| |
| |
| |
| |
| | |
The current `OpKernelContext` constructor unconditionally makes a virtual call to get an allocator that is only used when the kernel is running on a GPU device. Since we can tell if this is necessary after the call to `params_->ensure_eigen_gpu_device()`, we can avoid the call, plus the virtual call to `ReinitializeGpuDevice()`, when we know that it is not a GPU device.
PiperOrigin-RevId: 203523500
|
| | |
|
|/
|
|
|
|
| |
ShapeHandle objects.
PiperOrigin-RevId: 203354718
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Modifies GraphModeFunction to emit PartitionedCall ops instead of Call ops
so that the created functions can execute across devices. This should strictly
increase the set of functions that tfe.defun can faithfully execute.
Previous to this change, functions executed through tfe.defun would ignore
device annotations and only run on a single device. It is not yet possible to execute
a function across multiple processes.
Specifically, this CL:
(1) Adds a stateful version of PartitionedCall,
(2) Modifies `defun` to emit PartitionedCall or StatefulPartitionedCall by default,
(3) Makes `tf.gradients` aware of the existence of `(Stateful)PartitionedCall`,
(4) Fixes bugs in PartitionedCallOp related to the placement of
resource-touching ops / which args and retvals are always on host memory, and
also removes the requirement for args/retvals to be passed through the host.
PiperOrigin-RevId: 203164388
|
|
|
|
| |
PiperOrigin-RevId: 203004822
|