Skip to content

Commit

Permalink
remove nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
jph00 committed Dec 8, 2018
1 parent 37059d9 commit 04ed622
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 85 deletions.
12 changes: 1 addition & 11 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,11 @@ Github. Parentheses after an item show the name or github id of the contributor
of that change.






## 1.0.35.dev0 (Work In Progress)

### New:

### Changed:

### Fixed:

- Update deps to release version of pytorch v1


## 1.0.34 (2018-12-06)
Expand All @@ -32,7 +25,6 @@ of that change.
- pypi wheel `dataclasses` dependency for py3.6 is there again



## 1.0.33 (2018-12-05)

### New:
Expand All @@ -52,8 +44,6 @@ of that change.

## 1.0.32 (2018-12-02)

### New:

### Changed:

- `TabularDatBunch.from_df` accepts a `test_df` argument
Expand Down
27 changes: 9 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,18 @@ More advanced installation issues, such as installing only partial dependencies
* GPU

```bash
conda install -c pytorch pytorch-nightly cuda92
conda install -c fastai torchvision-nightly
conda install -c pytorch pytorch torchvision
conda install -c fastai fastai
```

* CPU

```bash
conda install -c pytorch pytorch-nightly-cpu
conda install -c fastai torchvision-nightly-cpu
conda install -c pytorch pytorch-cpu torchvision-cpu
conda install -c fastai fastai
```

On MacOS for non-GPU build install `pytorch-nightly` and `torchvision-nightly` instead of `pytorch-nightly-cpu` and `torchvision-nightly-cpu`.
On MacOS for non-GPU build install `pytorch` and `torchvision` instead of `pytorch-cpu` and `torchvision-cpu`.

Note that JPEG decoding can be a bottleneck, particularly if you have a fast CPU. You can optionally install an optimized JPEG decoder as follows (Linux):

Expand All @@ -71,20 +69,17 @@ CC="cc -mavx2" pip install --no-cache-dir -U --force-reinstall pillow-simd
* GPU

```bash
pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu92/torch_nightly.html
pip install torch torchvision
pip install fastai
```

* CPU

```bash
pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
pip install http://download.pytorch.org/whl/cpu/torch-1.0.0-cp36-cp36m-linux_x86_64.whl
pip install fastai
```

NB: this set will also fetch `torchvision-nightly`, which supports `torch-1.x`.



### Developer Install

Expand Down Expand Up @@ -166,28 +161,25 @@ conda install conda

Since fastai-1.0 relies on pytorch-1.0, you need to be able to install pytorch-1.0 first.

As of this moment pytorch.org's pre-1.0.0 version (`torch-nightly`) supports:
As of this moment pytorch.org's 1.0 version supports:

| Platform | GPU | CPU |
|----------|--------|--------|
| linux | binary | binary |
| mac | source | binary |
| windows | source | source |
| windows | binary | binary |

Legend: `binary` = can be installed directly, `source` = needs to be built from source.

