Skip to content

Repack always uses sklearn image #3143

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

Closed
jponf opened this issue May 27, 2022 · 4 comments
Closed

Repack always uses sklearn image #3143

jponf opened this issue May 27, 2022 · 4 comments
Labels
component: pipelines Relates to the SageMaker Pipeline Platform type: bug

Comments

@jponf
Copy link

jponf commented May 27, 2022

When registering a pytorch model, using python 3.8, it fails because the requirements.txt includes dependencies (numpy is the one failing in this case, but may be others) that cannot be installed during the repack step.

We've found that the repack image cannot be changed and that right now it is an image using Python 3.7, a Python version not supported by our numpy version.

FRAMEWORK_VERSION = "0.23-1"

With numpy we can probably remove it from the requirement.txt but there might be other libraries that we cannot ignore this way.

System information
A description of your system. Please provide:

  • SageMaker Python SDK version: 2.88.3
  • Framework name (eg. PyTorch) or algorithm (eg. KMeans): PyTorch
  • Framework version: 1.10
  • Python version: py38
  • CPU or GPU: CPU
  • Custom Docker image (Y/N): N
@navaj0 navaj0 added component: pipelines Relates to the SageMaker Pipeline Platform type: bug labels Jun 10, 2022
@qidewenwhen
Copy link
Member

Hi @jponf , thanks for using Sagemaker!
You're right, currently the repack image is fixed to Sklearn.

Can you share us the code snippet to reproduce the issue? I'm wondering why we install the dependencies listed in requirements.txt in the repack step. The code sample can help us to understand the issue and figure out a way to bypass it or improve.

@jponf
Copy link
Author

jponf commented Jul 15, 2022

Hi @qidewenwhen,

Please find attached a small example with a dummy training step and a register step. The expected outcome is that, after training, the repack step will fail because inside the ./src directory we placed a requirements.txt with a package that only works on Python 3.8 or greater.

I'll be away for a week or so, in the meantime if you need anything else you can ask my colleague @Guillem96.

sagemaker-issue-3143.zip

@qidewenwhen
Copy link
Member

Thanks for the code samples! It helps a lot to quickly reproduce the issue.

The repack step is invoking a TrainingJob under the hood to simply repack custom dependencies and code into an existing model TAR archive.
I guess the requirement.txt is target for the register model step. Though requirement.txt is not intentionally to be used in the repack step, seems the training job there would regardlessly install every dependencies listed inside.

I've added this in our backlog and will raise this to my team for discussion. Will get back to you once we figure out the next steps.

@qidewenwhen
Copy link
Member

qidewenwhen commented Oct 31, 2022

Hi @jponf, sorry for the late update.
The fix has been released in v2.114.0 and I just verified the fix with your zip files and the latest SageMaker Python SDK version v2.116.0, which worked well on my side.

Closing this issue at this point and feel free to reopen if you have any questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pipelines Relates to the SageMaker Pipeline Platform type: bug
Projects
None yet
Development

No branches or pull requests

3 participants