Skip to content

Disk cache

cache_directory

cache_directory() -> Path

Returns the directory of the disk cache, creating it if needed.

cache_key

cache_key(*parts: str | bytes, distributions: tuple[str, ...] = ()) -> str

Returns a cache key of parts that determine a result, and of the libraries.

distributions names the distributions besides JAX and cyxla whose code the result depends on. A new version of any of them changes the key.

library_identity cached

library_identity(distributions: tuple[str, ...] = ()) -> bytes

Returns what identifies the libraries that lowered programs depend on.

It always covers jax, jaxlib and cyxla, and also the given distributions.

store_lowered

store_lowered(key: str, programs: Sequence[LoweredProgram | None]) -> None

Stores lowered programs under a key.

load_lowered

load_lowered(key: str) -> tuple[LoweredProgram | None, ...] | None

Returns the lowered programs stored under a key, or None if there are none.

A malformed file is removed.

CACHE_ENVIRONMENT_VARIABLE module-attribute

CACHE_ENVIRONMENT_VARIABLE = 'CYXLA_CACHE_DIR'

Environment variable with the directory of the disk cache.