This will change once `pytorch` 1.0.0 is released and installable packages made available for your system, which could take some time after the official release is made. Please watch for updates [here](https://pytorch.org/get-started/locally/).

If there is no `pytorch` preview conda or pip package available for your system, you may still be able to [build it from source](https://pytorch.org/get-started/locally/).

Alternatively, please consider installing and using the very solid "0.7.x" version of `fastai`. Please see the [instructions](https://github.com/fastai/fastai/tree/master/old).

4. How do you know which pytorch cuda version build to choose?

It depends on the version of the installed NVIDIA driver. Here are the requirements for CUDA versions supported by pre-built `pytorch-nightly` releases:
It depends on the version of the installed NVIDIA driver. Here are the requirements for CUDA versions supported by pre-built `pytorch` releases:

| CUDA Toolkit | NVIDIA (Linux x86_64) |
|--------------|-----------------------|
| CUDA 10.0 | >= 410.00 |
| CUDA 9.2 | >= 396.26 |
| CUDA 9.0 | >= 384.81 |
| CUDA 8.0 | >= 367.48 |
Expand All @@ -196,7 +188,6 @@ conda install conda
You can find a complete table with all variations [here](https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html).



## Updates

In order to update your environment, simply install `fastai` in exactly the same way you did the initial installation.
Expand Down
11 changes: 4 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ jobs:
# Install dependencies and fastai git HEAD or PR
- script: |
python -m pip install --upgrade pip && pip3 install --upgrade setuptools
pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
# test that we can install fastai package (and torchvision)
pip install torch torchvision
# test that we can install fastai package
pip install fastai
pip uninstall -y fastai
# install editable fastai, which tests the HEAD or PR
Expand Down Expand Up @@ -145,8 +145,7 @@ jobs:
conda install -y conda
conda install -y pip setuptools
# pytorch + torchvision
conda install -y -c pytorch pytorch-nightly-cpu
conda install -y -c fastai torchvision-nightly-cpu
conda install -y -c pytorch pytorch torchvision
# test that we can install fastai package
conda install -y -c fastai fastai
conda uninstall -y fastai
Expand Down Expand Up @@ -318,9 +317,7 @@ jobs:
conda install -y conda
conda install -y pip setuptools
# pytorch + torchvision
# pytorch on osx doesn't ship GPU builds, so pytorch-nightly is pytorch-nightly-cpu. while the latter package exists, it's not maintained since 20181014
conda install -y -c pytorch pytorch-nightly
conda install -y -c fastai torchvision-nightly
conda install -y -c pytorch pytorch torchvision
# test that we can install fastai package
conda install -y -c fastai fastai
conda uninstall -y fastai
Expand Down
29 changes: 11 additions & 18 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ requirements:

# skipped requirements:
# jupyter_contrib_nbextensions - only needed for internal tools - it's not on conda and requires too many of its own dependencies which aren't on conda either
# XXX: change pytorch-nightly to pytorch >=1.0.0 once it's released on conda
# XXX: change torchvision-nightly to torchvision >=0.2.2 once 0.2.2 (against pytorch-1.0) is released on conda
# XXX: temporarily pinning spacy and its dependencies (regex, thinc, and cymem) to have a stable environment during the course duration.
#
# note: "module # [py36]" tells conda-build that this requirement is only for python3.6, it's not a comment.
run:
Expand All @@ -62,14 +59,18 @@ requirements:
- python
- requests
- scipy
- spacy ==2.0.16
- regex ==2018.8.29
- thinc ==6.12.0
- cymem ==2.0.2
- spacy
- regex
- thinc
- cymem
- typing
- pyyaml
- pytorch >=1.0
- torchvision

# testing removal of stuff only used for doc() and dev-time
# Need to handle CPU vs GPU still

# Stuff only used for doc() and dev-time:
#- ipython
#- jupyter
#- notebook>=5.7.0
Expand All @@ -78,19 +79,10 @@ requirements:
#- traitlets

# removed these and instead are asking users to install those directly until a proper pytorch-1.0.0 and the corresponding torchvision are released on conda. otherwise can't support these two sets:
# - pytorch-nightly
# - torchvision-nightly
#
# - pytorch-nightly-cpu
# - torchvision-nightly-cpu

# removing until pytorch-1.0.0 release - conda can't handle these dependencies and tries to pull in pytorch-0.4.1 due to torchvision depending on it. yet, pytorch doesn't release torchvision nightly build... no way out
# - pytorch >=1.0.0

test:
imports:
# removing the loading test for now, since we temporarily made fastai conda package not depend on torch/torchvision due to dependencies hell - see above.
# - fastai
- fastai

requires:
- python
Expand Down Expand Up @@ -121,3 +113,4 @@ extra:
- setuptools >=0.39
- twine >=1.12
recipe-maintainers: ''

21 changes: 10 additions & 11 deletions docs/dev/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -937,8 +937,7 @@ conda create -y python=3.6 --name fastai-py3.6
conda activate fastai-py3.6
conda install -y conda
conda install -y pip setuptools
conda install -y -c pytorch pytorch-nightly cuda92
conda install -y -c fastai torchvision-nightly
conda install -y -c pytorch pytorch cuda92 torchvision
conda install -c fastai fastai
conda uninstall -y fastai
pip install -e .
Expand Down Expand Up @@ -1066,38 +1065,38 @@ AND |"numpy>=1.8,<2" |1.8, 1.9, not 2.0
`conda search` outputs results as following:
```
conda search -c pytorch "pytorch-nightly"
conda search -c pytorch "pytorch"
Loading channels: done
# Name Version Build Channel
pytorch-nightly 0.5.0.dev20180914 py3.5_cpu_0 pytorch
pytorch-nightly 0.5.0.dev20180914 py3.5_cuda8.0.61_cudnn7.1.2_0 pytorch
pytorch-nightly 0.5.0.dev20180914 py3.5_cuda9.0.176_cudnn7.1.2_0 pytorch
pytorch-nightly 0.5.0.dev20180914 py3.5_cuda9.2.148_cudnn7.1.4_0 pytorch
pytorch 0.5.0.dev20180914 py3.5_cpu_0 pytorch
pytorch 0.5.0.dev20180914 py3.5_cuda8.0.61_cudnn7.1.2_0 pytorch
pytorch 0.5.0.dev20180914 py3.5_cuda9.0.176_cudnn7.1.2_0 pytorch
pytorch 0.5.0.dev20180914 py3.5_cuda9.2.148_cudnn7.1.4_0 pytorch
[...]
```
To narrow the results, e.g. show only python3 cpu builds:
```
conda search -c pytorch "pytorch-nightly[build=py3*_cpu_0]"
conda search -c pytorch "pytorch[build=py3*_cpu_0]"
```
and then feed it to `conda install` with specific `==version=build` after the package name, e.g. `pytorch-nightly==1.0.0.dev20180916=py3.6_cpu_0`
and then feed it to `conda install` with specific `==version=build` after the package name, e.g. `pytorch==1.0.0.dev20180916=py3.6_cpu_0`
To search for packages for a given system (by default, packages for your current
platform are shown):
```
conda search -c pytorch "pytorch-nightly[subdir=osx-64]"
conda search -c pytorch "pytorch[subdir=osx-64]"
```
Some of the possible platforms include `linux-32`, `linux-64`, `win-64`, `osx-64`.
And these can be combined:
```
conda search -c pytorch "pytorch-nightly[subdir=osx-64, build=py3.7*]"
conda search -c pytorch "pytorch[subdir=osx-64, build=py3.7*]"
```
To search all packages released by user `fastai`:
Expand Down
13 changes: 7 additions & 6 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,34 @@ First, install `fastai` without its dependencies, and then install the dependenc

```
pip install --no-deps fastai
pip install "fastprogress>=0.1.15" "matplotlib" "numpy>=1.12" ...
pip install "fastprogress>=0.1.18" "matplotlib" "numpy>=1.12" ...
```
this will work with conda too:

```
conda install --no-deps -c fastai fastai
conda install -c fastai "fastprogress>=0.1.15" "matplotlib" "numpy>=1.12" ...
conda install -c fastai "fastprogress>=0.1.18" "matplotlib" "numpy>=1.12" ...
```

Don't forget to add `-c fastai` for the conda installs, e.g. it's needed for `torchvision-nightly`.
Don't forget to add `-c fastai` for the conda installs, e.g. it's needed for `torchvision`.

Below you will find the groups of dependencies for you to choose from. `fastai.base` is mandatory, the rest are optional:

```
fastai.base:
"fastprogress>=0.1.15" "matplotlib" "numpy>=1.12" "pandas" "bottleneck" "numexpr" "Pillow" "requests" "scipy" "typing" "pyyaml"
"fastprogress>=0.1.18" "matplotlib" "numpy>=1.12" "pandas" "bottleneck" "numexpr" "Pillow" "requests" "scipy" "typing" "pyyaml"
fastai.text:
"spacy==2.0.16" "regex" "thinc==6.12.0" "cymem==2.0.2"
"spacy" "regex" "thinc" "cymem"
fastai.text.qrnn:
"cupy"
fastai.vision:
"torchvision-nightly"
"torchvision"
```
2 changes: 1 addition & 1 deletion docs/troubleshoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ despite having `nvidia-smi` working just fine. Which means that `pytorch` can't

note: `pytorch` installs itself as `torch`. So we refer to the project and its packages as `pytorch`, but inside python we use it as `torch`.

First, starting with `pytorch-1.0.x` it doesn't matter which CUDA version you have installed on your system, always try first to install the latest `pytorch-nightly` with `cuda92` - it has all the required libraries built into the package. However, note, that you most likely will **need 396.xx+ driver for `pytorch` built with `cuda92`**. For older drivers you will probably need to install `pytorch` with `cuda90` or ever earlier.
First, starting with `pytorch-1.0.x` it doesn't matter which CUDA version you have installed on your system, always try first to install the latest `pytorch` - it has all the required libraries built into the package. However, note, that you most likely will **need 396.xx+ driver for `pytorch` built with `cuda92`**. For older drivers you will probably need to install `pytorch` with `cuda90` or ever earlier.

The only thing you to need to ensure is that you have a correctly configured NVIDIA driver, which usually you can test by running: `nvidia-smi` in your console.

Expand Down
2 changes: 1 addition & 1 deletion docs_src/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"To install or update fastai, we recommend `conda`:\n",
"\n",
"```\n",
"conda install -c pytorch -c fastai fastai pytorch-nightly cuda92\n",
"conda install -c pytorch -c fastai fastai pytorch\n",
"```\n",
"For troubleshooting, and alternative installations (including pip and CPU-only options) see the [fastai readme](https://github.com/fastai/fastai/blob/master/README.md)."
]
Expand Down
8 changes: 5 additions & 3 deletions fastai/vision/learner.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ def cnn_config(arch):
torch.backends.cudnn.benchmark = True
return model_meta.get(arch, _default_meta)

def create_body(model:nn.Module, cut:Optional[int]=None, body_fn:Callable[[nn.Module],nn.Module]=None):
def create_body(arch:Callable, pretrained:bool=True, cut:Optional[int]=None, body_fn:Callable[[nn.Module],nn.Module]=None):
"Cut off the body of a typically pretrained `model` at `cut` or as specified by `body_fn`."
model = arch(pretrained)
if not cut and not body_fn: cut = cnn_config(arch)['cut']
return (nn.Sequential(*list(model.children())[:cut]) if cut
else body_fn(model) if body_fn else model)

Expand All @@ -50,7 +52,7 @@ def create_cnn(data:DataBunch, arch:Callable, cut:Union[int,Callable]=None, pret
bn_final:bool=False, **kwargs:Any)->Learner:
"Build convnet style learners."
meta = cnn_config(arch)
body = create_body(arch(pretrained), ifnone(cut,meta['cut']))
body = create_body(arch, pretrained, cut)
nf = num_features_model(body) * 2
head = custom_head or create_head(nf, data.c, lin_ftrs, ps=ps, bn_final=bn_final)
model = nn.Sequential(body, head)
Expand All @@ -65,7 +67,7 @@ def unet_learner(data:DataBunch, arch:Callable, pretrained:bool=True, blur_final
self_attention:bool=False, **kwargs:Any)->None:
"Build Unet learners. `kwargs` are passed down to `conv_layer`."
meta = cnn_config(arch)
body = create_body(arch(pretrained), meta['cut'])
body = create_body(arch, pretrained)
model = to_device(models.unet.DynamicUnet(body, n_classes=data.c, blur=blur, blur_final=blur_final,
self_attention=self_attention, norm_type=norm_type), data.device)
learn = Learner(data, model, **kwargs)
Expand Down
15 changes: 6 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,11 @@ def to_list(buffer): return list(filter(None, map(str.strip, buffer.splitlines()
# pip install fastai
# pip install -e .
#
# XXX: to fix later in time:
# - require torch>=1.0.0 once it's released, for now get the user to install it explicitly
# - using a workaround for torchvision, once torch-1.0.0 is out and a new torchvision depending on it is released switch to torchvision>=0.2.2
# - temporarily pinning spacy and its dependencies (regex, thinc, and cymem) to have a stable environment during the course duration.
#
# notes:
# - bottleneck and numexpr are performance-improvement extras for numpy
#
# dependencies to skip for now:
# - cupy - is only required for QRNNs - sgguger thinks later he will get rid of this dep.
# - cupy - is only required for QRNNs - sgugger thinks later he will get rid of this dep.

requirements = to_list("""
bottleneck
Expand All @@ -46,9 +41,11 @@ def to_list(buffer): return list(filter(None, map(str.strip, buffer.splitlines()
regex
requests
scipy
spacy==2.0.16
thinc==6.12.0
torchvision-nightly
spacy
regex
thinc
cymem
torchvision
typing
""")

Expand Down

0 comments on commit 04ed622

Please sign in to comment.