Skip to content
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

Ray Remote Options #800

Merged
merged 15 commits into from
Apr 8, 2024
Merged

Ray Remote Options #800

merged 15 commits into from
Apr 8, 2024

Conversation

flavour
Copy link
Contributor

@flavour flavour commented Apr 1, 2024

Changes

Support to pass options to ray.remote() via @ray_remote_options() decorator

  • uses Tags internally, so ray_remote. namespace is now reserved.

How I tested this

I setup 4 different Ray nodes with different resources available & then decorated 4 functions to target these nodes and one with no decorator.
I confirmed that the functions ran on the correct nodes when using RayGraphAdapter, just as if I wasn't using Hamilton and that the undecorated function also ran

RayWorkflowGraphAdapter also tested.

Notes

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • [N/A] Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

skrawcz and others added 4 commits April 1, 2024 10:48
Ray options allow different resouces to be specified.
Functions can then have different resource requirements
specified. This is a POC.
Copy link
Collaborator

@skrawcz skrawcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good. @elijahbenizzy might have more thoughts on the decorator than me.

Copy link
Collaborator

@elijahbenizzy elijahbenizzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! I'm in favor of putting this in h_ray, @skrawcz thoughts?

hamilton/function_modifiers/metadata.py Outdated Show resolved Hide resolved
hamilton/function_modifiers/metadata.py Outdated Show resolved Hide resolved
@flavour flavour changed the title Ray options Ray Remote Options Apr 2, 2024
hamilton/plugins/h_ray.py Outdated Show resolved Hide resolved
hamilton/plugins/h_ray.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@skrawcz skrawcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think it'd be good to add some unit tests please and then this is ready to ship!

@flavour
Copy link
Contributor Author

flavour commented Apr 4, 2024

Looks good. I think it'd be good to add some unit tests please and then this is ready to ship!

Tests added & now passing :)

@skrawcz skrawcz merged commit 0bb0aac into DAGWorks-Inc:main Apr 8, 2024
23 checks passed
@skrawcz
Copy link
Collaborator

skrawcz commented Apr 8, 2024

Thanks @flavour 🚀 this will go out this coming week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants