diff --git a/fastai-v2/Dockerfile b/fastai-v2/Dockerfile new file mode 100644 index 0000000..7240add --- /dev/null +++ b/fastai-v2/Dockerfile @@ -0,0 +1,66 @@ +FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04 + +LABEL com.nvidia.volumes.needed="nvidia_driver" + +RUN echo "deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list + +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + git \ + curl \ + vim \ + ca-certificates \ + libnccl2=2.2.13-1+cuda9.0 \ + libnccl-dev=2.2.13-1+cuda9.0 \ + python-qt4 \ + libjpeg-dev \ + zip \ + unzip \ + bzip2 \ + libpng-dev &&\ + rm -rf /var/lib/apt/lists/* + + +ENV PYTHON_VERSION=3.6 +RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ + chmod +x ~/miniconda.sh && \ + ~/miniconda.sh -b -p /opt/conda && \ + rm ~/miniconda.sh && \ + /opt/conda/bin/conda install conda-build -y + + +WORKDIR /notebooks + +RUN git clone --single-branch --branch v0.7.1 https://github.com/fastai/fastai.git . +RUN ls && /opt/conda/bin/conda env create +RUN /opt/conda/bin/conda clean -ya + +ENV PATH /opt/conda/envs/fastai/bin:$PATH +ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64 +ENV USER fastai + +CMD source activate fastai +CMD source ~/.bashrc + +RUN /opt/conda/bin/conda install --name fastai -c conda-forge jupyterlab + +WORKDIR /data + +RUN curl http://files.fast.ai/data/dogscats.zip --output dogscats.zip +RUN unzip -d . dogscats.zip +RUN rm dogscats.zip + +# occurs in entrypoint now +# RUN ln -s /data/ /notebooks/courses/dl1/ + +RUN chmod -R a+w /notebooks + +ENV PATH /opt/conda/bin:$PATH +WORKDIR /notebooks + +ENV PATH /opt/conda/envs/fastai/bin:$PATH + +COPY run.sh /run.sh + +CMD ["/run.sh"] diff --git a/fastai-v2/Instructions.md b/fastai-v2/Instructions.md new file mode 100644 index 0000000..cb5b3b5 --- /dev/null +++ b/fastai-v2/Instructions.md @@ -0,0 +1,67 @@ +# Fast.ai Deep Learning Course v3 on Gradient Notebooks + +This is a quick guide to starting Part 3 of the fast.ai course Practical Deep Learning for Coders using Gradient Notebooks. With Gradient, you get quick access to a Jupyter instance (Lab or Notebook) without having to set up a virtual machine. Paperspace is a GPU-accelerated cloud platform + +### Summary of Charges +There are no storage fees associated with using Gradient Notebooks. Users pay hourly usage fees for the time that their Notebooks are Running. The hourly rate is dependent on the Compute Type selected, see all available types [here](https://support.paperspace.com/hc/en-us/articles/360002484474-Gradient-Pricing). Notebooks must be stopped to end billing. Learn more about Gradient billing [here](https://support.paperspace.com/hc/en-us/articles/360001369914-How-Does-Gradient-Billing-Work-). + +## Getting Set Up +### Step 1: Create a Paperspace Account +If you haven't already, you'll need to sign up for Paperspace [here](https://www.paperspace.com/account/signup). Confirm your account using the link in the email you receive from Paperspace. [Sign in to Paperspace](https://www.paperspace.com/account/login). + +![image](https://user-images.githubusercontent.com/585865/47126635-76af7c80-d257-11e8-8f33-b34be1ae8ef3.png) + + +### Step 2: Access Gradient & Create Notebook +I. On the left-hand side of your Console under Gradient, select Notebooks. + +II. Select the *Fast.ai 1.0 / PyTorch 1.0 BETA* base container. + +**Note: for Pro users, learn more about this docker container at the [paperspace/fastai-docker repo](https://github.com/Paperspace/fastai-docker/tree/fastai/pytorch1.0)** + +![image](https://user-images.githubusercontent.com/585865/47126835-719efd00-d258-11e8-8d8d-b402ef8baecc.png) + + +III. Select your Compute Type. + +![](https://support.paperspace.com/hc/article_attachments/360006919793/mceclip0.png) + +IV. Name your Notebook. + +V. Enter your payment details (if you're new to Paperspace). Even if you have a promo or referral code, all active Paperspace accounts must have a valid credit card on file. You'll be able to enter your promo code later. + +VI. Click Create Notebook + +When you click Create Notebook, that will start your Notebook and your billing for utilization will begin. To stop billing, you must stop your Notebook. Notebooks will automatically shut down after 12 hours. + +You'll be taken to your Notebook details page in your Console, where your Notebook will be created. It will go straight from Pending to Running, and will be ready to use. + +### Step 3: Stopping your Notebook +Under Action, just click stop. This will end the billing session. + +![image](https://user-images.githubusercontent.com/585865/47126987-29340f00-d259-11e8-8432-10e47d3edbe0.png) + +### Step 4: Restart your Notebook +Click Start to pick up where you left off, and/or choose a different VM type on which you'd like to run your Notebook. + +--- + +The Compute Type of your Notebook can be changed when you start it. What this means for you is that you can prepare your work inexpensively and add a GPU when you're ready to run your model/algorithm. + +![](https://support.paperspace.com/hc/article_attachments/360012358634/mceclip0.png) + +## Managing Data +Fast.ai data files (dogscats) can be found in the 'datasets' folder. Files in this directory are hosted by Paperspace and are read-only. See [Public Datasets](https://support.paperspace.com/hc/en-us/articles/360003092514-Public-Datasets) for more info. + +The `storage` folder is your [Persistent Storage](https://support.paperspace.com/hc/en-us/articles/360001468133-Persistent-Storage). Files placed here are available across runs of Paperspace Jobs, Notebooks, and Linux machines. Empty by default, this repository is meant to store training datasets. + +The rest of the files in the notebooks directories will be available as Artifacts when your notebook is stopped. + +## Wrapping up +Paperspace provides $10 of Gradient credit to start you off on your course. This code is to be used for fast.ai students only. In your console, click on Billing in the left-hand menu and enter the promo code at the bottom right. The promo code for this course is: *FASTAIGR45T*. + +Note: If you opt for a Gradient 1 Subscription, promotional credit does not apply. Learn more about Gradient Subscription levels here. + +Questions or issues related to course content, we recommend posting in the [fast.ai forum](http://forums.fast.ai/). + +For Paperspace-specific support, check out the rest of the Gradient Help Center or submit a support ticket with [this form](https://support.paperspace.com/hc/en-us/requests/new). diff --git a/fastai-v2/README.md b/fastai-v2/README.md new file mode 100644 index 0000000..b227a34 --- /dev/null +++ b/fastai-v2/README.md @@ -0,0 +1,27 @@ +# Paperspace + Fast.ai Docker files + + +## Overview + +This is a docker build file designed to work with [Paperspace]. The latest pre-built runtimes are pushed here: https://hub.docker.com/r/paperspace/fastai/ + +This container pulls the latest fast.ai class. You can find this repo here: https://github.com/fastai/fastai and you can learn more about the Fast.ai course here: http://course.fast.ai/ + +## Requirements: + +[Docker CE](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) + +[NVIDIA-docker](https://github.com/NVIDIA/nvidia-docker) + +Nvidia Drivers + + +## Build + +`sudo docker build -t paperspace/fastai .` + +## Pre-built runtimes + +You can also just run the following without having to build the entire container yourself. This will pull the container from Docker Hub. + +`sudo docker run --runtime=nvidia -d -p 8888:8888 paperspace/fastai:0.7-CUDA9-base-2.0` diff --git a/fastai-v2/run.sh b/fastai-v2/run.sh new file mode 100755 index 0000000..cb0c237 --- /dev/null +++ b/fastai-v2/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +ln -s /data/ /notebooks/courses/dl1/ +jupyter lab --ip=0.0.0.0 --no-browser --allow-root diff --git a/fastai-v3/Dockerfile b/fastai-v3/Dockerfile new file mode 100644 index 0000000..0fe58c0 --- /dev/null +++ b/fastai-v3/Dockerfile @@ -0,0 +1,51 @@ +FROM nvidia/cuda:9.2-base-ubuntu16.04 +# See http://bugs.python.org/issue19846 +ENV LANG C.UTF-8 +LABEL com.nvidia.volumes.needed="nvidia_driver" + +RUN echo "deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list + +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + git \ + curl \ + vim \ + ca-certificates \ + python-qt4 \ + libjpeg-dev \ + zip \ + unzip \ + libpng-dev &&\ + rm -rf /var/lib/apt/lists/* + +ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64 +ENV PYTHON_VERSION=3.6 + +RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ + chmod +x ~/miniconda.sh && \ + ~/miniconda.sh -b -p /opt/conda && \ + rm ~/miniconda.sh && \ + /opt/conda/bin/conda install conda-build + +ENV PATH=$PATH:/opt/conda/bin/ +ENV USER fastai +# Create Enviroment +COPY enviroment.yaml /enviroment.yaml +RUN conda env create -f enviroment.yaml + +WORKDIR /notebooks +# Activate Source +CMD source activate fastai +CMD source ~/.bashrc + +RUN chmod -R a+w /notebooks +WORKDIR /notebooks + +# Clone course-v3 +RUN git clone https://github.com/fastai/course-v3.git + +COPY config.yml /root/.fastai/config.yml +COPY run.sh /run.sh + +CMD ["/run.sh"] diff --git a/fastai-v3/Instructions.md b/fastai-v3/Instructions.md new file mode 100644 index 0000000..cb5b3b5 --- /dev/null +++ b/fastai-v3/Instructions.md @@ -0,0 +1,67 @@ +# Fast.ai Deep Learning Course v3 on Gradient Notebooks + +This is a quick guide to starting Part 3 of the fast.ai course Practical Deep Learning for Coders using Gradient Notebooks. With Gradient, you get quick access to a Jupyter instance (Lab or Notebook) without having to set up a virtual machine. Paperspace is a GPU-accelerated cloud platform + +### Summary of Charges +There are no storage fees associated with using Gradient Notebooks. Users pay hourly usage fees for the time that their Notebooks are Running. The hourly rate is dependent on the Compute Type selected, see all available types [here](https://support.paperspace.com/hc/en-us/articles/360002484474-Gradient-Pricing). Notebooks must be stopped to end billing. Learn more about Gradient billing [here](https://support.paperspace.com/hc/en-us/articles/360001369914-How-Does-Gradient-Billing-Work-). + +## Getting Set Up +### Step 1: Create a Paperspace Account +If you haven't already, you'll need to sign up for Paperspace [here](https://www.paperspace.com/account/signup). Confirm your account using the link in the email you receive from Paperspace. [Sign in to Paperspace](https://www.paperspace.com/account/login). + +![image](https://user-images.githubusercontent.com/585865/47126635-76af7c80-d257-11e8-8f33-b34be1ae8ef3.png) + + +### Step 2: Access Gradient & Create Notebook +I. On the left-hand side of your Console under Gradient, select Notebooks. + +II. Select the *Fast.ai 1.0 / PyTorch 1.0 BETA* base container. + +**Note: for Pro users, learn more about this docker container at the [paperspace/fastai-docker repo](https://github.com/Paperspace/fastai-docker/tree/fastai/pytorch1.0)** + +![image](https://user-images.githubusercontent.com/585865/47126835-719efd00-d258-11e8-8d8d-b402ef8baecc.png) + + +III. Select your Compute Type. + +![](https://support.paperspace.com/hc/article_attachments/360006919793/mceclip0.png) + +IV. Name your Notebook. + +V. Enter your payment details (if you're new to Paperspace). Even if you have a promo or referral code, all active Paperspace accounts must have a valid credit card on file. You'll be able to enter your promo code later. + +VI. Click Create Notebook + +When you click Create Notebook, that will start your Notebook and your billing for utilization will begin. To stop billing, you must stop your Notebook. Notebooks will automatically shut down after 12 hours. + +You'll be taken to your Notebook details page in your Console, where your Notebook will be created. It will go straight from Pending to Running, and will be ready to use. + +### Step 3: Stopping your Notebook +Under Action, just click stop. This will end the billing session. + +![image](https://user-images.githubusercontent.com/585865/47126987-29340f00-d259-11e8-8432-10e47d3edbe0.png) + +### Step 4: Restart your Notebook +Click Start to pick up where you left off, and/or choose a different VM type on which you'd like to run your Notebook. + +--- + +The Compute Type of your Notebook can be changed when you start it. What this means for you is that you can prepare your work inexpensively and add a GPU when you're ready to run your model/algorithm. + +![](https://support.paperspace.com/hc/article_attachments/360012358634/mceclip0.png) + +## Managing Data +Fast.ai data files (dogscats) can be found in the 'datasets' folder. Files in this directory are hosted by Paperspace and are read-only. See [Public Datasets](https://support.paperspace.com/hc/en-us/articles/360003092514-Public-Datasets) for more info. + +The `storage` folder is your [Persistent Storage](https://support.paperspace.com/hc/en-us/articles/360001468133-Persistent-Storage). Files placed here are available across runs of Paperspace Jobs, Notebooks, and Linux machines. Empty by default, this repository is meant to store training datasets. + +The rest of the files in the notebooks directories will be available as Artifacts when your notebook is stopped. + +## Wrapping up +Paperspace provides $10 of Gradient credit to start you off on your course. This code is to be used for fast.ai students only. In your console, click on Billing in the left-hand menu and enter the promo code at the bottom right. The promo code for this course is: *FASTAIGR45T*. + +Note: If you opt for a Gradient 1 Subscription, promotional credit does not apply. Learn more about Gradient Subscription levels here. + +Questions or issues related to course content, we recommend posting in the [fast.ai forum](http://forums.fast.ai/). + +For Paperspace-specific support, check out the rest of the Gradient Help Center or submit a support ticket with [this form](https://support.paperspace.com/hc/en-us/requests/new). diff --git a/fastai-v3/README.md b/fastai-v3/README.md new file mode 100644 index 0000000..3054270 --- /dev/null +++ b/fastai-v3/README.md @@ -0,0 +1,29 @@ +# Paperspace + Fast.ai Docker files + + +## Overview + +This is a docker build file designed to work with [Paperspace]. The latest pre-built runtimes are pushed here: https://hub.docker.com/r/paperspace/fastai/ + +This container pulls the latest fast.ai class. You can find this repo here: https://github.com/fastai/fastai and you can learn more about the Fast.ai course here: http://course.fast.ai/ + +This dockerfile pins the fastai "course-v3" repository to the commit hash: 2d532e82517a8b528b351fa6b2da985da0affe8b representing the master branch as of 1/24/2019 + +## Requirements: + +[Docker CE](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) + +[NVIDIA-docker](https://github.com/NVIDIA/nvidia-docker) + +Nvidia Drivers + + +## Build + +`sudo docker build -t paperspace/fastai .` + +## Pre-built runtimes + +You can also just run the following without having to build the entire container yourself. This will pull the container from Docker Hub. + +`sudo docker run --runtime=nvidia -d -p 8888:8888 paperspace/fastai:1.0-CUDA9.2-base-3.0-v1.0.6` diff --git a/fastai-v3/config.yml b/fastai-v3/config.yml new file mode 100644 index 0000000..7af34cd --- /dev/null +++ b/fastai-v3/config.yml @@ -0,0 +1,2 @@ +data_path: /storage + diff --git a/fastai-v3/enviroment.yaml b/fastai-v3/enviroment.yaml new file mode 100644 index 0000000..154d3be --- /dev/null +++ b/fastai-v3/enviroment.yaml @@ -0,0 +1,15 @@ +name: fastai +channels: + - conda-forge + - pytorch + - fastai +dependencies: + - pytorch + - torchvision + - cuda92 + - fastprogress + - fastai + - jupyter + - pip: + - nvidia-ml-py3 + - dataclasses \ No newline at end of file diff --git a/fastai-v3/run.sh b/fastai-v3/run.sh new file mode 100755 index 0000000..c57f28a --- /dev/null +++ b/fastai-v3/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash +source activate fastai +ln -s /storage /notebooks/course-v3/nbs/dl1/data +jupyter notebook --ip=0.0.0.0 --no-browser --allow-root