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

Unbounded foreach #450

Closed
wants to merge 4 commits into from
Closed

Unbounded foreach #450

wants to merge 4 commits into from

Conversation

romain-intel
Copy link
Contributor

No description provided.

Ravi Kiran Chirravuri and others added 3 commits March 9, 2021 15:05
* As denoted by plugins/test_unbounded_foreach/* this outlines a
template for creating (unbounded) foreach which requires a control
task that baby-sits the execution of a foreach while delegating the
actual execution of the foreach task possibly to a separate service.

* Concrete use-cases include a hyperparameter tuning service, or a
different service implementing a map-reduce paradigm but with a
specialized purpose.

TODO:
* Enable tests in local mode after bugs in datastore (py2, py3 incompat);
local metadata service (w.r.t task registration) are fixed.
* CliChecker might have to be updated to allow accessing a run due to
the presence of local metadata provider.
* Add ability to access local metadata through CLIChecker for accessing
run objects for UBF tests.
* Rewrite the expectation in nested_unbounded_foreach to only consider
UBF tasks since `dump` isn't aware of control vs ubf tasks.
Copy link
Contributor Author

@romain-intel romain-intel left a comment

Choose a reason for hiding this comment

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

A few comments mostly related around cleanup. LGTM otherwise.

# This allows decorators to have access to the CLI options instead of relying
# (solely) on the click context.
# TODO(crk): Fold `dict_to_cli_options` as a private method of this `CLIArgs`
# once all other callers of `step` [titus, meson etc.] are unified.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment not relevant to OSS or at least needs to be modded to remove irrelevant references.

@@ -154,6 +155,11 @@ def kill(ctx, run_id, user, my_runs):
@click.option("--shared_memory", help="Shared Memory requirement for AWS Batch.")
@click.option("--max_swap", help="Max Swap requirement for AWS Batch.")
@click.option("--swappiness", help="Swappiness requirement for AWS Batch.")
@click.option('--ubf-context',
default=None,
type=click.Choice([None, UBF_CONTROL, UBF_TASK]),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems to be a discrepancy between the 'none' option in cli.py and None here. Is this intended?

@@ -337,14 +439,17 @@ def _queue_tasks(self, finished_tasks):
self._is_cloned[task.path] = task.is_cloned

# CHECK: ensure that runtime transitions match with
# statically inferred transitions
# statically inferred transitions. Make an exception for control
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nit: indentation issue.

# This signals the runtime that the task doesn't want any
# retries indifferent to other decorator opinions.
# NOTE: We don't statically disallow specifying `@retry` in
# combination with other decorators (e.g. `@archer`) only to
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Internal comment needs rewording.

@@ -799,7 +933,8 @@ def _launch(self):
for deco in self.task.decos:
deco.runtime_step_cli(args,
self.task.retries,
self.task.user_code_retries)
self.task.user_code_retries,
self.task.ubf_context)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nit: Indentation

@@ -290,8 +290,7 @@ def dict_to_cli_options(params):
if k == 'decospecs':
k = 'with'
k = k.replace('_', '-')
if not isinstance(v, tuple):
v = [v]
v = v if isinstance(v, list) or isinstance(v, tuple) else [v]
for value in v:
yield '--%s' % k
if not isinstance(value, bool):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Internal PR had a to_unicode here. Is this no longer relevant?

@romain-intel
Copy link
Contributor Author

@seeravikiran: could you make the small changes suggested and then we can merge if that's ok.

@savingoyal savingoyal self-assigned this Apr 20, 2021
@savingoyal
Copy link
Collaborator

@romain-intel Is this PR linked to datastore changes or can I go ahead and test this PR on top of master?

@@ -61,7 +63,8 @@ def _merge_lists(base, overrides, attr):
RetryDecorator,
BatchDecorator,
StepFunctionsInternalDecorator,
CondaStepDecorator], ext_plugins.STEP_DECORATORS, 'name')
CondaStepDecorator,
TestUnboundedForeachDecorator], ext_plugins.STEP_DECORATORS, 'name')
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we should expose this decorator right now.

@romain-intel
Copy link
Contributor Author

I think you can port this PR on top of master. I don't think it has a strong dependency (but things will change a bit).

@romain-intel romain-intel mentioned this pull request Jun 12, 2021
@romain-intel
Copy link
Contributor Author

Replaced by #554

@savingoyal savingoyal deleted the unbounded_foreach branch June 30, 2021 18:31
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.

2 participants