Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Refactor to enable RayGraphAdapter and HamiltonTracker to work well together #1103
Refactor to enable RayGraphAdapter and HamiltonTracker to work well together #1103
Changes from 27 commits
74b152b
41decaa
5b73b8f
aa3ac05
e519180
2dca334
04f1a1b
b77860e
c8358f8
e77f6f7
f7e81a0
3a1cccd
09b47de
933991f
d1e6ea0
b528a45
7acdd38
377dc71
8e3eacd
5aa592b
36e8fcb
f17d4f2
abd87f7
4e28677
d9e86a9
6953417
e988db5
51c8544
3acd95c
a556558
c1b55ee
089d1de
1985ef7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
🤔 you're assigning to
self
to have access to these after the function has run, right?Might need to think through this a little more since this now means an execute mutates the Driver object... e.g .if you're running in a mutli-threaded situation where you have one driver object and execute concurrently in multiple threads.. I'd be inclined to change the return type instead of mutating self here. @elijahbenizzy thoughts?
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 like this structure as is.. the pre-execute hooks are in one function and the post-execute hooks are outside. The
self
was a workaround to get the test to pass and not running into issues with unspecifiedrun_id
when an exception occurs.Maybe we can simplify this and just put the result_builder into __raw_execute? This would make everything neater, planning to code this up tonight.
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.
Let me know if this solution is acceptable or if it breaks something somewhere else?
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.
So yeah, results builder is not in raw execute. The problem here is that it's not thread-safe -- this is something we rely on (E.G. being able to have multiple calls to the driver at once). So I don't think this will work?
IMO it's OK having it in two different places, but I think there are better solution here:
__raw_execute
return the run_id/function graph -- function graph can actually always be passed in.__raw_execute
-- why should it generate? Then if we pass that + the graph in we can easily call it at the beginning.__raw_execute
, always surrounding it by the pre/post graph hooks. Then it look like a sandwich, but has the right tooling. Theraw_execute
function is the only one that does not call the result builder, the rest call the post graph execute hook after calling the result builder.One thing to note -- the earlier the pre graph execute and later the post graph execute hooks are called the better. This is because it can capture errors -- thus any configuration problems/hamilton bugs will be caught in the right place and displayed in the UI.
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 was 90% sure my suggestion will not work; looked too easy :) I adjusted the
.materialize()
entyr point in the same way since it also calls__raw_execute
and all the test pass now as well.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, thanks! Yeah we should have tests for this, but it's always an issue of how much you can reasonably cover...