nvflare.app_common.ccwf.common module

class Constant[source]

Bases: object

ACTION = 'cwf.action'
AGGREGATOR = 'cwf.aggr'
AGGR_CLIENTS = 'cwf.aggr_clients'
ALL_DONE = 'cwf.all_done'
BASENAME_ASK_FOR_MODEL = 'ask_for_model'
BASENAME_CONFIG = 'config'
BASENAME_EVAL = 'eval'
BASENAME_LEARN = 'learn'
BASENAME_REPORT_FINAL_RESULT = 'report_final_result'
BASENAME_REPORT_LEARN_RESULT = 'report_learn_result'
BASENAME_START = 'start'
CLIENT = 'cwf.client'
CLIENTS = 'cwf.clients'
CLIENT_ORDER = 'cwf.client_order'
CONFIG = 'cwf.config'
CONFIG_TASK_TIMEOUT = 300
END_WORKFLOW_TIMEOUT = 2.0
ERROR = 'cwf.error'
EVALUATEES = 'cwf.evaluatees'
EVALUATORS = 'cwf.evaluators'
EVAL_GLOBAL = 'cwf.eval_global'
EVAL_LOCAL = 'cwf.eval_local'
EXECUTOR = 'cwf.executor'
EXECUTOR_FINALIZED = 'cwf.executor_finalized'
EXECUTOR_INITIALIZED = 'cwf.executor_initialized'
FINAL_RESULT_ACK_TIMEOUT = 10
GET_MODEL_TIMEOUT = 10
GLOBAL_CLIENT = 'cwf.global_client'
GLOBAL_NAMES = 'cwf.global_names'
JOB_STATUS_CHECK_INTERVAL = 2.0
LAST_ROUND = 'cwf.last_round'
LEARN_TASK_ABORT_TIMEOUT = 5.0
LEARN_TASK_ACK_TIMEOUT = 10
LEARN_TASK_CHECK_INTERVAL = 1.0
MAX_TASK_TIMEOUT = 3600
METRIC = 'cwf.metric'
MODEL_NAME = 'cwf.model_name'
MODEL_OWNER = 'cwf.model_owner'
MODEL_TYPE = 'cwf.model_type'
ORDER = 'cwf.order'
PER_CLIENT_STATUS_REPORT_TIMEOUT = 90.0
PRIVATE_P2P = 'cwf.private_p2p'
PROP_KEY_TRAIN_CLIENTS = 'cwf.train_clients'
RC_NO_GLOBAL_MODELS = 'cwf.no_global_models'
RC_NO_LOCAL_MODEL = 'cwf.no_local_model'
RC_UNABLE_TO_EVAL = 'cwf.unable_to_eval'
RESULT = 'cwf.result'
RESULT_CLIENTS = 'cwf.result_clients'
RESULT_TYPE = 'cwf.result_type'
ROUND = 'cwf.round'
START_CLIENT = 'cwf.start_client'
START_ROUND = 'cwf.start_round'
START_TASK_TIMEOUT = 10
STATUS_REPORTS = 'cwf.status_reports'
TASK_CHECK_INTERVAL = 0.5
TASK_NAME_PREFIX = 'cwf.task_prefix'
TIMESTAMP = 'cwf.timestamp'
TN_PREFIX_CROSS_SITE_EVAL = 'cse'
TN_PREFIX_CYCLIC = 'cyclic'
TN_PREFIX_SWARM = 'swarm'
TOPIC_END_WORKFLOW = 'cwf.end_wf'
TOPIC_SHARE_RESULT = 'cwf.share_result'
TRAIN_CLIENTS = 'cwf.train_clients'
WORKFLOW_PROGRESS_TIMEOUT = 3600.0
class CyclicOrder[source]

Bases: object

FIXED = 'fixed'
RANDOM = 'random'
class ModelType[source]

Bases: object

GLOBAL = 'global'
LOCAL = 'local'
class NumberMetricComparator[source]

Bases: MetricComparator

compare(a, b) int | float[source]

Compare two metric values. Metric values do not have to be numbers.

Parameters:
  • a – first metric value

  • b – second metric value

Returns: negative number if a < b; 0 if a == b; positive number if a > b.

class ResultType[source]

Bases: object

BEST = 'best'
LAST = 'last'
class StatusReport(timestamp=None, action: str = '', last_round=None, all_done=False, error: str = '')[source]

Bases: object

to_dict() dict[source]
make_task_name(prefix: str, base_name: str) str[source]
rotate_to_front(item, items: list)[source]
status_report_from_dict(d: dict) StatusReport[source]
topic_for_end_workflow(wf_id)[source]