Skip to content

Conversation

@alexk101
Copy link
Contributor

@alexk101 alexk101 commented Jul 1, 2025

These changes add

  • ability to return communication logs as dictionaries, rather than only printing to stdout
  • convenience helper functions for getting information about current logs
  • ability to clear existing log operations
  • additional documentation for logging operations

These address points made in #7403

alexk101 and others added 8 commits June 27, 2025 16:03
In `comms_logging.py`, when calling log_all and the `show_straggler` option is enabled, an all_reduce is performed across all nodes to calculate the minimum latency to find stragglers.
However, the tensors on which this is performed are not sent to the configured devices. This commit adds this capability using deepspeed's abstract accelerator api.

Signed-off-by: Alex Kiefer <[email protected]>
The current implementation of the communication logging api is somewhat limited in its ability to get in depth information about model operations.
For example, currently the log is only able to print to stdout, though the information about communications may be useful to have in its raw form,
(ie logging to wandb or tensorboard during training). The logs are also cumulative due it being a global variable. If, for example, we would like
to get information about each specific epoch/iteration, we could not easily do this.

This commit adds the following features
- ability to return communication logs as dictionaries, rather than only printing to stdout
- convenience helper functions for getting information about current logs
- ability to clear existing log operations
- additional documentation for logging operations

Signed-off-by: Alex Kiefer <[email protected]>

summary[msg_size] = {
"count": count,
"total_latency_ms": total_lat,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To improve usability (avoid typo issues), it would help to convert this hardcoded constants to enums?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you referencing the second parameters passed to trim_mean ? I am not sure which hardcoded constants you are referencing here.

Copy link
Collaborator

@sfc-gh-truwase sfc-gh-truwase Jul 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am referring to constants such as "count", "total_latency_ms", and "avg_straggler_ms". These are used multiple times and prone to typo errors.

@sfc-gh-truwase sfc-gh-truwase merged commit f485e13 into deepspeedai:master Jul 9, 2025
9 checks passed
lpnpcs pushed a commit to lpnpcs/DeepSpeed that referenced this pull request Jul 30, 2025
These changes add
- ability to return communication logs as dictionaries, rather than only
printing to stdout
- convenience helper functions for getting information about current
logs
- ability to clear existing log operations
- additional documentation for logging operations

These address points made in deepspeedai#7403

---------

Signed-off-by: Alex Kiefer <[email protected]>
Co-authored-by: Masahiro Tanaka <[email protected]>
Co-authored-by: Olatunji Ruwase <[email protected]>
Co-authored-by: Hongwei Chen <[email protected]>
Co-authored-by: Logan Adams <[email protected]>
LYMDLUT pushed a commit to LYMDLUT/DeepSpeed that referenced this pull request Aug 20, 2025
These changes add
- ability to return communication logs as dictionaries, rather than only
printing to stdout
- convenience helper functions for getting information about current
logs
- ability to clear existing log operations
- additional documentation for logging operations

These address points made in deepspeedai#7403

---------

Signed-off-by: Alex Kiefer <[email protected]>
Co-authored-by: Masahiro Tanaka <[email protected]>
Co-authored-by: Olatunji Ruwase <[email protected]>
Co-authored-by: Hongwei Chen <[email protected]>
Co-authored-by: Logan Adams <[email protected]>
Signed-off-by: lym <[email protected]>
mauryaavinash95 pushed a commit to DataStates/DeepSpeed that referenced this pull request Oct 4, 2025
These changes add
- ability to return communication logs as dictionaries, rather than only
printing to stdout
- convenience helper functions for getting information about current
logs
- ability to clear existing log operations
- additional documentation for logging operations

These address points made in deepspeedai#7403

---------

Signed-off-by: Alex Kiefer <[email protected]>
Co-authored-by: Masahiro Tanaka <[email protected]>
Co-authored-by: Olatunji Ruwase <[email protected]>
Co-authored-by: Hongwei Chen <[email protected]>
Co-authored-by: Logan Adams <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants