Skip to content

Version the .tt format and record the tuning environment - #90

Draft
lslusarczyk wants to merge 1 commit into
intel:mainfrom
lslusarczyk:feat/tt-format-version
Draft

lslusarczyk wants to merge 1 commit into
intel:mainfrom
lslusarczyk:feat/tt-format-version

Conversation

@lslusarczyk

Copy link
Copy Markdown
Contributor

A .tt file now says which format it uses and where it was tuned.
tt.load refuses a file from another format or another environment before it reads the tuned modules.

The file is a header followed by the existing zip archive:

  1. format version, uint32 little-endian, currently 1;
  2. length of the environment record, uint32;
  3. environment record, JSON: host name, CPU, accelerators and their drivers, and the versions of Python, torch-tweak, torch, OpenVINO, TorchAO, Triton, and the SYCL runtime.

The loader reads the version first.
A different version stops the load without reading anything else.
Files written before this change start with PK\x03\x04, read as version 67324752, and are refused the same way.
The environment is checked next.
Any difference raises IncompatibleCheckpointError, listing each differing entry as tuned versus running.
Only then is the archive extracted and the state dict loaded.

A checkpoint tuned on one machine no longer loads on another.
Tuning results are measured on specific hardware and libraries, so the target machine tunes again.
A container with a new host name on every start also counts as another environment.
The deployment guide says so.

Checkpoints saved with compress_checkpoint=False have no .tt file and are not checked.

A .tt file now starts with a format version, then a record of the host,
CPU, accelerators, drivers, and library versions it was tuned with.
Loading checks the version first and the environment second, and raises
IncompatibleCheckpointError before the archive is extracted or unpickled.

Signed-off-by: Łukasz Ślusarczyk <lukasz.slusarczyk@intel.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant