Skip to content

version requirement for using "requirement.txt" when serving a model #1221

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

Merged
merged 7 commits into from
Jan 13, 2020

Conversation

billdoors
Copy link
Contributor

@billdoors billdoors commented Jan 9, 2020

Issue #, if available:

Description of changes:

Testing done:

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

  • I have read the CONTRIBUTING doc
  • I used the commit message format described in CONTRIBUTING
  • I have used the regional endpoint when creating S3 and/or STS clients (if appropriate)
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used unique_name_from_base to create resource names in integ tests (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Qingwei Li added 3 commits January 7, 2020 22:44
@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@laurenyu laurenyu left a comment

Choose a reason for hiding this comment

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

the reality is a bit all over the place, unfortunately:

  • for training, it should be supported for all versions
  • for inference, requirements.txt should be in the source_dir for v0.4.0-1.1.0 and in the model tarball for v1.3.1 under a directory named code/

@billdoors
Copy link
Contributor Author

the reality is a bit all over the place, unfortunately:

  • for training, it should be supported for all versions
  • for inference, requirements.txt should be in the source_dir for v0.4.0-1.1.0 and in the model tarball for v1.3.1 under a directory named code/

I re-write it as below:
If there are other packages you want to use with your script, you can include a requirements.txt file in the same directory as your training script to install other dependencies at runtime. Both requirements.txt and your training script should be put in the same folder. You must specify this folder in source_dir argument when creating PyTorch estimator. A requirements.txt file is a text file that contains a list of items that are installed by using pip install. You can also specify the version of an item to install.

The function of installing packages using requirements.txt is supported for all PyTorch versions during training. When serving a PyTorch model, this function is supported but how to use it varies with PyTorch Versions. For PyTorch 1.3.1 or newer, requirements.txt must be in source_dir. For PyTorch 1.2.0, requirements.txt must be under directory code. For PyTorch 0.4.0 to 1.1.0, requirements.txt must be in source_dir and also in model tarball.

For information about the format of a requirements.txt file, see Requirements Files <https://pip.pypa.io/en/stable/user_guide/#requirements-files>__ in the pip documentation.

Question:
This part is unclear to me: "For PyTorch 0.4.0 to 1.1.0, requirements.txt must be in source_dir and also in model tarball"

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@laurenyu
Copy link
Contributor

Question:
This part is unclear to me: "For PyTorch 0.4.0 to 1.1.0, requirements.txt must be in source_dir and also in model tarball"

what I meant was: requirements.txt should be (in the source_dir for v0.4.0-1.1.0) && (in the model tarball for v1.3.1 under a directory named code/). I can see how that ended up being ambiguous though 😂

If there are other packages you want to use with your script, you can include a requirements.txt file in the same directory as your training script to install other dependencies at runtime. Both requirements.txt and your training script should be put in the same folder. You must specify this folder in source_dir argument when creating PyTorch estimator. A requirements.txt file is a text file that contains a list of items that are installed by using pip install. You can also specify the version of an item to install.

I would move "A requirements.txt file is a text file that contains a list of items that are installed by using pip install. You can also specify the version of an item to install." to go with the last paragraph ("For information about the format of a requirements.txt file, see Requirements Files in the pip documentation.")

The function of installing packages using requirements.txt is supported for all PyTorch versions during training. When serving a PyTorch model, this function is supported but how to use it varies with PyTorch Versions. For PyTorch 1.3.1 or newer, requirements.txt must be in source_dir. For PyTorch 1.2.0, requirements.txt must be under directory code. For PyTorch 0.4.0 to 1.1.0, requirements.txt must be in source_dir and also in model tarball.

Almost. For 1.3.1+, requirements.txt must be under code/ within model.tar.gz. 1.2.0 doesn't have requirements.txt support at all. For 0.4.0-1.1.0, you can remove "and also in the model tarball."

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

laurenyu
laurenyu previously approved these changes Jan 13, 2020
@laurenyu
Copy link
Contributor

thank you!! :)

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

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.

3 participants