-
Notifications
You must be signed in to change notification settings - Fork 97
Add prototype support for an ak.apply function
#3963
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
Conversation
8a58f08 to
6df58b5
Compare
|
The CI failures appear unrelated to the contents of this PR |
e-kayrakli
left a comment
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.
@jabraham17 -- thanks for this PR. I left some comments.
@ajpotts -- I see that Jade has some questions for you in the PR, could you take a look?
Do you have an idea how to mitigate this? It sounds like the second time you cloudpickle a numpy function, it is not playing well with the server, is that correct? Could the server cache functions? Arguably, that will not prevent the client from resending them, but they can be ignored. Or ideally, client can maintain a state, in which the fact that a given function is cached by the server can be stored. |
Its not just the use of the same function, its about the use of a module in a function. This snippet replicates the issue import arkouda as ak
import numpy as np
ak.connect()
n = 100_000
arr = ak.randint(0, 10, n)
def foo(x):
np
return 2.0
res = ak.apply(arr, foo, "float64")
print(res)
def bar(x):
np
return 1.0
res = ak.apply(arr, bar, "float64")
print(res) |
|
I have tracked down the crash to an issue with numpy and multiple interpreters: numpy/numpy#28271. This error should not crash the server (only throw an exception), so there is something on the Chapel Python interop side to fix. But this will just make a nicer error message, it will not fix the problem. For that, we either need to reusue the interpreter for each locale or numpy needs to be fixed. |
This is a general Chapel bug, there is nothing that can be done within the Python module to fix it |
dbe46ea to
92e473a
Compare
ajpotts
left a comment
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.
I love this so much!
Unfortunately I don't think we can merge it in until we can reduce the potential for server crashes.
e6b9703 to
f516dea
Compare
ajpotts
left a comment
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! Thanks for all the hard work on this one.
9b871ce to
eb07dbc
Compare
c3ccb36 to
994765c
Compare
add test case Signed-off-by: Jade Abraham <jade.abraham@hpe.com> add test to ini Signed-off-by: Jade Abraham <jade.abraham@hpe.com> add server msg Signed-off-by: Jade Abraham <jade.abraham@hpe.com> add client code Signed-off-by: Jade Abraham <jade.abraham@hpe.com> add support for arbitrary python code Signed-off-by: Jade Abraham <jade.abraham@hpe.com> add more tests Signed-off-by: Jade Abraham <jade.abraham@hpe.com> add python interop flags Signed-off-by: Jade Abraham <jade.abraham@hpe.com> add compat modules Signed-off-by: Jade Abraham <jade.abraham@hpe.com> add cloudpickle Signed-off-by: Jade Abraham <jade.abraham@hpe.com> use non-generic function Signed-off-by: Jade Abraham <jade.abraham@hpe.com> add stubs Signed-off-by: Jade Abraham <jade.abraham@hpe.com> add missing dependency Signed-off-by: Jade Abraham <jade.abraham@hpe.com> remove unused import Signed-off-by: Jade Abraham <jade.abraham@hpe.com> format code nicely Signed-off-by: Jade Abraham <jade.abraham@hpe.com> fix test Signed-off-by: Jade Abraham <jade.abraham@hpe.com> skip tests if not supported Signed-off-by: Jade Abraham <jade.abraham@hpe.com> ignore mypy errors for cloudpickle Signed-off-by: Jade Abraham <jade.abraham@hpe.com> add missing cloudpickle deps Signed-off-by: Jade Abraham <jade.abraham@hpe.com> apply reviewer feedback Signed-off-by: Jade Abraham <jade.abraham@hpe.com> update server modules Signed-off-by: Jade Abraham <jade.abraham@hpe.com> add ge-24 compat modules Signed-off-by: Jade Abraham <jade.abraham@hpe.com> encode python version and reuse interpreters Signed-off-by: Jade Abraham <jade.abraham@hpe.com> fix line length Signed-off-by: Jade Abraham <jade.abraham@hpe.com> fix compat Signed-off-by: Jade Abraham <jade.abraham@hpe.com> resolve limitation Signed-off-by: Jade Abraham <jade.abraham@hpe.com> commit changes to ge-24 Signed-off-by: Jade Abraham <jade.abraham@hpe.com> expose python version to server config Signed-off-by: Jade Abraham <jade.abraham@hpe.com> fix typo Signed-off-by: Jade Abraham <jade.abraham@hpe.com> wrap line Signed-off-by: Jade Abraham <jade.abraham@hpe.com> improve tests Signed-off-by: Jade Abraham <jade.abraham@hpe.com> update docs Signed-off-by: Jade Abraham <jade.abraham@hpe.com> update test to use get_array_ranks Signed-off-by: Jade Abraham <jade.abraham@hpe.com> add isPythonModuleSupported Signed-off-by: Jade Abraham <jade.abraham@hpe.com> adjust problem size Signed-off-by: Jade Abraham <jade.abraham@hpe.com> update test skipif Signed-off-by: Jade Abraham <jade.abraham@hpe.com> fix flake errors Signed-off-by: Jade Abraham <jade.abraham@hpe.com>
994765c to
821ae4c
Compare
Adds prototypical support for calling an arbitrary python function on a distributed Arkouda array.
For example:
This PR uses
cloudpickleto pickle arbitrary python code. The pickle is shipped to the server as base64, where it is depickled and executed.To use this module, there are new requirements for Arkouda.
arkouda_servermust be built with the same version of python that it will be run with.arkouda_server's python version and the client's python version must be the same major/minor version.cloudpicklemust be available to thearkouda_server, not just the clientarkouda_server