The backends package contains backends which may extend the TFF compiler and/or the TFF runtime; these extensions can be found in the corresponding backend.
If the runtime of a backend is implemented as an execution stack, then the backend can construct an ExecutionContext to provide TFF with an environemnt in which to evaluate an AST. In this case, the backend is integrating with TFF using the high-level abstraction. However, if the runtime is not implemented as an execution stack, then the backend will need to construct a Context and is integrating with TFF using the low-level abstraction.
The blue nodes are provided by TFF core.
The dashed nodes are provided by an external system.
The solid arrows indicate relationship and the dashed arrows indicate inheritance.
The native backend composes of the TFF compiler and TFF runtime in order to compile and execute an AST in a way that is reasonably efficiant and debuggable.
A native form is an AST that is topologically sorted into a directed acyclic graph (DAG) of TFF intrinsics with some optimizations to the dependency of those intrinsics.
The native backend does not contain backend specific extentions to the TFF runtime, instead an execution stack can be used directly.
A native context is an ExecutionContext constructed with a native compiler (or no compiler) and a TFF runtime, for example:
executor = eager_tf_executor.EagerTFExecutor() factory = executor_factory.create_executor_factory(lambda _: executor) context = execution_context.ExecutionContext( executor_fn=factory, compiler_fn=None) set_default_context.set_default_context(context)
However, there are some common configurations:
The mapreduce backend contains the data structures and compiler required to construct a form that can be executed on MapReduce-like runtimes.
A canonical_form.CanonicalForm is a data structure defining the representation of logic that can be executed on MapReduce-like runtimes. This logic is organized as a collection of TensorFlow functions, see the canonical_form module for more information about the nature of these functions.
A MapReduce runtime is not provided by TFF, instead this should be provided by an external MapReduce-like system.
A MapReduce context is not provided by TFF.
The iree backend contains the data structures, compiler, and runtime required to execute an AST.
The executor.IreeExecutor is an Executor that executes computations by delegating to an IREE runtime. This executor can be composed with other Executors from the TFF runtime in order to construct an execution stack representing an IREE runtime.
that compiles and executes ASTs. Note that the
ReferenceContext does not
and the runtime is not implemented as an
execution stack; instead the compiler and
runtime are trivially implemented inline in the