![]() |
A strategy for composing federated types and intrinsics in disjoint scopes.
Inherits From: FederatingStrategy
tff.framework.FederatedComposingStrategy(
executor: tff.framework.FederatingExecutor
,
server_executor: tff.framework.Executor
,
target_executors: list[executor_base.Executor],
local_computation_factory: local_computation_factory_base.LocalComputationFactory = tensorflow_computation_factory.TensorFlowComputationFactory()
)
This strategy implements the FederatingStrategy
interface and provides
logic for handling federated types and federated intrinsics on an underlying
collection of target executors. This strategy can be used in hierarchical
aggregation structures with federating executors handling disjoint scopes at
the leafs.
This strategy only supports the placements:
Args | |
---|---|
executor
|
A federating_executor.FederatingExecutor to use to handle
unplaced types, computations, and processing.
|
server_executor
|
The parent executor to use for all processing at the parent, such as combining values from child executors, unplaced and server-side processing, etc. |
target_executors
|
The list of executors that manage disjoint scopes to combine in this executor, delegate to and collect or aggregate from. |
local_computation_factory
|
An instance of LocalComputationFactory to use
to construct local computations used as parameters in certain federated
operators (such as tff.federated_sum , etc.). Defaults to a TensorFlow
computation factory that generates TensorFlow code.
|
Raises | |
---|---|
TypeError
|
If server_executor is not an executor_base.Executor or if
target_executors is not a list of executor_base.Executor s.
|
Methods
close
close()
Release resources associated with this strategy, if any.
compute_federated_aggregate
compute_federated_aggregate(
arg
)
Returns an embedded call for a federated aggregate.
compute_federated_apply
compute_federated_apply(
arg
)
Returns an embedded call for a federated apply.
compute_federated_broadcast
compute_federated_broadcast(
arg
)
Returns an embedded call for a federated broadcast.
compute_federated_eval_at_clients
compute_federated_eval_at_clients(
arg
)
Returns an embedded call for a federated eval at clients.
compute_federated_eval_at_server
compute_federated_eval_at_server(
arg
)
Returns an embedded call for a federated eval at server.
compute_federated_intrinsic
compute_federated_intrinsic(
uri, arg=None
)
Returns an embedded call for a federated intrinsic.
Args | |
---|---|
uri
|
The URI of an intrinsic to embed. |
arg
|
An optional embedded argument of the call, or None if no argument
is supplied.
|
compute_federated_map
compute_federated_map(
arg
)
Returns an embedded call for a federated map.
compute_federated_map_all_equal
compute_federated_map_all_equal(
arg
)
Returns an embedded call for a federated map all equal.
compute_federated_mean
compute_federated_mean(
arg
)
Returns an embedded call for a federated mean.
compute_federated_secure_select
compute_federated_secure_select(
arg
)
Returns an embedded call for a federated secure select.
compute_federated_secure_sum_bitwidth
compute_federated_secure_sum_bitwidth(
arg
)
Returns an embedded call for a federated secure sum.
compute_federated_select
compute_federated_select(
arg
)
Returns an embedded call for a federated select.
compute_federated_sum
compute_federated_sum(
arg
)
Returns an embedded call for a federated sum.
compute_federated_value
compute_federated_value(
value, type_signature
)
Returns an embedded value for a federated type.
Args | |
---|---|
value
|
An object to embed in the executor. |
type_signature
|
A tff.Type , the type of value .
|
compute_federated_value_at_clients
compute_federated_value_at_clients(
arg
)
Returns an embedded call for a federated value at clients.
compute_federated_value_at_server
compute_federated_value_at_server(
arg
)
Returns an embedded call for a federated value at server.
compute_federated_weighted_mean
compute_federated_weighted_mean(
arg
)
Returns an embedded call for a federated weighted mean.
compute_federated_zip_at_clients
compute_federated_zip_at_clients(
arg
)
Returns an embedded call for a federated zip at clients.
compute_federated_zip_at_server
compute_federated_zip_at_server(
arg
)
Returns an embedded call for a federated zip at server.
factory
@classmethod
factory( server_executor:
tff.framework.Executor
, target_executors: list[executor_base.Executor], local_computation_factory: local_computation_factory_base.LocalComputationFactory = tensorflow_computation_factory.TensorFlowComputationFactory() )
ingest_value
ingest_value(
value: Any,
type_signature: tff.types.Type
) -> tff.framework.ExecutorValue