Skip to content

Commit

Permalink
@allow-large-files [vissl][PR] Update to v0.1.6 (facebookresearch#463)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: facebookresearch#463

Reviewed By: prigoyal

Differential Revision: D31994291

Pulled By: iseessel

fbshipit-source-id: 4337839903e54c8f1dae68d52ad837e60f967b81
  • Loading branch information
iseessel authored and facebook-github-bot committed Oct 28, 2021
1 parent a8e92f4 commit d19f398
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 21 deletions.
3 changes: 3 additions & 0 deletions dev/packaging/vissl_conda/build_all_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ set -ex

rm -rf dev/packaging/vissl_conda/ClassyVision
git clone https://github.com/facebookresearch/ClassyVision.git dev/packaging/vissl_conda/ClassyVision
cd dev/packaging/vissl_conda/ClassyVision
git reset --hard 4785d5ee19d3bcedd5b28c1eb51ea1f59188b54d
cd ../../../../

rm -rf dev/packaging/vissl_conda/fairscale
git clone https://github.com/facebookresearch/fairscale.git dev/packaging/vissl_conda/fairscale
Expand Down
7 changes: 6 additions & 1 deletion dev/packaging/vissl_pip/go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
# LICENSE file in the root directory of this source tree.
rm -rf ClassyVision
git clone https://github.com/facebookresearch/ClassyVision.git

cd ClassyVision || exit
git reset --hard 4785d5ee19d3bcedd5b28c1eb51ea1f59188b54d
cd ../ || exit

rm -rf ../../../classy_vision
cp -r ClassyVision/classy_vision ../../../classy_vision
rm -rf ../../../fairscale

sudo docker run --rm -v $PWD/../../..:/inside pytorch/conda-cuda bash inside/dev/packaging/vissl_pip/inside.sh
docker run --rm -v "$PWD/../../..:/inside pytorch/conda-cuda bash inside/dev/packaging/vissl_pip/inside.sh"
4 changes: 2 additions & 2 deletions dev/packaging/vissl_pip/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ that is assumed by the testing phase. E.g. on the FAIR cluster

```
module purge
module load cuda/10.1
module load NCCL/2.7.6-1-cuda.10.1
module load cuda/10.2
module load NCCL/2.7.8-1-cuda.11.0
```

2. Run `bash run.sh` in this directory.
10 changes: 5 additions & 5 deletions dev/packaging/vissl_pip/test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ source ~/.bashrc

conda create -y -n myenv python=3.7 opencv
conda activate myenv
conda install -y -c pytorch pytorch=1.5.1 cudatoolkit=10.1 torchvision
conda install pytorch==1.9.1 torchvision cudatoolkit=10.2 -c pytorch -c conda-forge

pip install -f https://dl.fbaipublicfiles.com/vissl/packaging/apexwheels/py37_cu101_pyt151/download.html apex
#pip install vissl --no-index -f https://dl.fbaipublicfiles.com/vissl/packaging/visslwheels/download.html
pip install vissl
python -c "import vissl, apex"
pip install -f https://dl.fbaipublicfiles.com/vissl/packaging/apexwheels/py37_cu102_pyt191/download.html apex
pip install vissl -f https://dl.fbaipublicfiles.com/vissl/packaging/visslwheels/download.html
pip install augly
python -c "import vissl, apex, augly"
cd loc1
python -m unittest discover -v -s tests
dev/run_quick_tests.sh
4 changes: 3 additions & 1 deletion tests/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from vissl.data.ssl_transforms.mnist_img_pil_to_rgb_mode import MNISTImgPil2RGB
from vissl.utils.hydra_config import compose_hydra_configuration, convert_to_attrdict
from vissl.utils.test_utils import (
augly_test,
in_temporary_directory,
run_integration_test,
)
Expand Down Expand Up @@ -83,14 +84,15 @@ def test_img_pil_to_multicrop(self):
for crop in crops[2:]:
self.assertEqual((96, 96), crop.size)

@augly_test()
def test_augly_transforms(self):
cfg = compose_hydra_configuration(
[
"config=test/cpu_test/test_cpu_resnet_simclr.yaml",
"+config/test/transforms=augly_transforms_example",
],
)
args, config = convert_to_attrdict(cfg)
_, config = convert_to_attrdict(cfg)

with in_temporary_directory() as _:
# Test that the training runs with an augly transformation.
Expand Down
1 change: 1 addition & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def create_valid_input(input_list):
"nearest_neighbor",
"feature_extraction",
"fb",
"test/transforms",
],
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@
"Python 3.7.12 (default, Sep 10 2021, 00:21:48) [GCC 7.5.0]\n",
"numpy 1.19.5\n",
"Pillow 7.1.2\n",
"vissl 0.1.5 @/content/vissl/vissl\n",
"vissl 0.1.6 @/content/vissl/vissl\n",
"GPU available True\n",
"GPU 0 Tesla K80\n",
"CUDA_HOME /usr/local/cuda\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@
"Python 3.7.12 (default, Sep 10 2021, 00:21:48) [GCC 7.5.0]\n",
"numpy 1.19.5\n",
"Pillow 7.1.2\n",
"vissl 0.1.5 @/content/vissl/vissl\n",
"vissl 0.1.6 @/content/vissl/vissl\n",
"GPU available True\n",
"GPU 0 Tesla K80\n",
"CUDA_HOME /usr/local/cuda\n",
Expand Down Expand Up @@ -2336,7 +2336,7 @@
"Python 3.7.12 (default, Sep 10 2021, 00:21:48) [GCC 7.5.0]\n",
"numpy 1.19.5\n",
"Pillow 7.1.2\n",
"vissl 0.1.5 @/content/vissl/vissl\n",
"vissl 0.1.6 @/content/vissl/vissl\n",
"GPU available True\n",
"GPU 0 Tesla K80\n",
"CUDA_HOME /usr/local/cuda\n",
Expand Down
4 changes: 2 additions & 2 deletions tutorials/Feature_Extraction_V0_1_6.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@
"Python 3.7.12 (default, Sep 10 2021, 00:21:48) [GCC 7.5.0]\n",
"numpy 1.19.5\n",
"Pillow 7.1.2\n",
"vissl 0.1.5 @/content/vissl/vissl\n",
"vissl 0.1.6 @/content/vissl/vissl\n",
"GPU available True\n",
"GPU 0 Tesla K80\n",
"CUDA_HOME /usr/local/cuda\n",
Expand Down Expand Up @@ -2277,7 +2277,7 @@
"Python 3.7.12 (default, Sep 10 2021, 00:21:48) [GCC 7.5.0]\n",
"numpy 1.19.5\n",
"Pillow 7.1.2\n",
"vissl 0.1.5 @/content/vissl/vissl\n",
"vissl 0.1.6 @/content/vissl/vissl\n",
"GPU available True\n",
"GPU 0 Tesla K80\n",
"CUDA_HOME /usr/local/cuda\n",
Expand Down
2 changes: 1 addition & 1 deletion tutorials/Train_SimCLR_on_1_gpu_V0_1_6.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@
"Python 3.7.12 (default, Sep 10 2021, 00:21:48) [GCC 7.5.0]\n",
"numpy 1.19.5\n",
"Pillow 7.1.2\n",
"vissl 0.1.5 @/content/vissl/vissl\n",
"vissl 0.1.6 @/content/vissl/vissl\n",
"GPU available True\n",
"GPU 0 Tesla K80\n",
"CUDA_HOME /usr/local/cuda\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@
"Python 3.7.12 (default, Sep 10 2021, 00:21:48) [GCC 7.5.0]\n",
"numpy 1.19.5\n",
"Pillow 7.1.2\n",
"vissl 0.1.5 @/content/vissl/vissl\n",
"vissl 0.1.6 @/content/vissl/vissl\n",
"GPU available True\n",
"GPU 0 Tesla K80\n",
"CUDA_HOME /usr/local/cuda\n",
Expand Down Expand Up @@ -1457,7 +1457,7 @@
"\n",
"\n",
"## Data Transforms\n",
"Image transforms are specified in `TRANSFORMS` and usually wrap the torchvision image transforms. However, one can easily [create their own transformations](https://vissl.readthedocs.io/en/v0.1.5/) or use any [Augly transformations](https://github.com/facebookresearch/AugLy). VISSL composes these data transforms for implementing many self-supervised methods as well. These transformations are run in order prior to being fed to the model.\n",
"Image transforms are specified in `TRANSFORMS` and usually wrap the torchvision image transforms. However, one can easily [create their own transformations](https://vissl.readthedocs.io/en/v0.1.6/) or use any [Augly transformations](https://github.com/facebookresearch/AugLy). VISSL composes these data transforms for implementing many self-supervised methods as well. These transformations are run in order prior to being fed to the model.\n",
"For example, in our training, we specify the transforms as below:\n",
"\n",
"```yaml\n",
Expand Down Expand Up @@ -1534,7 +1534,7 @@
"```\n",
"\n",
"## Measuring Performance\n",
"Meters are specified under the `METERS` config options. We currently support Accuracy, Precision@k, Recall@k, and Mean Average Precision (mAP). You can create your own Meter by following [these instructions](https://vissl.readthedocs.io/en/v0.1.5/extend_modules/meters.html).\n",
"Meters are specified under the `METERS` config options. We currently support Accuracy, Precision@k, Recall@k, and Mean Average Precision (mAP). You can create your own Meter by following [these instructions](https://vissl.readthedocs.io/en/v0.1.6/extend_modules/meters.html).\n",
"\n",
"For Example:\n",
"```yaml\n",
Expand All @@ -1556,7 +1556,7 @@
" RUN_ID: auto\n",
"```\n",
"\n",
"If running on more than one node, you will need to run this command on each of the nodes. We also offer [seamless integration with slurm](https://vissl.readthedocs.io/en/v0.1.5/train_resource_setup.html#train-on-slurm-cluster).\n",
"If running on more than one node, you will need to run this command on each of the nodes. We also offer [seamless integration with slurm](https://vissl.readthedocs.io/en/v0.1.6/train_resource_setup.html#train-on-slurm-cluster).\n",
"\n",
"\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion vissl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

