Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix: printing non-distributed data #1756

Merged
merged 6 commits into from
Jan 21, 2025

Conversation

ClaudiaComito
Copy link
Contributor

@ClaudiaComito ClaudiaComito commented Dec 30, 2024

Due Diligence

  • General:
  • Implementation:
    • unit tests: all split configurations tested
    • unit tests: multiple dtypes tested
    • benchmarks: created for new functionality does not apply
    • benchmarks: performance improved or maintained
    • documentation updated where needed

Description

I noticed that printing out moderately large DNDarrays in non-distributed mode (i.e. interactive session or split=None) takes a disproportionate amount of time (see below) compared to printing the underlying tensor. Culprit is the Formatter call.

I've changed the printing module to bypass Formatter if the input dndarray is not distributed. Torch takes care of the data formatting, tests pass.

Example:

data =  ht.random.randn(91392, 52, 4)
print(data)

On 1 process:
main branch: 84 seconds
this PR: 0.01 seconds

Issue/s resolved: #

Changes proposed:

  • let torch handle formatting of non-distributed data

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Memory requirements

NA

Performance

see above

Does this change modify the behaviour of other functions? If so, which?

no

@ClaudiaComito ClaudiaComito added the bug Something isn't working label Dec 30, 2024
@ClaudiaComito ClaudiaComito added this to the 1.5.1 milestone Dec 30, 2024
Copy link
Contributor

Thank you for the PR!

Copy link

codecov bot commented Dec 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.26%. Comparing base (4441f46) to head (1c94179).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1756   +/-   ##
=======================================
  Coverage   92.26%   92.26%           
=======================================
  Files          84       84           
  Lines       12445    12447    +2     
=======================================
+ Hits        11482    11484    +2     
  Misses        963      963           
Flag Coverage Δ
unit 92.26% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

Thank you for the PR!

Copy link
Collaborator

@mrfh92 mrfh92 left a comment

Choose a reason for hiding this comment

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

For me this looks fine and co-pilot agrees.
Thx 👍

Copy link
Contributor

Thank you for the PR!

@ClaudiaComito ClaudiaComito merged commit 3082dd9 into main Jan 21, 2025
10 checks passed
Copy link
Contributor

Successfully created backport PR for release/1.5.x:

github-actions bot pushed a commit that referenced this pull request Jan 21, 2025
* make 1-proc print great again

* fix tabs size

* skip formatter on non-distr data

* remove time import

(cherry picked from commit 3082dd9)
Copy link
Contributor

Backport failed for release: couldn't find remote ref release.
Please ensure that this Github repo has a branch named release.

ClaudiaComito added a commit that referenced this pull request Jan 21, 2025
* make 1-proc print great again

* fix tabs size

* skip formatter on non-distr data

* remove time import

(cherry picked from commit 3082dd9)

Co-authored-by: Claudia Comito <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants