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

Lazy config evaluation #18

Closed
12 tasks
HamiltonRepoMigrationBot opened this issue Feb 26, 2023 · 3 comments
Closed
12 tasks

Lazy config evaluation #18

HamiltonRepoMigrationBot opened this issue Feb 26, 2023 · 3 comments
Labels
migrated-from-old-repo Migrated from old repository

Comments

@HamiltonRepoMigrationBot
Copy link
Collaborator

Issue by elijahbenizzy
Monday Feb 07, 2022 at 03:51 GMT
Originally opened as stitchfix/hamilton#64


[Short description explaining the high-level reason for the pull request]

Additions

Removals

Changes

Testing

Screenshots

If applicable

Notes

Todos

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows the standards laid out in the TODO link to standards
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Testing checklist

Python

  • python 3.6
  • python 3.7

elijahbenizzy included the following code: https://github.com/stitchfix/hamilton/pull/64/commits

@HamiltonRepoMigrationBot
Copy link
Collaborator Author

Comment by elijahbenizzy
Monday Feb 07, 2022 at 03:55 GMT


Need to add tests/figure out what to test. Hopefully this demonstrates the issue. IMO chainmap is actually better here -- supporting a lazyconfig is reasonable. That said, I'd prefer the simplicity with a dictionary.

@HamiltonRepoMigrationBot
Copy link
Collaborator Author

Comment by elijahbenizzy
Monday Feb 07, 2022 at 03:58 GMT


Pros of this:

  1. It allows lazily evaluated configs
  2. Its idiomatic -- types are only as constricted as they need to be (E.G. why does config have to be a dict?)
  3. It solves the problem a customer has

Cons of this:

  1. We can do less with the config/inputs - E.G. if we want to store them somewhere or print them out we'll be running up against the same problem.
  2. Added complexity for a specific use-case

@elijahbenizzy elijahbenizzy added the migrated-from-old-repo Migrated from old repository label Feb 26, 2023
@elijahbenizzy
Copy link
Collaborator

I don't think this is something we particularly want to handle now... Configs shouldn't be particularly complicated -- anything too complex should fit in the DAG itself.

If there's a complex process that determines how to shape it, we can figure that out. In the case o f the original motivation for this problem, we ended up just loading everything in parallel upfront.

elijahbenizzy added a commit that referenced this issue Sep 9, 2024
# This is the 1st commit message:

Update graph_functions.py

Describes what to do in `graph_functions.py`
# This is the commit message #2:

Adds comments to lifecycle base
# This is the commit message #3:

Update h_ray.py with comments for ray tracking compatibility
# This is the commit message #4:

Replicate previous error

# This is the commit message #5:

Inline function, unsure if catching errors and exceptions to be handadled differently

# This is the commit message #6:

BaseDoRemoteExecute has the added Callable function that snadwisched lifecycle hooks

# This is the commit message #7:

method fails, says AssertionError about ray.remote decorator

# This is the commit message #8:

simple script for now to check telemetry, execution yield the ray.remote AssertionError

# This is the commit message #9:

passing pointer through and arguments to lifecycle wrapper into ray.remote

# This is the commit message #10:

post-execute hook for node not called

# This is the commit message #11:

finally executed only when exception occurs, hamilton tracker not executed

# This is the commit message #12:

atexit.register does not work, node keeps running inui

# This is the commit message #13:

added stop() method, but doesn't get called

# This is the commit message #14:

Ray telemtry works for single node, problem with connected nodes

# This is the commit message #15:

Ray telemtry works for single node, problem with connected nodes

# This is the commit message #16:

Ray telemtry works for single node, problem with connected nodes

# This is the commit message #17:

Fixes ray object dereferencing

Ray does not resolve nested arguments:
https://docs.ray.io/en/latest/ray-core/objects.html#passing-object-arguments

So one option is to make them all top level:

- one way to do that is to make the other arguments not clash with any
possible user parameters -- hence the `__` prefix. This is what I did.
- another way would be in the ray adapter, wrap the incoming function,
and explicitly do a ray.get() on any ray object references in the
kwargs arguments. i.e. keep the nested structure, but when the ray
task starts way for all inputs... not sure which is best, but this
now works correctly.

# This is the commit message #18:

ray works checkpoint, pre-commit fixed

# This is the commit message #19:

fixed graph level telemtry proposal

# This is the commit message #20:

pinned ruff

# This is the commit message #21:

Correct output, added option to start ray cluster

# This is the commit message #22:

Unit test mimicks the DoNodeExecute unit test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migrated-from-old-repo Migrated from old repository
Projects
None yet
Development

No branches or pull requests

2 participants