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

Added section on overriding lp config in loop #5223

Merged
merged 5 commits into from
Apr 15, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/user_guide/advanced_composition/nested_parallelization.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,23 @@ def multi_wf(l: typing.List[int], chunk: int) -> typing.List[int]:
return level1(l=l, chunk=chunk)
```

Overrides let you add additional arguments to the launch plan you are looping over in the dynamic. Here we add caching:

```python
@workflow
def child(num: int) -> int:
return num + 1

child_lp = LaunchPlan.get_or_create(child)

@dynamic
def spawn(n: int) -> List[int]:
l = []
for i in [1,2,3,4,5]:
l.append(child_lp(num=i).with_overrides(cache=True, cache_version="1.0.0"))
# you can also pass l to another task if you want
return l
```

### Flyte console

Expand Down
Loading