__version__ = "0.1.5"
__version__ = "0.1.6"
18 changes: 18 additions & 0 deletions vissl/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from vissl.config.attr_dict import AttrDict
from vissl.hooks import default_hook_generator
from vissl.utils.distributed_launcher import launch_distributed
from vissl.utils.misc import is_augly_available


@contextmanager
Expand Down Expand Up @@ -92,6 +93,23 @@ def wrapped_test(*args, **kwargs):
return gpu_test_decorator


def augly_test():
"""
Annotation for Augly tests, skipping the test if the
required amount of Augly is not available
"""

def gpu_test_decorator(test_function: Callable):
@functools.wraps(test_function)
def wrapped_test(*args, **kwargs):
if is_augly_available():
return test_function(*args, **kwargs)

return wrapped_test

return gpu_test_decorator


def init_distributed_on_file(world_size: int, gpu_id: int, sync_file: str):
"""
Init the process group need to do distributed training, by syncing
Expand Down
5 changes: 4 additions & 1 deletion website/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
"localized-strings": {
"next": "Next",
"previous": "Previous",
"tagline": "A library for SOTA Self-Supervised Learning with images",
"tagline": "A library for state-of-the-art self-supervised learning from images",
"docs": {
"README": {
"title": "README"
},
"source/evaluations/feature_eval_settings": {
"title": "source/evaluations/feature_eval_settings"
}
},
"links": {
Expand Down

0 comments on commit d19f398

Please sign in to comment.