Skip to content

Commit b3e7785

Browse files
liufengdbtensorflower-gardener
authored andcommitted
Update the documentation of the composite tensorflow project
PiperOrigin-RevId: 344328755 Change-Id: Idf73e2eca38e23a7983a2517b4434d239e969134
1 parent c624153 commit b3e7785

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

tensorflow/compiler/mlir/tfr/README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ composition in the authoring language.
77

88
The set of standard TF ops is currently open. New ops are defined for special
99
purposes but it is hard to make them work end-to-end: The op
10-
needs to be handled separately by a several backends (tf2xla bridge, tflite
10+
needs to be handled separately by several backends (tf2xla bridge, tflite
1111
converter, CPU kernels, etc.). Writing shape functions and gradients for these
1212
ops is extremely difficult. `tf.function` makes some parts of the implementation
1313
simpler, but it introduces runtime overhead and it cannot easily be used to
@@ -110,10 +110,10 @@ def _my_op_c(ins):
110110
Utilities have been built to compile the Python composition functions down to
111111
the backend IR. The project also provides a set of graph optimization passes to
112112
expand the composite ops in the graph by using the input backend IR. These
113-
passes have been added to the TF [common runtime]
114-
(https://github.com/tensorflow/tensorflow/tree/master/tensorflow/core/common_runtime)
115-
for graph execution and [eager_runtime]
116-
(https://github.com/tensorflow/tensorflow/tree/master/tensorflow/core/common_runtime/eager)
113+
passes have been added to the TF
114+
[common runtime](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/common_runtime)
115+
for graph execution and
116+
[eager runtime](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/common_runtime/eager)
117117
for eager execution.
118118

119119
## Compiling Op Composition
@@ -140,7 +140,7 @@ gen_op_libraries(
140140
```
141141

142142
More composite op definitions and usages are here included in the
143-
[examples](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/compiler/mlir/tfr/examples)
143+
[examples](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/mlir/tfr/examples)
144144
directory.
145145

146146
### Just-In-Time (JIT) mode
@@ -151,6 +151,12 @@ directory.
151151
* `while` statement
152152
* condition of `if` statement couldn't be a tensor
153153

154+
## RFC
155+
This project is an alternative implementaion of [RFC:Standardizing composite ops in tensorflow to support efficient inference](https://github.com/tensorflow/community/blob/master/rfcs/20190610-standardizing-composite_ops.md).
156+
This project doesn't rely on the tracing functionality provided by `tf.function`
157+
to avoid all its pitfalls and it helps to build more general transformations in
158+
the backends.
159+
154160
## Team
155161

156162
* Feng Liu

tensorflow/python/eager/def_function.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,9 @@ def function(func=None,
15311531
This can either be specified as just the string name of the function or
15321532
a NameAttrList corresponding to a list of key-value attributes associated
15331533
with the function name. The name of the function will be in the 'name'
1534-
field of the NameAttrList.
1534+
field of the NameAttrList. To define a formal TF op for this function
1535+
implements, try the experimental [composite TF](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/mlir/tfr)
1536+
project.
15351537
experimental_autograph_options: Optional tuple of
15361538
`tf.autograph.experimental.Feature` values.
15371539
experimental_relax_shapes: When True, `tf.function` may generate fewer,

0 commit comments

Comments
 (0)