-
Notifications
You must be signed in to change notification settings - Fork 653
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
TEST-#6460: don't use 'repr' to force materialization #6461
Conversation
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.
There seems to be at least two places with missing arguments... and I've left a few suggestions on using "more public" API instead of protected ._to_pandas()
Also @anmyachev I'm not entirely sure this fixes the problem unearthed in #6442 - I think the analysis there rightfully assumes that "at least on Ray, that error is propagated from the worker to the main process as soon as it happens, which means that another worker process may still be doing stuff in the background. The error "completes" the test, so we think we are ready for teardown", and I don't think |
Actually, in order to get an exception on the main process, it must be explicitly materialized through import ray
import time
ray.init(num_cpus=4)
def example():
raise ValueError("something isn't working")
rem_example = ray.remote(example)
future = rem_example.remote() # call it
time.sleep(10) # to make sure exception is happened in remote `example` function
print("after sleep") # this code works even if a exception is happened
ray.get(future) # get the exception on the main process
print("after get") # this code doesn't work, there was an exception in the previous line UPD: I realized that we are talking about two different problems. The first is that we do not materialize all partitions due to usage of |
Yeah, that was the problem I talked about. For the |
Need to check if the problem is the root cause for #2533. |
a9bcffb
to
ff9c4ea
Compare
try: | ||
result = cls._execution_wrapper.materialize(blocks_to_materialize) | ||
except Exception: | ||
# wait for the end of computations so that the processes free up the resources used | ||
cls._execution_wrapper.wait(blocks_to_materialize) | ||
raise |
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.
@YarShev this construction causes the unidist to hangs, although dask and ray work. Can you suggest what's wrong?
For that we first need to see if that issue is still occurring... 😺 |
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.
Overall looks good, but CI is still not green, so cannot approve.
cls._execution_wrapper.wait(blocks_to_materialize) | ||
raise |
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 don't think this is exactly the right place to put this synchronization point... At least it should be waited conditionally based on some configuration variable, as I would think that in most scenarios the user doesn't want to wait for all computations when it's already known that an exception is happening.
Also, this is fixing a problem which isn't entirely related to the original issue, so maybe it's better to open a new separate PR with this change.
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.
Also, this is fixing a problem which isn't entirely related to the original issue, so maybe it's better to open a new separate PR with this change.
I agree, let's continue in another PR.
try: | ||
result = cls._execution_wrapper.materialize(blocks_to_materialize) | ||
except Exception: | ||
# wait for the end of computations so that the processes free up the resources used | ||
cls._execution_wrapper.wait(blocks_to_materialize) | ||
raise | ||
return result |
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.
if that code is to stay, we can make it look nicer:
try: | |
result = cls._execution_wrapper.materialize(blocks_to_materialize) | |
except Exception: | |
# wait for the end of computations so that the processes free up the resources used | |
cls._execution_wrapper.wait(blocks_to_materialize) | |
raise | |
return result | |
try: | |
return cls._execution_wrapper.materialize(blocks_to_materialize) | |
except Exception: | |
# wait for the end of computations so that the processes free up the resources used | |
cls._execution_wrapper.wait(blocks_to_materialize) | |
raise |
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.
Code at a glance looks good, but tests are failing.
@anmyachev please take a look at CI.
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
Co-authored-by: Vasily Litvinov <fam1ly.n4me@yandex.ru>
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
This reverts commit 1341cf7.
This reverts commit ff9c4ea.
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.
LGTM!
What do these changes do?
flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
black --check modin/ asv_bench/benchmarks scripts/doc_checker.py
git commit -s
repr
function to materialize the result of a function execution #6460docs/development/architecture.rst
is up-to-date