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

Commit a5c973b

Browse files
Initial commit
fbshipit-source-id: 8c68a6e8b640539a953e62f7dc5679e41656fd00
0 parents  commit a5c973b

File tree

740 files changed

+69041
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

740 files changed

+69041
-0
lines changed

.circleci/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# CircleCI for VISSL
2+
3+
We test every PR, commit on CircleCI (cpu and gpu tests) in CUDA 10.2, pip, python3 environment. See https://app.circleci.com/pipelines/github/facebookresearch/vissl .

.circleci/config.yml

+220
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
2+
# Python CircleCI 2.0 configuration file
3+
#
4+
# Check https://circleci.com/docs/2.0/language-python/ for more details
5+
#
6+
version: 2
7+
8+
# -------------------------------------------------------------------------------------
9+
# Environments to run the jobs in
10+
# -------------------------------------------------------------------------------------
11+
cpu: &cpu
12+
environment:
13+
TERM: xterm
14+
machine:
15+
image: default
16+
resource_class: medium
17+
18+
gpu: &gpu
19+
environment:
20+
CUDA_VER: "10.2"
21+
TORCH_CUDA_ARCH_LIST: "5.0;5.2;5.3"
22+
TERM: xterm
23+
machine:
24+
image: ubuntu-1604:201903-01
25+
resource_class: gpu.medium # Tesla M60
26+
27+
# -------------------------------------------------------------------------------------
28+
# Re-usable commands
29+
# -------------------------------------------------------------------------------------
30+
install_python: &install_python
31+
- run:
32+
name: Install Python
33+
working_directory: ~/
34+
command: |
35+
pyenv versions
36+
pyenv install 3.6.2
37+
pyenv global 3.6.2
38+
39+
update_gcc7: &update_gcc7
40+
- run:
41+
name: Update GCC7
42+
working_directory: ~/
43+
command: |
44+
sudo apt-get update
45+
sudo add-apt-repository ppa:jonathonf/gcc
46+
sudo apt-get update
47+
sudo apt-get install gcc-7 g++-7
48+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7 --slave /usr/bin/gcov gcov /usr/bin/gcov-7 --slave /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-7 --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-7 --slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-7 --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-7
49+
gcc --version
50+
g++ --version
51+
52+
install_classy_vision: &install_classy_vision
53+
- run:
54+
name: Install ClassyVision
55+
working_directory: ~/
56+
command: |
57+
pip uninstall -y classy_vision
58+
pip install classy-vision@https://github.com/facebookresearch/ClassyVision/tarball/master
59+
60+
setupcuda: &setupcuda
61+
run:
62+
name: Setup CUDA and NVIDIA driver
63+
working_directory: ~/
64+
command: |
65+
# download and install nvidia drivers, cuda, etc
66+
wget --no-verbose --no-clobber -P ~/nvidia-downloads 'https://s3.amazonaws.com/ossci-linux/nvidia_driver/NVIDIA-Linux-x86_64-430.40.run'
67+
wget --no-verbose --no-clobber -P ~/nvidia-downloads http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.run
68+
sudo /bin/bash ~/nvidia-downloads/NVIDIA-Linux-x86_64-430.40.run --no-drm -q --ui=none
69+
sudo sh ~/nvidia-downloads/cuda_10.2.89_440.33.01_linux.run --silent
70+
echo "Done installing CUDA."
71+
nvidia-smi
72+
73+
setup_venv: &setup_venv
74+
- run:
75+
name: Setup Virtual Environment
76+
command: |
77+
python -m venv ~/vissl_venv
78+
echo ". ~/vissl_venv/bin/activate" >> $BASH_ENV
79+
. ~/vissl_venv/bin/activate
80+
python --version
81+
which python
82+
which pip
83+
pip install --upgrade pip
84+
pip install -U setuptools
85+
86+
pip_list: &pip_list
87+
- run:
88+
name: Pip list
89+
command: |
90+
pip list
91+
92+
install_vissl_dep: &install_vissl_dep
93+
- run:
94+
name: Install Dependencies
95+
working_directory: ~/vissl
96+
command: |
97+
pip install --progress-bar off torch==1.5.0 torchvision==0.6.0 opencv-python==3.4.2.17
98+
pip install --progress-bar off -r requirements.txt
99+
100+
install_apex_gpu: &install_apex_gpu
101+
- run:
102+
name: Install Apex
103+
working_directory: ~/vissl
104+
environment:
105+
CUDA_VER: "10.2"
106+
TORCH_CUDA_ARCH_LIST: "5.0;5.2;5.3"
107+
command: |
108+
bash ./docker/common/install_apex.sh
109+
110+
install_apex_cpu: &install_apex_cpu
111+
- run:
112+
name: Install Apex for CPU
113+
working_directory: ~/vissl
114+
command: |
115+
pip install -v --no-cache-dir apex@https://github.com/NVIDIA/apex/tarball/1f2aa9156547377a023932a1512752c392d9bbdf
116+
117+
install_vissl: &install_vissl
118+
- run:
119+
name: Install VISSL
120+
command: |
121+
pip install -U --progress-bar off -e .[dev]
122+
123+
run_unittests: &run_unittests
124+
- run:
125+
name: Run CPU Unit Tests
126+
command: |
127+
python -m unittest discover -v -s tests
128+
129+
# -------------------------------------------------------------------------------------
130+
# Jobs to run (cpu and gpu)
131+
# -------------------------------------------------------------------------------------
132+
jobs:
133+
cpu_tests:
134+
<<: *cpu
135+
136+
working_directory: ~/vissl
137+
138+
steps:
139+
- checkout
140+
- <<: *install_python
141+
- <<: *setup_venv
142+
143+
# Cache the vissl_venv directory that contains dependencies
144+
- restore_cache:
145+
keys:
146+
- v2-cpu-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "setup.py" }}
147+
148+
- <<: *install_vissl_dep
149+
- <<: *install_classy_vision
150+
- <<: *install_apex_cpu
151+
- <<: *pip_list
152+
153+
- save_cache:
154+
paths:
155+
- ~/vissl_venv
156+
key: v2-cpu-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "setup.py" }}
157+
158+
- <<: *install_vissl
159+
160+
- run:
161+
name: isort
162+
command: |
163+
isort -y -sp .
164+
- run:
165+
name: black
166+
command: |
167+
black .
168+
- run:
169+
name: flake8
170+
command: |
171+
flake8 --max-line-length 88 --ignore E501,E203,E266,W503,E741 .
172+
173+
- <<: *run_unittests
174+
175+
gpu_tests:
176+
<<: *gpu
177+
178+
working_directory: ~/vissl
179+
180+
steps:
181+
- checkout
182+
- <<: *setupcuda
183+
- <<: *install_python
184+
- <<: *setup_venv
185+
186+
# Download and cache dependencies
187+
- restore_cache:
188+
keys:
189+
- v2-gpu-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "setup.py" }}-{{ checksum "docker/common/install_apex.sh" }}
190+
191+
- <<: *install_vissl_dep
192+
- <<: *install_classy_vision
193+
- <<: *update_gcc7
194+
- <<: *install_apex_gpu
195+
- <<: *pip_list
196+
197+
- run:
198+
name: Check CUDA Available
199+
command: python -c "import torch; assert torch.cuda.is_available(), 'CUDA not available'"
200+
201+
- save_cache:
202+
paths:
203+
- ~/vissl_venv
204+
key: v2-gpu-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "setup.py" }}-{{ checksum "docker/common/install_apex.sh" }}
205+
206+
- <<: *install_vissl
207+
208+
- run:
209+
name: Run GPU tests
210+
command: bash ./dev/run_quick_tests.sh
211+
212+
# -------------------------------------------------------------------------------------
213+
# Workflows
214+
# -------------------------------------------------------------------------------------
215+
workflows:
216+
version: 2
217+
build_and_test:
218+
jobs:
219+
- cpu_tests
220+
- gpu_tests

