-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement task_group filtering for FedEval #1226
base: develop
Are you sure you want to change the base?
Implement task_group filtering for FedEval #1226
Conversation
f1fcdcf
to
93248b8
Compare
93248b8
to
baeae12
Compare
d63c561
to
2331f75
Compare
ddaa348
to
858b2ce
Compare
5d77eb7
to
9ab44a0
Compare
d811ab5
to
1a0ef16
Compare
1a0ef16
to
af5de55
Compare
9aba086
to
e8ca274
Compare
193ddf7
to
d2b46f0
Compare
d2b46f0
to
57f5094
Compare
tests/openfl/component/assigner/test_random_grouped_assigner.py
Dismissed
Show dismissed
Hide dismissed
tests/openfl/component/assigner/test_random_grouped_assigner.py
Dismissed
Show dismissed
Hide dismissed
tests/openfl/component/assigner/test_random_grouped_assigner.py
Dismissed
Show dismissed
Hide dismissed
- update all the sub-classes that use task_groups to use the decorator - update fedeval sample workspace to use default assigner, tasks and aggregator - use of federated-evaluation/aggregator.yaml for FedEval specific workspace example to use round_number as 1 - removed assigner and tasks yaml from defaults/federated-evaluation, superseded by default assigner/tasks - added additional checks for assigner sub-classes that might not have task_groups - Addressing review comments - Updated existing test cases for Assigner sub-classes - Remove hard-coded setting in assigner for torch_cnn_mnist ws, refer to default as in other Workspaces - Use aggregator supplied --task_group to override the assinger selected_task_group - update existing test cases of aggregator cli - add test cases for the decorator - rebased 23-Jan.2 Signed-off-by: Shailesh Pant <shailesh.pant@intel.com>
57f5094
to
10b6993
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, @ishaileshpant, I think it's looking good at this stage!
I just have a couple of minor remaining comments:
# @pytest.mark.parametrize('round_number', range(ROUNDS_TO_TRAIN)) | ||
# def test_get_filtered_tasks_for_collaborator(assigner, task_groups, | ||
# authorized_cols, round_number): | ||
# """Test that assigner tasks correspond to task groups defined.""" | ||
# assigner.selected_task_group=task_groups[1]['name'] | ||
# assigner.define_task_assignments() | ||
# tasks = assigner.get_tasks_for_collaborator( | ||
# authorized_cols[0], round_number) | ||
# assert tasks == task_groups[1]['tasks'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this test disabled on purpose?
def test_default_task_group(assigner): | ||
"""Assert that by default learning task_group is assigned.""" | ||
assigner = Assigner(None,None,None) | ||
assert assigner.selected_task_group == 'learning' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For completeness, could you also add a unit test where assigner.selected_task_group == 'evaluation'
?
@task_group_filtering | ||
def define_task_assignments(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest renaming the decorator to @with_selected_task_groups
. This way the code "reads" almost like in English: "With the selected task groups, define the task assignments...". WDYT?
implement a new task_group filtering decorator in Assigner class
update all the sub-classes that use task_groups to use the decorator
update fedeval sample workspace to use default assigner, tasks and aggregator
use of federated-evaluation/aggregator.yaml for FedEval specific workspace example to use round_number as 1
removed assigner and tasks yaml from defaults/federated-evaluation, superseded by default assigner/tasks
Rebase 21-Jan-2025.2
added additional checks for assigner sub-classes that might not have task_groups
Addressing review comments
Updated existing test cases for Assigner sub-classes
Remove hard-coded setting in assigner for torch_cnn_mnist ws, refer to default as in other Workspaces
Use aggregator supplied --task_group to override the assinger selected_task_group
update existing test cases of aggregator cli
add test cases for the decorator
Signed-off-by: Shailesh Pant shailesh.pant@intel.com
Testcases for task_group_filtering decorator
Testing for all existing workspaces
we shouldn't be saving any new models if running in evaluation mode.
Change all workspaces to use new Assigner [Not needed as defaults ensure all workspace, by default use new assigner]