|View source on GitHub|
Standardized representation of logic deployable to MapReduce-like systems.
tff.backends.mapreduce.MapReduceForm( initialize, prepare, work, zero, accumulate, merge, report, secure_sum_bitwidth, secure_sum_max_input, secure_modular_sum_modulus, update, server_state_label=None, client_data_label=None )
This class docstring describes the purpose of
MapReduceForm as a data
structure; for a discussion of the conceptual content of an instance
MapReduceForm, including how precisely it maps to a single federated round,
see the package-level docstring.
This standardized representation can be used to describe a range of iterative processes representable as a single round of MapReduce-like processing, and deployable to MapReduce-like systems that are only capable of executing plain TensorFlow code.
Non-iterative processes, or processes that do not originate at the server can
be described by
MapReduceForm, as well as degenerate cases like computations
which use exclusively one of the two possible aggregation paths.
Instances of this class can be generated by TFF's transformation pipeline and consumed by a variety of backends that have the ability to orchestrate their execution in a MapReduce-like fashion. The latter can include systems that run static data pipelines such Apache Beam or Hadoop, but also platforms like that which has been described in the following paper:
"Towards Federated Learning at Scale: System Design" https://arxiv.org/pdf/1902.01046.pdf
It should be noted that not every computation that proceeds in synchronous rounds is representable as an instance of this class. In particular, this representation is not suitable for computations that involve multiple phases of processing, and does not generalize to arbitrary static data pipelines. Generalized representations that can take advantage of the full expressiveness of Apache Beam-like systems may emerge at a later time, and will be supported by a separate set of tools, with a more expressive canonical representation.
The requirement that the variable constituents of the template be in the form
of pure TensorFlow code (not arbitrary TFF constructs) reflects the intent
for instances of this class to be easily converted into a representation that
can be compiled into a system that does not have the ability to interpret
the full TFF language (as defined in
computation.proto), but that does have
the ability to run TensorFlow. Client-side logic in such systems could be
deployed in a number of ways, e.g., as shards in a MapReduce job, to mobile or
embedded devices, etc.
The individual TensorFlow computations that constitute an iterative process
in this form are supplied as constructor arguments. Generally, this class will
not be instantiated by a programmer directly but targeted by a sequence of
transformations that take a
tff.templates.IterativeProcess and produce the
appropriate pieces of logic.
summary( print_fn=print )
Prints a string summary of the
||Print function to use. It will be called on each line of the summary in order to capture the string summary.|