Repository navigation
Version the .tt format and record the tuning environment - #90
Draft
lslusarczyk wants to merge 1 commit into
Draft
lslusarczyk wants to merge 1 commit into
lslusarczyk wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
.ttfile now says which format it uses and where it was tuned.tt.loadrefuses 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:
uint32little-endian, currently1;uint32;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=Falsehave no.ttfile and are not checked.