.github/CODE_OF_CONDUCT.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Code of Conduct
2+
3+
Facebook has adopted a Code of Conduct that we expect project participants to adhere to.
4+
Please read the [full text](https://code.fb.com/codeofconduct/)
5+
so that you can understand what actions will and will not be tolerated.

.github/CONTRIBUTING.md

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Contributing to VISSL
2+
We want to make contributing to this project as easy and transparent as possible.
3+
4+
## Our Development Process
5+
Minor changes and improvements will be released on an ongoing basis. Larger changes (e.g., changesets implementing a new SSL approach, benchmark, new scaling feature etc) will be released on a more periodic basis.
6+
7+
## Issues
8+
We use GitHub issues to track public bugs and questions. Please make sure to follow one of the
9+
[issue templates](https://github.com/facebookresearch/vissl/issues/new/choose)
10+
when reporting any issues.
11+
12+
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
13+
disclosure of security bugs. In those cases, please go through the process
14+
outlined on that page and do not file a public issue.
15+
16+
## Pull Requests
17+
We actively welcome your pull requests.
18+
19+
However, if you're adding any significant features (e.g. > 50 lines), please
20+
make sure to have a corresponding issue to discuss your motivation and proposals,
21+
before sending a PR. We do not always accept new features, and we take the following
22+
factors into consideration:
23+
24+
1. Whether the same feature can be achieved without modifying vissl.
25+
VISSL is designed to be extensible so that it's easy to extend any modular component and train custom models. If some part is not as extensible, you can also bring up the issue to make it more extensible.
26+
2. Whether the feature is potentially useful to a large audience, or only to a small portion of users.
27+
3. Whether the proposed solution has a good design / interface.
28+
4. Whether the proposed solution adds extra mental/practical overhead to users who don't
29+
need such feature.
30+
5. Whether the proposed solution breaks existing APIs.
31+
32+
When sending a PR, please do:
33+
34+
1. Fork the repo and create your branch from `master`.
35+
2. If a PR contains multiple orthogonal changes, split it to several PRs.
36+
3. If you've added code that should be tested, add tests.
37+
4. If you've changed APIs, update the documentation.
38+
5. Ensure the test suite passes. Follow [cpu test instructions](https://github.com/facebookresearch/vissl/blob/master/tests/README.md) and [integration tests][https://github.com/facebookresearch/vissl/blob/master/dev/run_quick_tests.sh].
39+
6. Make sure your code follows our coding practices (see next section).
40+
7. If you haven't already, complete the Contributor License Agreement ("CLA").
41+
42+
## Coding Style
43+
44+
Please follow [our coding practices](https://github.com/facebookresearch/vissl/blob/master/dev/README.md#practices-for-coding-quality) and choose either option to properly format your code before submitting PRs.
45+
46+
## Contributor License Agreement ("CLA")
47+
In order to accept your pull request, we need you to submit a CLA. You only need
48+
to do this once to work on any of Facebook's open source projects.
49+
50+
Complete your CLA here: <https://code.facebook.com/cla>
51+
52+
## License
53+
By contributing to ssl_framework, you agree that your contributions will be licensed
54+
under the LICENSE file in the root directory of this source tree.

.github/ISSUE_TEMPLATE/bugs.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: "🐛 Bugs"
3+
about: Report bugs in vissl
4+
title: Please read & provide the following
5+
6+
---
7+
8+
## Instructions To Reproduce the 🐛 Bug:
9+
10+
1. what changes you made (`git diff`) or what code you wrote
11+
```
12+
<put diff or code here>
13+
```
14+
2. what exact command you run:
15+
3. what you observed (including __full logs__):
16+
```
17+
<put logs here>
18+
```
19+
4. please simplify the steps as much as possible so they do not require additional resources to
20+
run, such as a private dataset.
21+
22+
## Expected behavior:
23+
24+
If there are no obvious error in "what you observed" provided above,
25+
please tell us the expected behavior.
26+
27+
## Environment:
28+
29+
Provide your environment information using the following command:
30+
```
31+
wget -nc -q https://github.com/facebookresearch/vissl/raw/master/vissl/utils/collect_env.py && python collect_env.py
32+
```
33+
34+
## When to expect Triage
35+
36+
VISSL devs and contributors aim to triage issues asap however, as a general guideline, we ask users to expect triaging in 1-2 weeks.
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: "\U0001F4DA VISSL Documentation"
3+
about: Report an issue related to VISSL documentation
4+
5+
---
6+
7+
## 📚 VISSL Documentation
8+
9+
A clear and concise description of what content in the [Docs](https://github.com/facebookresearch/vissl/tree/master/docs) is an issue.
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: "\U0001F680 Feature request"
3+
about: Suggest an improvement or new feature
4+
5+
---
6+
7+
## 🚀 Feature
8+
A clear and concise description of the feature proposal.
9+
10+
## Motivation & Examples
11+
12+
Tell us why the feature is useful.
13+
14+
Describe what the feature would look like, if it is implemented.
15+
Best demonstrated using **code examples** in addition to words.
16+
17+
## Note
18+
19+
1. We only consider adding new features if they are relevant to many users.
20+
21+
2. If your request is about a new ssl approach addition or new benchmarks, please choose [New Benchmark](https://github.com/facebookresearch/vissl/issues/new/choose) issue template or [New SSL Approach](https://github.com/facebookresearch/vissl/issues/new/choose) issue template.
22+
23+
3. "Make A faster" is not a valid feature request. "Implement a concrete feature that can make A faster" can be a valid feature request.
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: "\U0001F31F New Benchmark addition"
3+
about: Submit a proposal/request to implement a new SSL Benchmark in VISSL
4+
5+
---
6+
7+
# 🌟 New SSL Benchmark
8+
9+
## Approach description
10+
11+
Important information only describing the benchmark, link to the arXiv paper describing the benchmark method.
12+
13+
## Open source status
14+
15+
* [ ] the benchmark implementation is available: (give details)
16+
* [ ] the benchmark has been tested on few ssl approaches: (give details)
17+
* [ ] who are the authors: (mention them, if possible by @gh-username)
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: "\U0001F31F New SSL approach addition"
3+
about: Submit a proposal/request to implement a new SSL approach in VISSL
4+
5+
---
6+
7+
# 🌟 New SSL approach addition
8+
9+
## Approach description
10+
11+
Important information only describing the approach, link to the arXiv paper.
12+
13+
## Open source status
14+
15+
* [ ] the model implementation is available: (give details)
16+
* [ ] the model weights are available: (give details)
17+
* [ ] who are the authors: (mention them, if possible by @gh-username)

0 commit comments

Comments
 (0)