This is part of our commercial offering.
polyaxon.polyflow.cache.V1Cache(disable=None, ttl=None, sections=None)
Polyaxon provides a caching layer for operation executions, this behavior is enabled by default for all runs executed in the context of a DAG, a hyperparameter tuning, or a mapping.
When runs are cached their outputs will be reused for future runs with similar inputs and component version.
- disable: bool, optional, default: False
- ttl: int, optional
- io: List[str], optional
- sections: List[str], optional
cache: disable: ttl: inputs: sections:
from polyaxon.polyflow import V1Cache cache = V1Cache( disable=False, ttl=3600, io=['param1', 'param4'] sections=['init'] )
Caching is enabled by default, if you want to disable the cache
for a component or just for a specific component run, you can set this field to
cache: disable: true
the default caching behavior is to persist and reuse a run’s results everytime a new operation with similar characteristics is scheduled to run.
In order to invalidate the cache after a certain period of time you can define a time to live value.
cache: ttl: 36000 # 10 hours
You may want to discard an input/output from being considered for the cache state calculation, or you may want to cache a component’s run irrespective of the params you pass to some io.
This field gives you full control to define how you want to calculate the cache state.
cache: io: ['param1', 'param4']
By default the cache manager will consider the state of the
containers (command and args) to trigger the cache hit logic.
You may want to discard a section from being considered for
the cache state calculation.
This field gives you allows to define the sections that should be used to calculate the cache state.
cache: sections: ['containers']