|
| 1 | +{ |
| 2 | + # version of the configuration |
| 3 | + format_version = 2 |
| 4 | + |
| 5 | + # task data filter: if filters are provided, the filter will filter the data flow out of server to client. |
| 6 | + task_data_filters =[] |
| 7 | + |
| 8 | + # task result filter: if filters are provided, the filter will filter the result flow out of client to server. |
| 9 | + task_result_filters = [] |
| 10 | + |
| 11 | + # This assumes that there will be a "net.py" file with class name "Net". |
| 12 | + # If your model code is not in "net.py" and class name is not "Net", please modify here |
| 13 | + model_class_path = "net.Net" |
| 14 | + |
| 15 | + # workflows: Array of workflows the control the Federated Learning workflow lifecycle. |
| 16 | + # One can specify multiple workflows. The NVFLARE will run them in the order specified. |
| 17 | + workflows = [ |
| 18 | + { |
| 19 | + # 1st workflow" |
| 20 | + id = "scatter_and_gather" |
| 21 | + |
| 22 | + # name = ScatterAndGather, path is the class path of the ScatterAndGather controller. |
| 23 | + path = "nvflare.app_common.workflows.scatter_and_gather.ScatterAndGather" |
| 24 | + args { |
| 25 | + # argument of the ScatterAndGather class. |
| 26 | + # min number of clients required for ScatterAndGather controller to move to the next round |
| 27 | + # during the workflow cycle. The controller will wait until the min_clients returned from clients |
| 28 | + # before move to the next step. |
| 29 | + min_clients = 2 |
| 30 | + |
| 31 | + # number of global round of the training. |
| 32 | + num_rounds = 2 |
| 33 | + |
| 34 | + # starting round is 0-based |
| 35 | + start_round = 0 |
| 36 | + |
| 37 | + # after received min number of clients' result, |
| 38 | + # how much time should we wait further before move to the next step |
| 39 | + wait_time_after_min_received = 0 |
| 40 | + |
| 41 | + # For ScatterAndGather, the server will aggregate the weights based on the client's result. |
| 42 | + # the aggregator component id is named here. One can use the this ID to find the corresponding |
| 43 | + # aggregator component listed below |
| 44 | + aggregator_id = "aggregator" |
| 45 | + |
| 46 | + # The Scatter and Gather controller use an persistor to load the model and save the model. |
| 47 | + # The persistent component can be identified by component ID specified here. |
| 48 | + persistor_id = "persistor" |
| 49 | + |
| 50 | + # Shareable to a communication message, i.e. shared between clients and server. |
| 51 | + # Shareable generator is a component that responsible to take the model convert to/from this communication message: Shareable. |
| 52 | + # The component can be identified via "shareable_generator_id" |
| 53 | + shareable_generator_id = "shareable_generator" |
| 54 | + |
| 55 | + # train task name: client side needs to have an executor that handles this task |
| 56 | + train_task_name = "train" |
| 57 | + |
| 58 | + # train timeout in second. If zero, meaning no timeout. |
| 59 | + train_timeout = 0 |
| 60 | + } |
| 61 | + } |
| 62 | + ] |
| 63 | + |
| 64 | + # List of components used in the server side workflow. |
| 65 | + components = [ |
| 66 | + { |
| 67 | + # This is the persistence component used in above workflow. |
| 68 | + # PTFileModelPersistor is a Pytorch persistor which save/read the model to/from file. |
| 69 | + |
| 70 | + id = "persistor" |
| 71 | + path = "nvflare.app_opt.pt.file_model_persistor.PTFileModelPersistor" |
| 72 | + |
| 73 | + # the persitor class take model class as argument |
| 74 | + # This imply that the model is initialized from the server-side. |
| 75 | + # The initialized model will be broadcast to all the clients to start the training. |
| 76 | + args { |
| 77 | + model { |
| 78 | + path = "{model_class_path}" |
| 79 | + } |
| 80 | + filter_id = "serialize_filter" |
| 81 | + } |
| 82 | + }, |
| 83 | + { |
| 84 | + id = "shareable_generator" |
| 85 | + path = "nvflare.app_opt.he.model_shareable_generator.HEModelShareableGenerator" |
| 86 | + args {} |
| 87 | + } |
| 88 | + { |
| 89 | + id = "aggregator" |
| 90 | + path = "nvflare.app_opt.he.intime_accumulate_model_aggregator.HEInTimeAccumulateWeightedAggregator" |
| 91 | + args { |
| 92 | + weigh_by_local_iter = false |
| 93 | + expected_data_kind = "WEIGHT_DIFF" |
| 94 | + } |
| 95 | + } |
| 96 | + { |
| 97 | + id = "serialize_filter" |
| 98 | + path = "nvflare.app_opt.he.model_serialize_filter.HEModelSerializeFilter" |
| 99 | + args { |
| 100 | + } |
| 101 | + } |
| 102 | + { |
| 103 | + # This component is not directly used in Workflow. |
| 104 | + # it select the best model based on the incoming global validation metrics. |
| 105 | + id = "model_selector" |
| 106 | + path = "nvflare.app_common.widgets.intime_model_selector.IntimeModelSelector" |
| 107 | + # need to make sure this "key_metric" match what server side received |
| 108 | + args.key_metric = "accuracy" |
| 109 | + }, |
| 110 | + { |
| 111 | + id = "receiver" |
| 112 | + path = "nvflare.app_opt.tracking.tb.tb_receiver.TBAnalyticsReceiver" |
| 113 | + args.events = ["fed.analytix_log_stats"] |
| 114 | + } |
| 115 | + ] |
| 116 | + |
| 117 | +} |
0 commit comments