https://flyte.org logo
#ask-the-community
Title
# ask-the-community
r

Rupsha Chaudhuri

12/28/2022, 8:12 PM
Question about caching behavior: If I have a task that’s reused between 2 workflows, does caching still work if the inputs are the same? Or is it tied to the workflow?
d

Dan Rammer (hamersaw)

12/28/2022, 8:26 PM
Caching is determined at the cache level. So as long as the task inputs and
cache_version
are the same it should be reused between workflows.
k

Ketan (kumare3)

12/28/2022, 8:27 PM
yes @Rupsha Chaudhuri that is the principal reason why we built caching in Flyte to work across workflows and reuse results
r

Rupsha Chaudhuri

12/28/2022, 8:27 PM
woot woot.. awesome
d

Dan Rammer (hamersaw)

12/28/2022, 8:27 PM
If you are running two instances of a task at the same time, in your example workflow A calls task X with input "foo", and workflow B calls task X with input "foo" you can use
cache_serialize
to ensure only one of them runs and the other waits for it to complete and uses the cached results.
r

Rupsha Chaudhuri

12/28/2022, 8:28 PM
great.. that’s super helpful
21 Views