-
Notifications
You must be signed in to change notification settings - Fork 787
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
Unbounded foreach #450
Conversation
* 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.
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.
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. |
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.
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]), |
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.
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 |
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.
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 |
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.
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) |
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.
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): |
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.
Internal PR had a to_unicode here. Is this no longer relevant?
@seeravikiran: could you make the small changes suggested and then we can merge if that's ok. |
@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') |
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 think we should expose this decorator right now.
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). |
Replaced by #554 |
No description provided.