-
Notifications
You must be signed in to change notification settings - Fork 54
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
Features/681 balanced #687
Conversation
…min, argmax accordingly
…ze_lshape for dndarray.larray
…ce larray.setter instances from tests
Codecov Report
@@ Coverage Diff @@
## master #687 +/- ##
==========================================
+ Coverage 97.52% 97.54% +0.02%
==========================================
Files 87 87
Lines 17746 17698 -48
==========================================
- Hits 17306 17264 -42
+ Misses 440 434 -6
Continue to review full report at Codecov.
|
Why do we introduce this property?
|
Hi Markus, I forgot to link the original problem, I've added it now (#668). Let me know if I should expand more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me. i left a few questions in the code.
also, why did you change some of the test case to add an axis? where the other cases already covered? (i didnt look to deeply into this)
…rty default to None.
@ClaudiaComito I understand the issue now. However, shouldn't setitem and getitem force consistency in this case? Moreover, I am still maintaining that a purely informative check called |
Oh, I see what you mean re: Regarding setitem and getitem. My idea was to have |
Description
Issue/s resolved: #681 (see discussion in #668 )
Changes proposed:
New dndarray property
balanced
, can beTrue
orFalse
, orNone
if not enough info.balanced
is set internally within the factories and cannot be specified by the user. It is always set toTrue
except byht.array
whereis_split is not None
, in which case the balanced status will be assessed (adds one more communication step toht.array()
, but eliminates the need for possibly repeatedis_balanced()
checks later).the dndarray method
is_balanced
now returnsself.balanced
, unlessself.balanced is None
, in which case it will perform the check as usual and set thebalanced
property.One major problem is our extended use of the construct
x.larray = new_local_torch_x
in code and tests. Very oftennew_local_torch_x.shape != x.larray.shape
and results into a mess, among other things invalidating thebalanced
information. I've introduced the following changes:dndarray.larray.setter
. To me it's still too lax. If not called from all processes, it will produce an imbalanced dndarray with inhomogeneous balanced status.ht.array(new_local_torch_x, is_split=...)
(notablyconcatenate
,argmin
andargmax
)__reduce_op
to return the correctargmax
/argmin
result directlyI've also expanded the sanitation module with
sanitize_in_tensor
(verify that input is torch.Tensor),sanitize_lshape
(for larray.setter, see above), and I've modifiedconstants.sanitize_infinity
to use torch.finfo/iinfo and moved it tosanitation.sanitize_infinity
.Type of change
Due Diligence
Does this change modify the behaviour of other functions? If so, which?
no