-
Notifications
You must be signed in to change notification settings - Fork 159
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
[FEAT] Propagate configs to Ray remote functions #1707
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1707 +/- ##
==========================================
- Coverage 85.11% 84.92% -0.19%
==========================================
Files 55 55
Lines 5368 5414 +46
==========================================
+ Hits 4569 4598 +29
- Misses 799 816 +17
|
@jaychia Quick high-level question: what's the primary motivation for attaching the |
Main motivators that come to mind are:
Is that right? |
Co-authored-by: Clark Zinzow <[email protected]>
Co-authored-by: Clark Zinzow <[email protected]>
Yup! My primary motivation was that if we could tie the lifetime of the config to the lifetime of the runner as much as possible, then we have a guarantee that all the configs are consistent all remote calls in a given run on a given runner. Ideally the lifecycle of objects should look something like:
(2) isn't quite true atm because we keep a redundant copy of the daft_config on the context object still... But I disable messing with it by not allowing calls to |
Also, I couldn't find a way around certain The easiest way was to just store the ObjectRef on the runner and manage its lifetime there |
General Changes
__reduce__
impl forPyDaftConfig
so it can be sent over the wire in RayDaftConfig
object upon initialization.set_config
once the runners have been instantiated_RUNNER
and_DAFT_CONTEXT
global singletons in thedaft.context
module -- the runner now resides inside theDaftContext
objectOverall, these changes allow us to have:
DaftContext
containing a lazily-initializedRunner
Runner
is initialized with theDaftConfig
at time-of-initialization (when any dataframes are created or executed)RayRunner changes
@ray.remote
, ensure that we accept a daft_config as the first arg and callset_config
as the first actionRayRunner
is initialized, we call aray.put
to put the DaftConfig into the cluster store that objectref. This objectref is also passed around to various other datastructures that may potentially callray.remote
functions, such as theRayRunnerIO
,RayPartitionSet
andRayMaterializedResult
so that they can correctly parametrize their calls with the same config.