-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[core][adag] Fix for asyncio outputs #46845
[core][adag] Fix for asyncio outputs #46845
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.
Nice. This fixes #46766 .
what was the error message? I am curious if it is the same error I've seen while I developed |
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> QQ: what was the reason why we inherited CompiledDAGRef originally?
@@ -1431,7 +1431,9 @@ async def execute_async( | |||
fut = asyncio.Future() | |||
await self._fut_queue.put(fut) | |||
|
|||
return CompiledDAGFuture(self, self._execution_index, fut) | |||
fut = CompiledDAGFuture(self, self._execution_index, fut) | |||
self._execution_index += 1 |
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 it related to this PR?
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.
Just a fix for UX - the execution index here is only used for the __str__
representation of the future, but it always said execution_index=0 before :)
Ah yeah the error message was this: Exception ignored in: <function CompiledDAGRef.__del__ at 0x7fbcfb452790>
Traceback (most recent call last):
File "/home/swang/ray/python/ray/experimental/compiled_dag_ref.py", line 77, in __del__
if not self._ray_get_called:
AttributeError: 'CompiledDAGFuture' object has no attribute '_ray_get_called' |
Why are these changes needed?
When asyncio interface is used, we do not need to call
get
on the underlying objects because this is already done by a background thread. Therefore, when a CompiledDAGFuture goes out of scope, we should just let the underlying future go out of scope instead of trying to callget
like we do for CompiledDAGRefs.When testing locally, I found that without these changes, the program would produce errors when a CompiledDAGFuture went out of scope because it tried to call CompiledDAGRef.del. I'm not sure why these don't appear when running the existing tests though.
Closes #46766.