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

Build conda package in the new .conda format #1455

Open
tongyuantongyu opened this issue Jul 11, 2023 · 0 comments
Open

Build conda package in the new .conda format #1455

tongyuantongyu opened this issue Jul 11, 2023 · 0 comments

Comments

@tongyuantongyu
Copy link

Conda 4.7 (released more than 4 years ago) introduced the new .conda package format, which uses zstd instead of bzip2 as compression algorithm.

Thanks to zstd, the new package format is both smaller and decompresses faster. conda-forge channel has been releasing packages in .conda format for quite long.

To instruct conda-build to produce packages in .conda format, one can adding these lines to .condarc:

conda_build:
  pkg_format: 2
  zstd_compression_level: 19

or in command line:

conda config --set conda_build.pkg_format 2
conda config --set conda_build.zstd_compression_level 19

And the conda-package-handling package provides cph command to convert packages from old .tar.bz2 format into .conda format:

cph transmute pytorch-2.0.1-py3.11_cuda11.8_cudnn8.7.0_0.tar.bz2 .conda --zstd-compression-threads=-1

As two examples, using the command above, package size of the latest linux64 build pytorch-2.0.1-py3.11_cuda11.8_cudnn8.7.0_0 reduced from 1444MB to 992MB (-31%) and latest win64 build pytorch-2.0.1-py3.10_cuda11.8_cudnn8_0 reduced from 1395MB to 941MB (-33%).

Given that .conda format can significantly speed up installation (during both downloading and unpacking), and is already being widely used, I think it's worth switching to it?

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

No branches or pull requests

1 participant