Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use no compression for model layers by default #298

Merged
merged 4 commits into from
May 9, 2024

Conversation

amisevsk
Copy link
Contributor

@amisevsk amisevsk commented May 6, 2024

Description

This PR is adapted from the compression-opts branch. See discussion on #257 for details. This PR drops the zstd option from that branch.

This PR adds the flag --compression to kit pack, with valid options none, gzip, and gzip-fastest:

  • none: no compression of layers, store layers as plain tarballs
  • gzip: current default behavior, compress layer tarballs with gzip
  • gzip-fastest: compress layer tarballs with gzip at the lowest compression level

The new default behavior is none, i.e. layers are stored in tar format with no compression. In testing, this was found to be a lot faster with minimal effect on modelkit size.

In addition, the gzip-fastest option is added as testing showed that it could decrease pack time by a factor of 2-10x with minimal loss in compression ratio.

Linked issues

Closes #257

@amisevsk amisevsk requested review from gorkem and nida-hasan May 6, 2024 20:22
Add flag --compression to kit pack, with allowed values 'none' and
'gzip'. If 'none' is specified, modelkit layers are stored as tar files
without any compression.

Media types are expanted to support both plain tar and gzip compression.

    Add flag --compression to kit pack, with allowed values 'none', 'gzip'
  and 'zstd', with a default value of 'gzip'. If 'none' is specified,
 modelkit layers are stored as tar files without any compression. If
'zstd' is specified, tarballs are compressed with Zstandard.

Media type are expanded to support plain tar and zstd compression
Expand unpack to support unpacking layers compressed with gzip as well
as uncompressed (plain tar) layers.
Add option 'gzip-fastest' to pack compression options. If specified,
layers are compressed via gzip at the fastest (i.e. lowest) compression
level. In testing, this can speed up compression 2-10x with minimal
loss in compression ratio.
Copy link
Contributor

@gorkem gorkem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@amisevsk amisevsk merged commit 3e71207 into jozu-ai:main May 9, 2024
3 checks passed
@amisevsk amisevsk deleted the no-compression-default branch May 9, 2024 16:06
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.

Improve pack and unpack speed
2 participants