New RunLLM response generated: >>>*# Question* Hi...
# runllm-flyte-trial
a
New RunLLM response generated: >>>*# Question* Hi team.. So I have a flyte task that usually requires caching. There is 1 specific workflow though where we do not want to use caching. Is there a way to disable caching on the fly? I tried passing it a random string argument… and set a default value for the other cases, but that resulted in
Error: rpc error: code = InvalidArgument desc = workflow with different structure already exists
# Answer Yes, you can disable caching for a specific Flyte workflow execution by using the
overwrite_cache
parameter. This parameter can be set when launching the workflow execution, ensuring that all cached values are overwritten and the tasks are executed afresh. According to this discussion, the
overwrite_cache
flag can be passed when you launch an execution. This is supported in Flyte's
ExecutionSpec
and can be utilized via FlyteRemote or Flyte's CLI. Here's an example of how to use the
overwrite_cache
parameter with FlyteRemote:
Copy code
from flytekit.remote import FlyteRemote
from flytekit.configuration import Config

remote = FlyteRemote(config=Config.auto(), default_project="my_project", default_domain="development")

# Assuming you have a workflow called `my_workflow`
execution = remote.execute(
    remote.fetch_workflow(name="my_workflow"),
    inputs={"input1": "value1"},
    overwrite_cache=True  # This disables caching for this execution
)
Would you like more details on this? Sources: - Flyte discussion on caching - Flyte documentation on ExecutionSpec Slack Link https://flyte-org.slack.com/archives/CP2HDHKE1/p1719249712.610649 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.