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

Binary operations: Support differing lshape-maps #880

Closed
ben-bou opened this issue Oct 8, 2021 · 1 comment · Fixed by #902
Closed

Binary operations: Support differing lshape-maps #880

ben-bou opened this issue Oct 8, 2021 · 1 comment · Fixed by #902
Assignees
Labels
redistribution Related to distributed tensors
Milestone

Comments

@ben-bou
Copy link
Collaborator

ben-bou commented Oct 8, 2021

Feature functionality
A clear and concise description of what the feature should do exactly and any alternative solutions.

Example:

a =  ht.ones(10, split=0)
b = ht.zeros(10, split=0)
c = a[ :-1 ] + b[ 1: ]

Globally, a[ :-1 ] and b[ 1: ] are compatible and the binop should compute. However, because they are differently distributed, it doesn't work. Because this cannot work without additional communication, maybe a warning should be given. A workaround I'm currently using is:

try:
  binop(op, arr1, arr2)
except:
  arr2.redistribute(arr1.lshape_map)
  result.larray = op(arr1.larray, arr2.larray)

(more details: https://github.com/ben-bou/heat/blob/redistribute/heat/core/_operations.py#L33 )

Additional context
Add any other context or screenshots about the feature request here.

This feature is important to ensure that scripts running with one process also run when using multiple processes.

@ben-bou ben-bou added this to To do in Earth System Modeling support via automation Oct 8, 2021
@ben-bou
Copy link
Collaborator Author

ben-bou commented Oct 11, 2021

Same for setitem if not already included

@ClaudiaComito ClaudiaComito self-assigned this Oct 27, 2021
@ClaudiaComito ClaudiaComito added the redistribution Related to distributed tensors label Oct 27, 2021
@ClaudiaComito ClaudiaComito added this to the 1.2.x milestone Oct 27, 2021
@ben-bou ben-bou mentioned this issue Jan 18, 2022
4 tasks
Earth System Modeling support automation moved this from To do to Done Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
redistribution Related to distributed tensors
2 participants