Op documentation update.
update of g3doc/tf_ops.md update of g3doc/includes/tf_passes.md PiperOrigin-RevId: 350751493 Change-Id: I5ac05779c4ab944dde241e9d25991c47d42092fd
This commit is contained in:
parent
aeef5bba09
commit
97ba838a81
@ -1,4 +1,44 @@
|
||||
<!-- Autogenerated by mlir-tblgen; don't manually edit -->
|
||||
### `-cluster-ops-by-policy`: Clusters ops according to specified policy.
|
||||
This pass clusters ops according to the policy specified by the pass options.
|
||||
Clustered ops are moved to a tf_device::clusterOp region.
|
||||
|
||||
The only currently supported option is 'oplist=<list of ops>'. This option
|
||||
specifies the names of the ops that should be clustered if they form
|
||||
a single use def-use chain, that is, the next op in the list uses the result
|
||||
of the previous op and is the only user of that result. The ops should
|
||||
be located in the same block, be assigned to the same device and have no
|
||||
side effects.
|
||||
|
||||
For example, running this pass with option oplist="tf.Cast, tf.Add" on:
|
||||
|
||||
```mlir
|
||||
func @cluster_oplist(%arg0 : tensor<f32>, %arg1 : tensor<i32>) -> tensor<i32> {
|
||||
%0 = "tf.Cast"(%arg0) : (tensor<f32>) -> tensor<i32>
|
||||
%1 = "SomeOp" (%arg1) : (tensor<i32>) -> tensor<i32>
|
||||
%2 = "tf.Add"(%0, %1) : (tensor<i32>, tensor<i32>) -> tensor<i32>
|
||||
return %2 : tensor<i32>
|
||||
}
|
||||
```
|
||||
|
||||
will produce tf_device::opCluster enclosing tf.Add and tf.Neg:
|
||||
|
||||
```mlir
|
||||
func @cluster_oplist(%arg0: tensor<f32>, %arg1: tensor<i32>) -> tensor<i32> {
|
||||
%0 = "SomeOp"(%arg1) : (tensor<i32>) -> tensor<i32>
|
||||
%1 = "tf_device.cluster"() ( {
|
||||
%2 = "tf.Cast"(%arg0) : (tensor<f32>) -> tensor<i32>
|
||||
%3 = "tf.Add"(%2, %0) : (tensor<i32>, tensor<i32>) -> tensor<i32>
|
||||
tf_device.return %3 : tensor<i32>
|
||||
}) : () -> tensor<i32>
|
||||
return %1 : tensor<i32>
|
||||
}
|
||||
```
|
||||
|
||||
#### Options
|
||||
```
|
||||
-oplist : Cluster listed ops when they form a single use def-use chain, such that each op's single user is the next op in the list.
|
||||
```
|
||||
### `-tf-device-cluster-outlining`: Outlines regions of tf_device.cluster operations
|
||||
This pass outlines the body of a `tf_device.cluster` into a function and
|
||||
replaces the `tf_device.cluster` op with an equivalent `tf_device.cluster_func`
|
||||
|
Loading…
Reference in New Issue
Block a user