fix ddp logging test (#56640)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/56640
reset performance stats for current iteration, also fix ddp logging verifiction for sampled iterations.
ghstack-source-id: 127327708
Test Plan: unit tests
Reviewed By: SciPioneer
Differential Revision: D27923414
fbshipit-source-id: aaa1b10f64a0c952ba345c789c864bcef5cf1ab0