You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And he/she mentioned a very simple trick solution for this issue.
Truncate the input to a smaller datatype, this gives a starting point with a very small number of significand bits used
Then, cast to a larger data-type just before doing the computations that involve atomicAdd
He/She tried this and found fully deterministic (losses values, and evaluation results on COCO) upto tens of thousands of steps (using same code as in facebookresearch/detectron2#4260) for:
I also found that it can solve the deterministic issue in mmdet. The loss and mAP is exactly identical after I use this trick, and it doesn't affect the mAP (at least in my project).
I think it would be good to implement this trick in mmdet with a configuarable param to turn on/off it. We can do this in the roi extractor module, or in the ROIAlign layer of mmcv.
Any other context?
No response
The text was updated successfully, but these errors were encountered:
I just tried it in my own project (a model based on Faster RCNN).
I didn't test every model in mmdet with this trick yet. If you are going to implement and release this in mmdet, please test it first. (I don't have enough GPU to do that 😥)
What's the feature?
Deterministic issue in detection models.
We all know that it's hard to reproduce identical results for two runs in detection even we use the same radom seed and set
deterministic = True
.Recently, a issue in detectron2 mentioned that it is mainly caused by using
atomicAdd
in the backward pass. AndROIAlign
is the key module.facebookresearch/detectron2#4723
And he/she mentioned a very simple trick solution for this issue.
He/She tried this and found fully deterministic (losses values, and evaluation results on COCO) upto tens of thousands of steps (using same code as in facebookresearch/detectron2#4260) for:
I also tried this trick in
mmdet
by:changing
mmdetection/mmdet/models/roi_heads/roi_extractors/single_level_roi_extractor.py
Line 95 in 92d03df
to
I also found that it can solve the deterministic issue in mmdet. The loss and mAP is exactly identical after I use this trick, and it doesn't affect the mAP (at least in my project).
I think it would be good to implement this trick in
mmdet
with a configuarable param to turn on/off it. We can do this in the roi extractor module, or in the ROIAlign layer ofmmcv
.Any other context?
No response
The text was updated successfully, but these errors were encountered: