Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit dac766a

Browse files
iseesselfacebook-github-bot
authored andcommitted
@allow-large-files [vissl][PR] V0.1.6 build fairscale pip pckg @allow-large-files (#465)
Summary: 1. Add fairscale to pip binary, as pypi won't allow you to have direct dependencies. 2. Change tutorials / installation from source instructions to reflect above. 3. I also moved up conda installation instructions to be first, since I think we should promote using conda (easier to manage environments). Pull Request resolved: #465 Reviewed By: QuentinDuval Differential Revision: D32069671 Pulled By: iseessel fbshipit-source-id: 54180d5882afa351c4c725bf4dbfa228b38cd7d5
1 parent d19f398 commit dac766a

11 files changed

+71
-24
lines changed

.circleci/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ update_gcc7: &update_gcc7
5454
gcc --version
5555
g++ --version
5656
57+
install_fairscale: &install_fairscale
58+
- run:
59+
name: Install Fairscale
60+
working_directory: ~/
61+
command: |
62+
pip uninstall -y fairscale
63+
pip install fairscale@https://github.com/facebookresearch/fairscale/tarball/df7db85cef7f9c30a5b821007754b96eb1f977b6
64+
65+
5766
install_classy_vision: &install_classy_vision
5867
- run:
5968
name: Install ClassyVision
@@ -170,6 +179,7 @@ jobs:
170179
- <<: *install_vissl_dep
171180
- <<: *install_augly
172181
- <<: *install_classy_vision
182+
- <<: *install_fairscale
173183
- <<: *install_apex_cpu
174184
- <<: *pip_list
175185

@@ -213,6 +223,7 @@ jobs:
213223

214224
- <<: *install_vissl_dep
215225
- <<: *install_classy_vision
226+
- <<: *install_fairscale
216227
- <<: *update_gcc7
217228
- <<: *install_apex_gpu
218229
- <<: *pip_list

INSTALL.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,27 @@ At a high level, project requires following system dependencies.
2626
## Installing VISSL from source (recommended)
2727
The following instructions assume that you have desired CUDA version installed and working.
2828

29-
### Install from source in PIP environment
29+
### Install from source in Conda environment
30+
31+
#### Step 1: Create Conda environment
32+
33+
If you don't have anaconda, [run this bash scrip to install conda](https://github.com/facebookresearch/vissl/blob/main/docker/common/install_conda.sh).
3034

31-
#### Step 1: Create Virtual environment (pip)
3235
```bash
33-
python3 -m venv ~/venv
34-
. ~/venv/bin/activate
36+
conda create -n vissl_env python=3.7
37+
source activate vissl_env
3538
```
3639

37-
#### Step 2: Install PyTorch (pip)
40+
#### Step 2: Install PyTorch (conda)
3841

3942
```bash
40-
pip install torch==1.7.1+cu101 torchvision==0.8.2+cu101 -f https://download.pytorch.org/whl/torch_stable.html
43+
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
4144
```
4245

43-
#### Step 3: Install APEX (pip)
46+
#### Step 3: Install APEX (conda)
4447

4548
```bash
46-
pip install -f https://dl.fbaipublicfiles.com/vissl/packaging/apexwheels/py37_cu101_pyt171/download.html apex
49+
conda install -c vissl apex
4750
```
4851

4952
#### Step 4: Install VISSL
@@ -58,36 +61,37 @@ git checkout -b v0.1.6
5861
# install vissl dependencies
5962
pip install --progress-bar off -r requirements.txt
6063
pip install opencv-python
61-
# update classy vision install to current main branch.
64+
# update classy vision install to commit stable for vissl.
65+
# Note: If building from vissl main, use classyvision main.
6266
pip uninstall -y classy_vision
63-
pip install classy-vision@https://github.com/facebookresearch/ClassyVision/tarball/main
67+
pip install classy-vision@https://github.com/facebookresearch/ClassyVision/tarball/4785d5ee19d3bcedd5b28c1eb51ea1f59188b54d
68+
# update fairscale install to commit stable for vissl.
69+
pip uninstall -y fairscale
70+
pip install fairscale@https://github.com/facebookresearch/fairscale/tarball/df7db85cef7f9c30a5b821007754b96eb1f977b6
6471
# install vissl dev mode (e stands for editable)
6572
pip install -e ".[dev]"
6673
# verify installation
6774
python -c 'import vissl, apex'
6875
```
6976

70-
### Install from source in Conda environment
71-
72-
#### Step 1: Create Conda environment
73-
74-
If you don't have anaconda, [run this bash scrip to install conda](https://github.com/facebookresearch/vissl/blob/main/docker/common/install_conda.sh).
77+
### Install from source in PIP environment
7578

79+
#### Step 1: Create Virtual environment (pip)
7680
```bash
77-
conda create -n vissl_env python=3.7
78-
source activate vissl_env
81+
python3 -m venv ~/venv
82+
. ~/venv/bin/activate
7983
```
8084

81-
#### Step 2: Install PyTorch (conda)
85+
#### Step 2: Install PyTorch (pip)
8286

8387
```bash
84-
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
88+
pip install torch==1.7.1+cu101 torchvision==0.8.2+cu101 -f https://download.pytorch.org/whl/torch_stable.html
8589
```
8690

87-
#### Step 3: Install APEX (conda)
91+
#### Step 3: Install APEX (pip)
8892

8993
```bash
90-
conda install -c vissl apex
94+
pip install -f https://dl.fbaipublicfiles.com/vissl/packaging/apexwheels/py37_cu101_pyt171/download.html apex
9195
```
9296

9397
#### Step 4: Install VISSL

dev/packaging/vissl_pip/go.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@ git clone https://github.com/facebookresearch/ClassyVision.git
99
cd ClassyVision || exit
1010
git reset --hard 4785d5ee19d3bcedd5b28c1eb51ea1f59188b54d
1111
cd ../ || exit
12-
1312
rm -rf ../../../classy_vision
1413
cp -r ClassyVision/classy_vision ../../../classy_vision
14+
15+
rm -rf fairscale
16+
git clone https://github.com/facebookresearch/fairscale.git
17+
cd fairscale || exit
18+
git reset --hard df7db85cef7f9c30a5b821007754b96eb1f977b6
19+
cd ../ || exit
1520
rm -rf ../../../fairscale
21+
cp -r fairscale/fairscale ../../../fairscale
1622

17-
docker run --rm -v "$PWD/../../..:/inside pytorch/conda-cuda bash inside/dev/packaging/vissl_pip/inside.sh"
23+
docker run --rm -v $PWD/../../..:/inside pytorch/conda-cuda bash inside/dev/packaging/vissl_pip/inside.sh

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Keep this sorted for easy search.
22
# Keep versions pinned for testing reproducibility.
33
cython==0.29.22
4-
fairscale@https://github.com/facebookresearch/fairscale/tarball/df7db85cef7f9c30a5b821007754b96eb1f977b6
54
fvcore==0.1.3.post20210317
65
iopath==0.1.9
76
hydra-core==1.0.7

tutorials/Benchmark_Full_Finetuning_on_ImageNet_1K_V0_1_6.ipynb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@
8787
"!pip uninstall -y classy_vision\n",
8888
"!pip install classy-vision@https://github.com/facebookresearch/ClassyVision/tarball/4785d5ee19d3bcedd5b28c1eb51ea1f59188b54d\n",
8989
"\n",
90+
"# Update fairscale to commit compatible with v0.1.6\n",
91+
"!pip uninstall -y fairscale\n",
92+
"!pip install fairscale@https://github.com/facebookresearch/fairscale/tarball/df7db85cef7f9c30a5b821007754b96eb1f977b6\n",
93+
"\n",
9094
"# install vissl dev mode (e stands for editable)\n",
9195
"!pip install -e .[dev]"
9296
]

tutorials/Benchmark_Linear_Image_Classification_on_ImageNet_1K_V0_1_6.ipynb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@
8787
"!pip uninstall -y classy_vision\n",
8888
"!pip install classy-vision@https://github.com/facebookresearch/ClassyVision/tarball/4785d5ee19d3bcedd5b28c1eb51ea1f59188b54d\n",
8989
"\n",
90+
"# Update fairscale to commit compatible with v0.1.6\n",
91+
"!pip uninstall -y fairscale\n",
92+
"!pip install fairscale@https://github.com/facebookresearch/fairscale/tarball/df7db85cef7f9c30a5b821007754b96eb1f977b6\n",
93+
"\n",
9094
"# install vissl dev mode (e stands for editable)\n",
9195
"!pip install -e .[dev]"
9296
]

tutorials/Feature_Extraction_V0_1_6.ipynb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@
9494
"!pip uninstall -y classy_vision\n",
9595
"!pip install classy-vision@https://github.com/facebookresearch/ClassyVision/tarball/4785d5ee19d3bcedd5b28c1eb51ea1f59188b54d\n",
9696
"\n",
97+
"# Update fairscale to commit compatible with v0.1.6\n",
98+
"!pip uninstall -y fairscale\n",
99+
"!pip install fairscale@https://github.com/facebookresearch/fairscale/tarball/df7db85cef7f9c30a5b821007754b96eb1f977b6\n",
100+
"\n",
97101
"# install vissl dev mode (e stands for editable)\n",
98102
"!pip install -e .[dev]"
99103
]

tutorials/Installation_V0_1_6.ipynb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@
181181
"# update classy vision install to current main.\n",
182182
"pip uninstall -y classy_vision\n",
183183
"pip install classy-vision@https://github.com/facebookresearch/ClassyVision/tarball/main\n",
184+
"# Update fairscale to commit compatible with vissl main.\n",
185+
"!pip uninstall -y fairscale\n",
186+
"!pip install fairscale@https://github.com/facebookresearch/fairscale/tarball/df7db85cef7f9c30a5b821007754b96eb1f977b6\n",
184187
"# install vissl dev mode (e stands for editable)\n",
185188
"pip install -e .[dev]\n",
186189
"# verify installation\n",

tutorials/Train_SimCLR_on_1_gpu_V0_1_6.ipynb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@
9494
"!pip uninstall -y classy_vision\n",
9595
"!pip install classy-vision@https://github.com/facebookresearch/ClassyVision/tarball/4785d5ee19d3bcedd5b28c1eb51ea1f59188b54d\n",
9696
"\n",
97+
"# Update fairscale to commit compatible with v0.1.6\n",
98+
"!pip uninstall -y fairscale\n",
99+
"!pip install fairscale@https://github.com/facebookresearch/fairscale/tarball/df7db85cef7f9c30a5b821007754b96eb1f977b6\n",
100+
"\n",
97101
"# install vissl dev mode (e stands for editable)\n",
98102
"!pip install -e .[dev]"
99103
]

tutorials/Understanding_VISSL_Training_and_YAML_Config_V0_1_6.ipynb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@
9191
"!pip uninstall -y classy_vision\n",
9292
"!pip install classy-vision@https://github.com/facebookresearch/ClassyVision/tarball/4785d5ee19d3bcedd5b28c1eb51ea1f59188b54d\n",
9393
"\n",
94+
"# Update fairscale to commit compatible with v0.1.6\n",
95+
"!pip uninstall -y fairscale\n",
96+
"!pip install fairscale@https://github.com/facebookresearch/fairscale/tarball/df7db85cef7f9c30a5b821007754b96eb1f977b6\n",
97+
"\n",
9498
"# install vissl dev mode (e stands for editable)\n",
9599
"!pip install -e .[dev]"
96100
]

0 commit comments

Comments
 (0)