Skip to content

Commit

Permalink
Fix FedEVal changes as per documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Chaurasiya, Payal <[email protected]>
  • Loading branch information
payalcha committed Feb 27, 2025
1 parent e7a8adf commit 7b6d34f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
13 changes: 1 addition & 12 deletions tests/end_to_end/models/model_owner.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def certify_collaborator(self, collaborator_name, zip_name):
raise e
return True

def modify_plan(self, param_config, plan_path, eval_scope=False):
def modify_plan(self, param_config, plan_path):
"""
Modify the plan to train the model
Args:
Expand Down Expand Up @@ -153,17 +153,6 @@ def modify_plan(self, param_config, plan_path, eval_scope=False):
data["network"]["settings"]["require_client_auth"] = param_config.require_client_auth
data["network"]["settings"]["use_tls"] = param_config.use_tls

if eval_scope:
# Remove all existing task_groups and set num_rounds to 1
data["assigner"]["settings"]["task_groups"] = []
# Add new task_groups for evaluation scope with task as aggregated_model_validation
new_task_group = {
"name": "evaluation",
"percentage": 1.0,
"tasks": ["aggregated_model_validation"]
}
data["assigner"]["settings"]["task_groups"].append(new_task_group)
data["aggregator"]["settings"]["rounds_to_train"] = 1

with open(plan_file, "w+") as write_file:
yaml.dump(data, write_file)
Expand Down
1 change: 0 additions & 1 deletion tests/end_to_end/utils/federation_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,6 @@ def federation_env_setup_and_validate(request, eval_scope=False):

if eval_scope:
local_bind_path = f"{local_bind_path}_eval"
num_rounds = 1
log.info(f"Running evaluation for the model: {request.config.model_name}")

workspace_path = local_bind_path
Expand Down
3 changes: 1 addition & 2 deletions tests/end_to_end/utils/tr_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@ def common_workspace_creation(request, eval_scope=False):
"Setting up evaluation scope, update the plan for 1 round and initial "
"model to previous experiment best model"
)
param_config.num_rounds = 1
initial_model_path = request.config.best_model_path

model_owner.modify_plan(param_config, plan_path=plan_path, eval_scope=eval_scope)
model_owner.modify_plan(param_config, plan_path=plan_path)

if hasattr(request.config, 'straggler_policy') and request.config.straggler_policy:
model_owner.modify_straggler_policy(
Expand Down

0 comments on commit 7b6d34f

Please sign in to comment.