-
Notifications
You must be signed in to change notification settings - Fork 220
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
Add checks for completeness of msg_handler #388
Conversation
@xieyxclack Please help me check the |
federatedscope/core/fed_runner.py
Outdated
Returns: | ||
|
||
""" | ||
if self.cfg.check_completeness: |
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 don't think it is necessary to indent such a huge block of code
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.
Update accordingly.
f'check results in {fig_path}.') | ||
except Exception as error: | ||
logger.warning(f'Completeness check failed for {error}!') | ||
return |
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.
so the reason is that we cannot say yes or not about the correctness/completeness, right?
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.
As the document shows, the correctness/completeness checks only check the message-handler pairs and raise three types of logs (info, warning, and error). If something goes wrong with Python code, we'd better keep the exception stack as it is. So the return value is meaningless.
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.
LGTM
DO NOT merge this PR ahead of #365 . |
As that pr has been merged, please resolve the conflicts so that we can close this thread. |
Main changes
Add a check for completeness of msg_handler in workers. (Required
networkx
andmatplotlib
and I add them indev
mode)What's New in worker
A
classmethod
:get_msg_handler_dict
;A
self.msg_handlers_str
to store triplets <msg_in
,handler_name
,[msg_out0, msg_out1, ...]
>How to use:
Set
cfg.check_completeness=True
:What information will the user know:
If the checks are enabled, three types of info will show:
pass
,warning
,error
for the case:And a DiGraph will be plotted in
exp_dir
to remind users something might goes wrong:For pure FedAvg: