DeepSpeed
10db6919 - Fix CommsLogger.stop_profiling_comms not disabling global profiling (#8137)

Commit
50 days ago
Fix CommsLogger.stop_profiling_comms not disabling global profiling (#8137) ## What `CommsLogger.stop_profiling_comms()` set `self.prof_all = True`, the same value `start_profiling_comms()` sets, so calling stop was a no-op: ```python def start_profiling_comms(self): self.prof_all = True def stop_profiling_comms(self): self.prof_all = True # should be False ``` `prof_all` is the flag that makes the comms logger profile every collective (`deepspeed/comm/comm.py` gates on `... or comms_logger.prof_all or ...`). Because stop set it back to `True`, once global comm profiling was started it could never be turned off. The sibling pair in the same class, `start_profiling_op` / `stop_profiling_op`, correctly adds then removes ops, which confirms the intended start=on / stop=off asymmetry. ## Fix Set `prof_all = False` in `stop_profiling_comms()`. ## Test Added `tests/unit/comm/test_comms_logger.py`, a CPU-only unit test that starts then stops comm profiling and asserts `prof_all` ends up `False`. It fails before the change (stays `True`) and passes after. --------- Signed-off-by: Vineeth Sai <vineethsai4444@gmail.com>
Author
Parents
Loading