Scope¶
Jabara is a library for storing checkpoints and for comparing ways to store them.
What Jabara does not do¶
It does not introduce a compression method. Zstandard, byte grouping, XOR and subtraction deltas, and 8-bit quantization are known techniques. Jabara puts them behind one interface, so you can use, compare, and extend them in the same way. It does not aim to beat other codecs on stored size.
It does not compress on a GPU. It needs no GPU and runs on CPU in the training loop.
It does not support multi-process training, DeepSpeed, or FSDP in the Hugging Face Trainer adapter.
attachrefuses all three. DeepSpeed and FSDP save and load sharded state with their own code, which never calls the loaders that the adapter wraps. Weights thatsave_pretrainedsplits over several*.safetensorsfiles are a different case:attachcompresses each file.It does not read or write remote paths in the PyTorch Lightning plugin. A URL path is refused.
It runs no pickle.
save_stateand the Lightning plugin store tensors, plain values, and dicts, lists, and tuples of them, and refuse a tensor subclass or a custom object, so their archives hold no pickle data. A file thattorch.savewrote is a pickle, because PyTorch's file format uses one.jabara compresstakes such a file apart without running it: it reads the storages from the zip and keeps the pickle's bytes as they are, andjabara decompresswrites them back. Only the names and roles of the tensors needtorch.load(..., weights_only=True), which unpickles only tensors and plain types; for a file that it refuses, the tensors keep the roleother. Loading a restored file is up to you, as it was before compression.It does not code several tensors jointly. The codec interface sees one chunk of one tensor at a time. A method that prunes or quantizes weights together with their optimizer moments, as ExCP does, does not fit this interface. Whether one interface can cover such methods is an open question, and Jabara does not claim to.
It does not measure a whole save or load in
bench. The report times the codec's share, in memory.
What it keeps replaceable¶
The codec, the assigner, the state schema, the checkpoint file format, and the framework adapter can each change without touching the rest (see Add a codec, an assigner, a state schema, or a file format).