Skip to content

PyTorch 1.3.1 #13

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 14 commits into from
Nov 20, 2019
Merged

PyTorch 1.3.1 #13

merged 14 commits into from
Nov 20, 2019

Conversation

akartsky
Copy link
Contributor

@akartsky akartsky commented Oct 31, 2019

Added PyTorch 1.3.1 support.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@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


ARG PYTORCH_VERSION=1.3.0
ARG TORCHVISION_VERSION=0.4.1
ARG MMS_VERSION=1.0.7
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update this to the latest 1.0.8 everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

/opt/conda/bin/conda clean -ya
ENV PATH /opt/conda/bin:$PATH

ARG PYTORCH_VERSION=1.3.0
Copy link
Contributor

@nikhil-sk nikhil-sk Nov 13, 2019

Choose a reason for hiding this comment

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

Please update to PyTorch 1.3.1 everywhere as discussed, thank you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@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

@akartsky akartsky changed the title PyTorch 1.3.0 PyTorch 1.3.1 Nov 15, 2019
curl \
git \
wget \
vim \
Copy link

Choose a reason for hiding this comment

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

Please sort apt-get libraries

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


# See http://bugs.python.org/issue19846
ENV LANG C.UTF-8

Copy link

Choose a reason for hiding this comment

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

Move all ARGs and ENVs to the top. ARGs before ENV. Open MP envs are an exception.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

# Add arguments to achieve the version, python and url
ARG PYTHON_VERSION=2.7

RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
Copy link

Choose a reason for hiding this comment

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

Use && in the beginning of the next line (applies to all multi-line RUNs in all docker files)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

mkl==2019.4 \
mkl-include==2019.4 \
cython==0.29.12 \
typing==3.7.4 && \
Copy link

Choose a reason for hiding this comment

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

Update all libraries to latest versions

Copy link
Contributor

Choose a reason for hiding this comment

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

Easiest way to do this is to unpin all versions, run the build, if it's successful, pin versions according to the ones that come up in a pip freeze | grep <package> within the container.

pillow==6.1.0 \
h5py==2.9.0 \
requests==2.22.0 && \
conda install pytorch==$PYTORCH_VERSION torchvision==$TORCHVISION_VERSION cpuonly -c pytorch && \
Copy link

Choose a reason for hiding this comment

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

Align according to best practices doc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,101 @@
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04
Copy link

Choose a reason for hiding this comment

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

Please make same changes as CPU to GPU.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

ARG PYTHON_VERSION=2.7

# Install OpenSSH, Allow OpenSSH to talk to containers without asking for confirmation
RUN apt-get install -y --no-install-recommends openssh-client openssh-server && \
Copy link

Choose a reason for hiding this comment

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

Move each install to one line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

import sys
import os.path

from sagemaker_pytorch_serving_container import serving
Copy link

Choose a reason for hiding this comment

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

Should this be moved inside the if condition? Keep this consistent with the mms-entrypoint for mxnet.

Copy link

Choose a reason for hiding this comment

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

@@ -0,0 +1,81 @@
FROM ubuntu:16.04
Copy link

Choose a reason for hiding this comment

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

Same as previous docker files.

@@ -0,0 +1,93 @@
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04
Copy link

Choose a reason for hiding this comment

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

Same as previous docker file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

nikhil-sk
nikhil-sk previously approved these changes Nov 19, 2019
@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

ghost
ghost previously approved these changes Nov 20, 2019
@@ -50,6 +50,7 @@ RUN conda install -c conda-forge awscli==1.16.210 opencv==4.0.1 && \
pillow==6.1.0 \
h5py==2.9.0 \
requests==2.22.0 && \

Copy link

Choose a reason for hiding this comment

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

Remove empty line

@@ -50,6 +50,7 @@ RUN conda install -c conda-forge awscli==1.16.210 opencv==4.0.1 && \
pillow==6.1.0 \
h5py==2.9.0 \
requests==2.22.0 && \
Copy link

Choose a reason for hiding this comment

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

&& should be in the next line. This needs to be fixed across the file.

@@ -50,6 +50,7 @@ RUN conda install -c conda-forge awscli==1.16.210 opencv==4.0.1 && \
pillow==6.1.0 \
h5py==2.9.0 \
Copy link

Choose a reason for hiding this comment

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

Alignment changes required. The names of the libraries must be aligned with conda...

@@ -50,6 +50,7 @@ RUN conda install -c conda-forge awscli==1.16.210 opencv==4.0.1 && \
pillow==6.1.0 \
Copy link

Choose a reason for hiding this comment

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

Lines 28~41 alignment is off by one space.

import sys
import os.path

from sagemaker_pytorch_serving_container import serving
Copy link

Choose a reason for hiding this comment

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

pillow==5.4.1 \
h5py==2.9.0 \
requests==2.22.0 \
&& conda install -c \
Copy link
Contributor

Choose a reason for hiding this comment

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

You can combine all commands of '-c pytorch' together i.e. magma-cuda100 is also being fetched from pytorch channel.

@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

@akartsky akartsky merged commit d0b02e2 into aws:master Nov 20, 2019
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.

4 participants