ancient-wolf-19325
08/14/2024, 2:32 PMwith_runtime_overrides is discussed in the context of Flyte's ability to override task configurations at runtime. This feature allows you to specify different resource configurations for tasks within a workflow.
According to the RFC on Config Override, with_runtime_overrides can be used to mark specific nodes in a workflow as overridable. This allows you to configure different resources for the same task when executed in different contexts.
Here's an example of how you might use `with_runtime_overrides`:
from flytekit import task, workflow, Resources
@task
def train(dataset_uri: str) -> str:
# Training logic here
return "model_uri"
@task
def evaluate(model_uri: str):
# Evaluation logic here
pass
@workflow
def wf():
model1 = train(dataset_uri="s3://bucket/dataset1").with_runtime_overrides("model_1_resources")
model2 = train(dataset_uri="s3://bucket/dataset2").with_runtime_overrides("model_2_resources")
evaluate(model_uri=model1)
evaluate(model_uri=model2)
This example demonstrates how to use with_runtime_overrides to apply different resource configurations to the same task within a workflow.
Would you like more detail on implementing this or any specific part of the process?
Sources:
- RFC on Config Override
Slack Link
https://flyte-org.slack.com/archives/CP2HDHKE1/p1723645903.065259 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.