-
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
Interface for DPPY interoperability #788
Conversation
… -> __partitioned__
Codecov Report
@@ Coverage Diff @@
## main #788 +/- ##
=======================================
Coverage 91.80% 91.80%
=======================================
Files 72 72
Lines 10445 10519 +74
=======================================
+ Hits 9589 9657 +68
- Misses 856 862 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
rerun tests |
Cool, this looks good. The latest spec asks for a 'get' field in the outer I added your code (slightly modified) to my controller/worker wrapper prototype (#823). It has similar restrictions but allows calling |
Im not seeing the changes that you made when you moved the create partition interface function over. as for the |
Yes, except of course that its The idea here is that - in particular for frameworks like ray and dask - 'data' might (should) not be raw data but a handle/future. Having a unified way of converting the handle into raw data without explicitly understanding/using the ray/dask/... make this more useful. |
ive implemented that now. i tested it with a small example: x = ht.arange(8* 3* 2).reshape((8, 3, 2)).resplit(0)
print(x.__partitioned__['get']((0, 0, 0)))
|
heat/core/dndarray.py
Outdated
@@ -705,6 +704,12 @@ def create_partition_interface(self): | |||
"partitions": partitions, | |||
"locals": [tuple(lcls)], | |||
} | |||
|
|||
def _partition_getter(key): | |||
return partition_dict["partitions"][key]["data"] |
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.
The idea was to accept whatever is located in partition_dict["partitions"][key]["data"]
.
A user would use it like this pdict['get'](pdict['partitions"][key]["data"]
.
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.
here, it's really lambda x: x
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.
ah! i was thinking one level of abstraction more than that.
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.
now this is what the snippet would look like:
x = ht.arange(8* 3* 2).reshape((8, 3, 2)).resplit(0)
print(x.__partitioned__['get'](x.__partitioned__['partitions'][(0,0,0)]['data']))
So far this is addressing the producer side. We'd also need the consumer side. |
adding from_partitioned; aligning __partitioned__ with current spec
…, added factory function for building a dndarry from a partition dictionary
@fschlimb I have added a bit more functionality to |
FYI: A new discussion was initiated with the data-API consortium: data-apis/consortium-feedback#7 |
heat/core/factories.py
Outdated
expected = { | ||
int(x["location"][0]): ( | ||
comm.chunk(gshape, split, x["location"][0])[1:], | ||
(x["shape"], x["start"]), | ||
) | ||
for x in parts.values() | ||
} | ||
if split is not None and \ |
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.
Is this assertion not true?
👇 Click on the image for a new way to code review
Legend |
@fschlimb @coquelin77 thanks again for all this work. What are the next steps here? |
I guess there are 2 options:
|
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.
Made a small change here to ensure self.__partitions_dict__
is None after the latest dndarray
changes. I'm going to approve and merge, @coquelin77 @fschlimb apologies for the delay.
@fschlimb just out of curiosity, with the changes introduced here would it be possible to run these benchmarks with Heat as a backend, or is there more work required there?
Description
implement the
__partitioned__
attribute to the DNDarray for compatibility with daal4py (IntelPython/DPPY-Spec#3). At the moment, this is not used by heat internally. However, There are some ideas about how this could be done in the future.Issue/s resolved: #772
Changes proposed:
__partitioned__
attribute to DNDarrayType of change
Due Diligence
Does this change modify the behaviour of other functions? If so, which?
no