This is part of our commercial offering.

V1Cache

polyaxon.polyflow.cache.V1Cache(disable=None, ttl=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.

  • Args:
    • disable: bool, optional, default: False
    • ttl: int, optional
    • io: List[str], optional

YAML usage

cache:
  disable:
  ttl:
  inputs:

Python usage

from polyaxon.polyflow import V1Cache
cache = V1Cache(
  disable=False,
  ttl=3600,
  io=['param1', 'param4']
)

Fields

disable

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 false

cache:
  disable: true

ttl

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

io

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']