flip.nvflare.executors

FLIP Executors module containing NVFLARE executor wrappers.

These executors wrap user-provided training, validation, and evaluation logic.

Exports:
  • RUN_TRAINER: Wrapper executor for user’s FLIP_TRAINER class

  • RUN_VALIDATOR: Wrapper executor for user’s FLIP_VALIDATOR class

  • RUN_EVALUATOR: Wrapper executor for user’s FLIP_EVALUATOR class

Submodules

Classes

RUN_EVALUATOR

Executes the uploaded evaluator and handles any errors.

RUN_TRAINER

Wrapper executor that runs user-provided FLIP_TRAINER implementations.

RUN_VALIDATOR

Wrapper executor that runs user-provided FLIP_VALIDATOR implementations.

Package Contents

class flip.nvflare.executors.RUN_EVALUATOR(evaluate_task_name=PTConstants.EvalTaskName, project_id='', query='')

Bases: nvflare.apis.executor.Executor

Executes the uploaded evaluator and handles any errors.

_evaluate_task_name = 'evaluation'
_project_id = ''
_query = ''
_evaluator = None
execute(task_name: str, shareable: nvflare.apis.shareable.Shareable, fl_ctx: nvflare.apis.fl_context.FLContext, abort_signal: nvflare.apis.signal.Signal) nvflare.apis.shareable.Shareable
class flip.nvflare.executors.RUN_TRAINER(train_task_name=AppConstants.TASK_TRAIN, submit_model_task_name=AppConstants.TASK_SUBMIT_MODEL, exclude_vars=None, project_id='', query='')

Bases: nvflare.apis.executor.Executor

Wrapper executor that runs user-provided FLIP_TRAINER implementations.

This executor handles: - Dynamic importing of the user’s FLIP_TRAINER class - Error handling and exception logging - Lazy initialization of the trainer instance

_train_task_name
_submit_model_task_name
_exclude_vars = None
_project_id = ''
_query = ''
_flip_trainer = None
_epochs = None
execute(task_name: str, shareable: nvflare.apis.shareable.Shareable, fl_ctx: nvflare.apis.fl_context.FLContext, abort_signal: nvflare.apis.signal.Signal) nvflare.apis.shareable.Shareable

Execute the training task.

This method: 1. Lazily imports and initializes the user’s FLIP_TRAINER 2. Delegates execution to the user’s trainer 3. Catches and reports any exceptions

Parameters:
  • task_name – The name of the task to execute

  • shareable – The input shareable data

  • fl_ctx – The FL context

  • abort_signal – Signal for aborting the task

Returns:

The result of the training task

Return type:

Shareable

class flip.nvflare.executors.RUN_VALIDATOR(validate_task_name=AppConstants.TASK_VALIDATION, project_id='', query='')

Bases: nvflare.apis.executor.Executor

Wrapper executor that runs user-provided FLIP_VALIDATOR implementations.

This executor handles: - Dynamic importing of the user’s FLIP_VALIDATOR class - Error handling and exception logging - Lazy initialization of the validator instance

_validate_task_name
_project_id = ''
_query = ''
_validator = None
execute(task_name: str, shareable: nvflare.apis.shareable.Shareable, fl_ctx: nvflare.apis.fl_context.FLContext, abort_signal: nvflare.apis.signal.Signal) nvflare.apis.shareable.Shareable

Execute the validation task.

This method: 1. Lazily imports and initializes the user’s FLIP_VALIDATOR 2. Delegates execution to the user’s validator 3. Catches and reports any exceptions

Parameters:
  • task_name – The name of the task to execute

  • shareable – The input shareable data

  • fl_ctx – The FL context

  • abort_signal – Signal for aborting the task

Returns:

The result of the validation task

Return type:

Shareable