aws / aws/sagemaker-python-sdk

Allow user to configure compresslevel for tarfile in sagemaker.util.repack_model

未关闭
#4,832 0 条评论 0 个 reaction 已指派 1 人 已被 @mollyheamazon 认领 在 GitHub 查看
type: feature request
主要语言
Python
星标
2.3k
派生
1.3k
平均合并
1 天 22 小时
30 天内合并 PR
35

描述

**Describe the feature you'd like**
Allow the user to configure the compresslevel parameter in tarfile.open, used by repack_model.

tarfile, which is [used in repack_model](https://github.com/aws/sagemaker-python-sdk/blob/9ede83e51adc2e0a73c7701cd5aa40183f3768df/src/sagemaker/utils.py#L563) uses compresslevel=9 by default, which is very slow. The default for gzip from the command line is 6, and is much faster, at the expense of some compression.

I'm trying to develop a pytorch model for deployment with a custom inference.py. The model artifact is pretty big, so gzipping it at compresslevel 9 takes minutes. I'm trying to iterate on changes to inference.py, and having to wait additional time to compress the tarball is a pain each time I deploy. Unfortunately I don't own the model so it's not easy to create a smaller version for development.

**How would this feature be used? Please describe.**
Pass an argument to `Model.deploy` or set compresslevel via a config that is used in repack_model.

**Describe alternatives you've considered**
1) Monkey patch tarfile.open to set compression level. Haven't tried this yet.
2) Manually create the tarball, create a PyTorchModel object pointing to that, and avoid model repackaging somehow. I have tried various ways of creating the PyTorchModel object, pointing it to the model tarball locally or in s3, but it seems to repackage every time anyway.
3) Maybe use boto directly? New to sagemaker/aws so that's another can of worms.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。