Skip to main content

Module bundle

Module bundle 

Source
Expand description

Named environment bundles: ship pre-warmed autotune and compilation caches. Named environment bundles.

A bundle packages pre-warmed caches (autotune results, compiled kernels) under a human-chosen name such as “H100 Linux” so applications can ship them and skip cold-start tuning and compilation.

§Import, not a runtime layer

A bundle is only ever used to fill the local storage, through [import]. Once imported, its entries are ordinary rows and the file can be deleted: runtime lookups go to Storage and nothing else. There is no read path in which a bundle participates, so no cache hit ever depends on a file staying installed.

Entries land with Origin::Imported, which lets a locally computed value replace one that turns out to be stale.

§Formats

[Bundle] is deliberately format-agnostic: a bundle answers by namespace and key bytes, exactly like the local storage, so nothing about a layout on disk is load-bearing. [SqliteBundle] is the native format, a single SQLite file. [EmbeddedBundle] is one flat blob for wasm and no-std targets, which have no file system to open.

Writing is native-only on purpose. A bundle for any target is produced on a development machine by [export], and only consumed elsewhere.

§Correctness

Bundles are never trusted for correctness: imported autotune entries go through the same checksum validation as local ones, and every namespace carries the cubecl version and the device fingerprint, so a mismatched machine never looks them up. A wrong bundle costs load time, nothing else.

Structs§

BundleManifest
The manifest of an environment bundle, stored as a row of the bundle database in BundleFormat::Sqlite and as the metadata blob in BundleFormat::Flat.
EmbeddedBundle
A bundle held as one blob of bytes, embedded in the binary with include_bytes! or fetched at runtime.
EnvironmentInfo
Description of one environment a bundle was captured on. Informational: correctness never depends on these fields.
ImportReport
What an import copied.

Enums§

BundleError
Error opening or creating a bundle.
EmbeddedBundleError
Why a byte blob isn’t a readable flat bundle.

Constants§

FORMAT_VERSION
The flat layout this build reads and writes. Entries of any other version are ignored rather than misread.
MAGIC
Identifies a flat bundle, and catches a file handed over by mistake.
MANIFEST_SCHEMA
The manifest schema version this build reads and writes.

Traits§

Bundle
A read-only set of pre-computed cache entries shipped with an application.

Functions§

flat_bundle_version
The layout version of the flat bundle starting at bytes, if it is one.
import
Copies every entry of bundle into the local storage.