Skip to content

Commit 5925c35

Browse files
authored
[TF] Remove stale GPE documentation and diagnostics. (#24721)
* Remove `graph_op` instruction documentation from SIL.rst. * Remove all GPE-related diagnostics. * Remove stale info from the comment header of `CompilerRuntime.swift`.
1 parent eeea679 commit 5925c35

File tree

3 files changed

+1
-90
lines changed

3 files changed

+1
-90
lines changed

docs/SIL.rst

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5555,36 +5555,6 @@ Extracts the original function or an associated function from the given
55555555
``@differentiable`` function at a specific differentiation order. It must be
55565556
provided with an extractee: ``[original]``, ``[jvp]`` or ``[vjp]``.
55575557

5558-
.. SWIFT_ENABLE_TENSORFLOW
5559-
5560-
Graph Program Extraction
5561-
~~~~~~~~~~~~~~~~~~~~~~~~
5562-
5563-
graph_op
5564-
````````
5565-
::
5566-
5567-
sil-instruction ::= 'graph_op' string-literal
5568-
'(' (sil-operand (',' sil-operand)*)? ')'
5569-
('{' (sil-graph-op-attr (',' sil-graph-op-attr)*)? '}')?
5570-
':' sil-type (',' sil-type)*
5571-
sil-graph-op-attr ::= sil-identifier ':' sil-symbolic-value
5572-
sil-symbolic-value ::= i[0-9]+ int-literal |
5573-
f(32|64) float-literal |
5574-
sil-type |
5575-
'[' (sil-symbolic-value (',' sil-symbolic-value)*)? ']'
5576-
5577-
%add = graph_op "tf.Add"(%x : $Tensor<Float>, %y : $Tensor<Float>) \
5578-
{T: $Float} : $Tensor<Float>
5579-
5580-
Represents a graph program operation.
5581-
5582-
``graph_op`` instructions have a name, zero or more operands, zero or more
5583-
attributes (an identifier and SIL constant value), and one or more result
5584-
types.
5585-
5586-
This instruction is only valid in raw SIL and is rewritten and extracted by the
5587-
graph program extraction passes (debastraction, partitioning, graph lowering).
55885558

55895559
Assertion configuration
55905560
~~~~~~~~~~~~~~~~~~~~~~~

include/swift/AST/DiagnosticsSIL.def

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -248,52 +248,6 @@ NOTE(constexpr_called_from, none, "when called from here", ())
248248
NOTE(constexpr_not_evaluable, none,
249249
"expression not evaluable as constant here", ())
250250

251-
// SWIFT_ENABLE_TENSORFLOW
252-
// TensorFlow Support Diagnostics.
253-
ERROR(tf_internal_error, none,
254-
"internal error: %0", (StringRef))
255-
ERROR(tf_multiple_device, none,
256-
"device configuration specified multiple times", ())
257-
NOTE(tf_multiple_device_prev, none,
258-
"previous configuration is specified here", ())
259-
ERROR(tf_lowering_error, none,
260-
"internal error generating TensorFlow graph:\n%0", (StringRef))
261-
ERROR(tf_lowering_unknown_op, none,
262-
"op named '%0' is not registered in TensorFlow", (StringRef))
263-
ERROR(tf_convention_tf_host_code_not_allowed, none,
264-
"host code is not allowed in a TensorFlow function", ())
265-
ERROR(tf_no_captures_in_tf_functions, none,
266-
"TensorFlow functions cannot capture values", ())
267-
268-
WARNING(tf_value_implicitly_copied_to_accel, none,
269-
"%0 implicitly copied to the accelerator, use .toAccelerator() to make "
270-
"transfer explicit",
271-
(StringRef))
272-
WARNING(tf_value_implicitly_copied_to_accel_always, none,
273-
"%0 always cause a copy to the accelerator, use .toAccelerator() to make "
274-
"transfer explicit",
275-
(StringRef))
276-
277-
WARNING(tf_value_implicitly_copied_to_host, none,
278-
"value implicitly copied to the host, use .toHost() to make "
279-
"transfer explicit",
280-
())
281-
282-
NOTE(tf_value_used_here, none,
283-
"value used here", ())
284-
ERROR(tf_op_misuse, none,
285-
"%0", (StringRef))
286-
NOTE(tf_op_misuse_note, none,
287-
"%0", (StringRef))
288-
289-
ERROR(tf_op_result_generic,none,
290-
"cannot extract TensorFlow result into type %0, because %0 contains "
291-
"unbound generic parameters", (Type))
292-
ERROR(tf_op_result_not_value_or_aggregate,none,
293-
"cannot extract TensorFlow result into type %0, because %0 is not a "
294-
"TensorFlow value type or an aggregate of TensorFlow value types",
295-
(Type))
296-
297251
// Control flow diagnostics.
298252
ERROR(missing_return,none,
299253
"missing return in a %select{function|closure}1 expected to return %0",

stdlib/public/TensorFlow/CompilerRuntime.swift

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,9 @@
1515
// This file should only contain internal details: runtime-related public APIs
1616
// should be defined in `Execution.swift`.
1717
//
18-
// Design notes on TF eager based runtime:
19-
//
20-
// 1. A global context (`_ExecutionContext.global`) is used to manage all tensor
18+
// A global context (`_ExecutionContext.global`) is used to manage all tensor
2119
// computation and transfers.
2220
//
23-
// 2. When the tensor computation involves N device functions, run them in N
24-
// threads (but with the same execution/eager context). In addition, run the
25-
// host-side of sends/recvs in the main thread. These N + 1 threads form
26-
// "coroutines", and use sends/recvs mechanisms to communicate and unblock each
27-
// other's progress.
28-
// 2a) The sends/recvs mechanism between host and TF is the enqueue / dequeue
29-
// operations on TF (CPU-based) Fifo queues. Only tensor handles are transferred
30-
// in these enqueue / dequeue operations. For host to consume the content of the
31-
// tensor sent from TF, it uses TFE_TensorHandleResolve().
32-
// 2b) The sends/recvs mechanism between TF devices is the _Send / _Recv TF ops.
33-
//
3421
// Potential TODOs:
3522
// - Support async on platforms other than Linux and FreeBSD.
3623
// - Revisit the concurrency model and see if Dispatch can be built without

0 commit comments

Comments
 (0)