Fix CommsLogger.stop_profiling_comms not disabling global profiling#8137
Open
vineethsaivs wants to merge 1 commit into
Open
Fix CommsLogger.stop_profiling_comms not disabling global profiling#8137vineethsaivs wants to merge 1 commit into
vineethsaivs wants to merge 1 commit into
Conversation
start_profiling_comms() sets prof_all = True to profile every collective, but stop_profiling_comms() also set prof_all = True, so calling it was a no-op and global comm profiling could never be turned off once started. Set prof_all = False, mirroring the start/stop_profiling_op pair which correctly adds then removes ops. Signed-off-by: Vineeth Sai <vineethsai4444@gmail.com>
tohtana
requested changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
CommsLogger.stop_profiling_comms()setself.prof_all = True, the same valuestart_profiling_comms()sets, so calling stop was a no-op:prof_allis the flag that makes the comms logger profile every collective (deepspeed/comm/comm.pygates on... or comms_logger.prof_all or ...). Because stop set it back toTrue, 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 = Falseinstop_profiling_comms().Test
Added
tests/unit/comm/test_comms_logger.py, a CPU-only unit test that starts then stops comm profiling and assertsprof_allends upFalse. It fails before the change (staysTrue) and passes after.