Repository navigation
DeepSpeed Communication Profiling and Logging - #2012
Merged
Merged
Conversation
Co-authored-by: Quentin Anthony <[email protected]> Co-authored-by: Ammar Ahmad Awan <[email protected]> Co-authored-by: Jeff Rasley <[email protected]>
Quentin-Anthony
requested review from
RezaYazdaniAminabadi,
ShadenSmith,
awan-10,
cli99,
conglongli,
eltonzheng,
jeffra,
minjiaz,
samyam and
tjruwase
as code owners
June 13, 2022 22:11
Quentin-Anthony
commented
Jun 30, 2022
Quentin-Anthony
commented
Jun 30, 2022
Quentin-Anthony
commented
Jun 30, 2022
Quentin-Anthony
commented
Jun 30, 2022
Quentin-Anthony
commented
Jun 30, 2022
Quentin-Anthony
commented
Jun 30, 2022
Quentin-Anthony
commented
Jun 30, 2022
Quentin-Anthony
commented
Jun 30, 2022
Quentin-Anthony
left a comment
Contributor
Author
There was a problem hiding this comment.
This has been reviewed by Ammar
jeffra
reviewed
Jul 21, 2022
Contributor
Author
banxingmjj
pushed a commit
to openanolis/DeepSpeed
that referenced
this pull request
Oct 27, 2026
…gger.enabled (deepspeedai#8909) Fixes deepspeedai#8797. With comms logging on, every collective re-read the full history of its timer, so ZeRO-3 step time grew every step and each logged latency was the sum of all earlier calls. Separately, `"comms_logger": {"enabled": false}` turned logging on. ### Root causes 1. **Timer history is never cleared (regression from deepspeedai#7714, v0.18.3).** Logged latencies are cumulative, which changed the original intent. 2. **The section's `enabled` field is ignored (since deepspeedai#2012).** ### Changes **`deepspeed/utils/timer.py`** - `Timer` holds one start/stop event pair, created once and recorded again for each interval, plus a running total and count. It no longer keeps a list of every event pair. - `elapsed()` returns the latest start/stop interval. - New `elapsed_total()` returns the sum of all intervals since the last reset. - `mean()` returns the plain average since the last reset. It used to be a 10% trimmed mean over the stored records. - Each interval is measured once, when first needed: on a read or at the next `start()`. So `stop()` never waits for the device. - Reading a timer that is still running stops it, with no automatic restart. - `SynchronizedWallClockTimer.log()` prints `elapsed_total()`, so every existing log line is unchanged. - Cleanups: - Removed the now-unused `CudaEventTimer`. - Added `NoopTimer.elapsed_total()`. - `psutil` is imported only when `ThroughputTimer` monitors memory. **`deepspeed/comm/config.py`, `deepspeed/comm/comm.py`** - `comms_logger_enabled` now comes from the section's `enabled` field. A missing section is parsed with its defaults, the same way the `compile` section is. - Inlined `_configure_using_config_file` into `deepspeed.comm.configure()`. - Removed an outdated comment ("'elapsed' resets events") and the unused `timer_summary` global. - Removed the `config` argument of `deepspeed.init_distributed()`; ### Related PRs - **deepspeedai#8798** (open, same issue) caps each timer's history at 1,024 records. That changes the shared timer contract: for example, pipeline iteration time under-reports when `steps_per_print` is above 1024. Logged latencies also stay cumulative, and steps stay much slower than without logging. This PR fixes the cause instead. Its config change addresses the same bug as deepspeedai#8798's. --------- Signed-off-by: Hongwei Chen <[email protected]>
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.
This PR implements logging for all DeepSpeed communication calls
This PR introduces the DeepSpeed Communication Logger
After this PR, all communication calls from #1985 are automatically detected and logged (depending on config options). A final summary is then printed. For example:
This PR contributes the following features:
log_summarymethod)all_gather_zero3)Co-authored-by: Quentin Anthony [email protected]
Co-authored-by: Ammar Ahmad Awan [email protected]
Co-authored-by: Jeff Rasley [email protected]