tilelang.cache.binary_cache¶

Cross-host cache for compiled device binaries, shared by backend caches.

Classes¶

BinaryCache

Immutable, verified cache of raw device binaries keyed by content hash.

Module Contents¶

class tilelang.cache.binary_cache.BinaryCache¶

Immutable, verified cache of raw device binaries keyed by content hash.

Each key is an immutable directory containing metadata.json (format tag, payload size, sha256) and a raw kernel binary. Entries are staged privately and published with a single directory rename, so concurrent writers cannot observe partial entries and the first publication wins. Published entries are never modified or deleted: on 3FS, unlinking a binary can invalidate another reader’s open fd, so corruption is handled as a plain cache miss.

Subclasses set cache_root_dir (directory under the version namespace), cache_format (metadata format tag) and binary_kind (backend name used in error messages), and provide their own make_key built on _finalize_key().

cache_root_dir: ClassVar[str]¶
cache_format: ClassVar[str]¶
binary_kind: ClassVar[str]¶
classmethod get_path(key, compile_format)¶
Parameters:
  • key (str)

  • compile_format (str)

Return type:

str

classmethod load(key, compile_format)¶
Parameters:
  • key (str)

  • compile_format (str)

Return type:

bytes | None

classmethod save(key, compile_format, data)¶
Parameters:
  • key (str)

  • compile_format (str)

  • data (bytes)

Return type:

None