Delta compression utilities used by the Fireworks AI hot-load and incremental snapshot pipelines
Project description
fireworks-delta-compression
Delta compression utilities used by the Fireworks AI serving stack to ship incremental model weight updates (hot-loads) over the wire.
This package exposes the same compression / decompression backends that the Fireworks serving servers use internally, so you can produce or consume deltas on the customer side without copy-pasting source from the monorepo and without risk of dependency version drift.
Install
pip install fireworks-delta-compression
Quick start
import torch
from fireworks_delta_compression import (
delta_compress,
delta_decompress,
)
src = torch.randn(1024, 1024, dtype=torch.bfloat16)
dst = src + 1e-3 * torch.randn_like(src)
compressed_diff, checksum = delta_compress(
src=src,
dst=dst,
compression_format="arc_v3",
)
restored = delta_decompress(
src=src,
compressed_diff=compressed_diff,
checksum=checksum,
compression_format="arc_v3",
)
torch.testing.assert_close(restored, dst)
Supported compression formats
| Format | Backend |
|---|---|
arc_v1 |
XOR diff + zlib |
arc_v2 |
XOR diff + zstd |
arc_v3 |
ARC v3 (typed, multi-strategy) |
Higher-level helpers
delta_compress_dicts_to_file/delta_decompress_dict_from_file— work ondict[str, torch.Tensor]and persist to safetensors with checksums in the metadata block.delta_compress_files_to_file— read two safetensors files and write the delta out as a third safetensors file.delta_compress_dirs/decompress_delta_into_source— walk a directory of safetensors shards in parallel.delta_decompress_inplace— mmap-based in-place decompression that rewrites the base safetensors file with the diff applied (no extra RAM copy).
Versioning
Dependencies (torch, safetensors, numpy, zstd) use loose compatible-
release pins so this wheel installs cleanly alongside customer code. The
upper bounds (<3, <1, <3, <2) protect against silent breakage from
major-version upgrades; bump them after validating against a new server
release.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fireworks_delta_compression-0.1.0.tar.gz.
File metadata
- Download URL: fireworks_delta_compression-0.1.0.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdc649b28e4dddd0913761f2f2ca98a3423a5fe9f818135cf4950bba2e888097
|
|
| MD5 |
e43052571b71e15524b3d79d25dfbbda
|
|
| BLAKE2b-256 |
8969bfc8f89a267e8c773f3a33633100f7cfa379e54b6d5ed4d2080668a42bb3
|
File details
Details for the file fireworks_delta_compression-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fireworks_delta_compression-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24a568d31ff2b460ce2724b825a2478dbeba36b511fdfc6543f28f4a39ece4b0
|
|
| MD5 |
b1435fdb07d77d3335055c98852d0f12
|
|
| BLAKE2b-256 |
f3b791c6c8af4308b55a101d12df6be9203a5834a67b73d0b33f5a8d0354c308
|