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

Enhancement: Avoid unnecessary gathering of distributed operand #1216

Merged
merged 38 commits into from
Feb 5, 2024
Merged
Changes from 30 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
9d093b2
Avoid unnecessary gathering of distributed operand
samadpls Sep 8, 2023
7b7a19a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 8, 2023
f813311
updated a comment
samadpls Sep 8, 2023
bdf62df
refactored the logic
samadpls Sep 8, 2023
0e813f1
Merge branch 'main' into features/1064-optimize-logical-functions
samadpls Sep 13, 2023
d32ed27
Merge branch 'main' into features/1064-optimize-logical-functions
samadpls Sep 14, 2023
bde9d0e
updated the `__sanitize_close_input` method
samadpls Sep 14, 2023
4752d15
Merge branch 'main' into features/1064-optimize-logical-functions
ClaudiaComito Sep 25, 2023
58a5c1a
Merge branch 'main' into features/1064-optimize-logical-functions
ClaudiaComito Oct 9, 2023
367d25f
Merge branch 'main' into features/1064-optimize-logical-functions
samadpls Oct 12, 2023
0e80601
Optimized logical operations
samadpls Oct 12, 2023
b5bf608
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 12, 2023
12c67ec
fixed typo
samadpls Oct 12, 2023
e875bc6
fixed the merge conflict
samadpls Oct 12, 2023
0ebe1ce
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 12, 2023
e5dc121
removed blank line after docstring
samadpls Oct 13, 2023
ee0714d
Merge branch 'main' into features/1064-optimize-logical-functions
samadpls Oct 13, 2023
e8d45d4
Fixed distributed array handling for mixed scalar and array inputs
samadpls Oct 14, 2023
393b63a
Merge branch 'main' into features/1064-optimize-logical-functions
samadpls Oct 16, 2023
741f1a2
Merge branch 'main' into features/1064-optimize-logical-functions
samadpls Oct 19, 2023
0a4d2f2
Merge branch 'main' into features/1064-optimize-logical-functions
samadpls Oct 24, 2023
ae3f969
sliced the distributed array with `counts_dsipls()` method
samadpls Oct 24, 2023
43e77d8
Refactor slicing operation
samadpls Oct 25, 2023
a354d7a
Merge branch 'main' into features/1064-optimize-logical-functions
ClaudiaComito Oct 30, 2023
0b44849
Merge branch 'main' into features/1064-optimize-logical-functions
ClaudiaComito Dec 8, 2023
38f4314
Update heat/core/logical.py
samadpls Dec 8, 2023
aa555d5
addressed the unnecessary gathering of distributed operand
samadpls Dec 13, 2023
155968a
Merge branch 'main' into features/1064-optimize-logical-functions
samadpls Dec 13, 2023
52cb055
refactored the `logical.py` file
samadpls Dec 13, 2023
3d86a3b
Merge branch 'main' into features/1064-optimize-logical-functions
samadpls Dec 16, 2023
d0bf3f3
Update `heat/core/logical.py`
samadpls Dec 22, 2023
60fb1cd
Refactored the `__sanitize_close_input` method
samadpls Dec 22, 2023
2a4e226
Merge branch 'features/1064-optimize-logical-functions' of https://gi…
samadpls Dec 22, 2023
3d1fe15
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 22, 2023
abbe799
Merge branch 'main' into features/1064-optimize-logical-functions
ClaudiaComito Jan 8, 2024
1991a60
Merge branch 'main' into features/1064-optimize-logical-functions
mrfh92 Feb 5, 2024
3f1727f
Merge branch 'main' into features/1064-optimize-logical-functions
ClaudiaComito Feb 5, 2024
4a2b87b
Merge branch 'main' into features/1064-optimize-logical-functions
ClaudiaComito Feb 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions heat/core/logical.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from . import factories
from . import manipulations
from . import sanitation

from . import _operations
from . import stride_tricks
Expand Down Expand Up @@ -516,10 +517,11 @@ def sanitize_input_type(
x = sanitize_input_type(x, y)
y = sanitize_input_type(y, x)

# if one of the tensors is distributed, unsplit/gather it
if x.split is not None and y.split is None:
t1 = manipulations.resplit(x, axis=None)
return t1, y
# if one of the DNDarrays is distributed and the other is not
if x.split is not None and y.split is None and y.ndim > 0:
samadpls marked this conversation as resolved.
Show resolved Hide resolved
t2 = factories.array(y.larray, device=x.device, split=x.split)
x, t2 = sanitation.sanitize_distribution(x, t2, target=x)
return x, t2

Copy link
Contributor

Choose a reason for hiding this comment

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

We're missing the same check for y distributed, x non distributed I think. Otherwise we're good to go.

elif x.split != y.split:
t2 = manipulations.resplit(y, axis=x.split)
Expand Down
Loading