Why gather
if the results isn't used?
#4395
Unanswered
jerome-white
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
detectron2/detectron2/engine/train_loop.py
Lines 335 to 337 in 453d795
In this snippet, gather is run before deciding whether processing should take place. The alternative to this if-statement is an implicit method return -- nothing explicitly takes place with
all_metrics_dict
if that statement fails. I've seen this convention in some of the evaluators as well. Is there some side effect ofcomm.gather
such that running it irrespective of being in the main process is required? Would the semantics of this method be the same if that statement was run inside the if-block? I've looked as deep as the PyTorch code that gets called, but things are still mysterious.I'm building my own evaluators that may run in a distributed environment, so understanding the nuances of this feels important.
Beta Was this translation helpful? Give feedback.
All reactions