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

Indexing not Stable #703

Open
Inzlinger opened this issue Dec 7, 2020 · 5 comments
Open

Indexing not Stable #703

Inzlinger opened this issue Dec 7, 2020 · 5 comments
Assignees
Labels
bug Something isn't working indexing
Milestone

Comments

@Inzlinger
Copy link
Collaborator

Description
When using indices to acces array elements the order in the result is not stable for different splits.

To Reproduce

import heat as ht

a = ht.array([0,1], split = 0)

indices = ht.array([0, 1, 0, 1], split=0)

b = a[indices]
b.balance_()

print(b._DNDarray__array)

print(b)

With 1 process this gives [0, 1, 0, 1] as expected
Run this with n=2 and it changes the order to [0, 0, 1, 1].

Expected behavior
The same ordering in the result for all splits.

@Inzlinger Inzlinger added the bug Something isn't working label Dec 7, 2020
@ClaudiaComito ClaudiaComito self-assigned this Dec 7, 2020
@ClaudiaComito
Copy link
Contributor

ClaudiaComito commented Dec 7, 2020

Thanks @Inzlinger , I'm looking into getitem for other reasons (including #656) so I'll check this out as well if @coquelin77 agrees.

@coquelin77
Copy link
Member

i am pretty sure that this is caused by the assumption if the index is a split DNDarray, it is assumed to be non-repeating. when the indices are gathered they are then sorted. this is to determine which process has the requisite data. this could also be done with a mask on the index instead. then the local key which is generated would use this mask based on where the mask == the local rank number. or something along these lines.

@ClaudiaComito I have no objections to you looking into this one. i dont think that I will get to this for a little while otherwise. when i have more time available i will look at this again.

This was referenced Apr 17, 2021
@ClaudiaComito
Copy link
Contributor

ClaudiaComito commented May 17, 2021

@Inzlinger solving this issues requires communication, i.e. a distributed getitem (more like a get_distributed_item?). This would be needed and awesome and is on our list. If you want to start, you're very welcome! If you want we can organize a chat about how to proceed.

@ClaudiaComito
Copy link
Contributor

ClaudiaComito commented Aug 21, 2023

Working on it in #938


Reviewed within #1109

@ClaudiaComito ClaudiaComito removed their assignment Oct 9, 2023
Copy link
Contributor

Branch bugs/703-Indexing_not_Stable created!

@ClaudiaComito ClaudiaComito modified the milestones: 1.4.0, 1.5.0 Apr 12, 2024
@ClaudiaComito ClaudiaComito modified the milestones: 1.5.0, 1.6 Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working indexing
Projects
None yet
Development

No branches or pull requests

4 participants