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

circleci updated #580

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2
version: 2.1

# -------------------------------------------------------------------------------------
# Environments to run the jobs in
# -------------------------------------------------------------------------------------

cpu: &cpu
docker:
- image: circleci/python:3.8
- image: circleci/python:3.10
resource_class: medium
parallelism: 10 # Number of parallel executors

gpu: &gpu
environment:
CUDA_VERSION: "11.1"
CUDA_HOME: /usr/local/cuda-11.1
CUDA_VERSION: "11.6"
CUDA_HOME: /usr/local/cuda-11.6
TERM: xterm
machine:
image: ubuntu-1604-cuda-11.1:202012-01
image: linux-cuda-11:2023.02.1
resource_class: gpu.nvidia.medium.multi # Tesla T4

# -------------------------------------------------------------------------------------
Expand All @@ -38,24 +38,24 @@ install_python: &install_python
working_directory: ~/
command: |
pyenv versions
pyenv install -f 3.7.0
pyenv global 3.7.0
pyenv install -f 3.10.6
pyenv global 3.10.6

install_fairscale: &install_fairscale
- run:
name: Install Fairscale
working_directory: ~/
command: |
pip uninstall -y fairscale
pip install fairscale==0.4.6
pip install fairscale==0.4.13

install_classy_vision: &install_classy_vision
- run:
name: Install ClassyVision
working_directory: ~/
command: |
pip uninstall -y classy_vision
pip install classy-vision@https://github.com/facebookresearch/ClassyVision/tarball/4785d5ee19d3bcedd5b28c1eb51ea1f59188b54d
pip install classy-vision@https://github.com/facebookresearch/ClassyVision/tarball/74e83dd97afbc9371b336304af09548f5080fa9c


setup_venv: &setup_venv
Expand All @@ -75,6 +75,12 @@ setup_venv: &setup_venv
pip --version
pip install -U setuptools

select_cuda: &select_cuda
- run:
name: Select CUDA
command: |
sudo update-alternatives --set cuda /usr/local/cuda-<< parameters.cuda_version >>

pip_list: &pip_list
- run:
name: Pip list
Expand All @@ -86,8 +92,8 @@ install_vissl_dep: &install_vissl_dep
name: Install VISSL Dependencies
working_directory: ~/vissl
command: |
pip install --progress-bar off torch==1.8.1+cu111 torchvision==0.9.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html
pip install --progress-bar off opencv-python==4.5.1.48
pip install --progress-bar off torch==1.13.1+cu116 torchvision==0.14.1+cu116 -f https://download.pytorch.org/whl/torch_stable.html
pip install --progress-bar off opencv-python==4.7.0.72
pip install --progress-bar off -r requirements.txt
# Update this since classy_vision seems to need it.
pip install --progress-bar off --upgrade iopath
Expand All @@ -109,18 +115,18 @@ install_apex_cpu: &install_apex_cpu
working_directory: ~/vissl
environment:
# Variable used by pip install of apex
TORCH_CUDA_ARCH_LIST: "5.0;5.2;5.3"
# TORCH_CUDA_ARCH_LIST: "6.0;6.1;6.2;7.0;7.5;8.0;8.6"
command: |
pip install -v --disable-pip-version-check --no-cache-dir apex@https://github.com/NVIDIA/apex/tarball/9ce0a10fb6c2537ef6a59f27b7875e32a9e9b8b8
pip install -v --disable-pip-version-check --no-cache-dir apex@https://github.com/NVIDIA/apex/tarball/95cea8e3e5b55b0260cc16279f2647412142d53e

install_apex_gpu: &install_apex_gpu
- run:
name: Install Apex
working_directory: ~/vissl
environment:
# Both variables are used by install_apex.sh
CUDA_VER: "11.1"
TORCH_CUDA_ARCH_LIST: "5.0;5.2;5.3"
CUDA_VER: "11.6"
TORCH_CUDA_ARCH_LIST: "6.0;6.1;6.2;7.0;7.5;8.0;8.6"
command: |
bash ./docker/common/install_apex.sh

Expand Down
31 changes: 31 additions & 0 deletions .github/workflow/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI
on: [push, pull_request]

# Run linter with github actions for quick feedbacks.
# Run macos tests with github actions. Linux (CPU & GPU) tests currently runs on CircleCI
jobs:
linter:
runs-on: ubuntu-latest
# run on PRs, or commits to facebookresearch (not internal)
if: ${{ github.repository_owner == 'facebookresearch' || github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.10
- name: Install dependencies
# flake8-bugbear flake8-comprehensions are useful but not available internally
run: |
python -m pip install --upgrade pip
python -m pip install flake8==6.0.0 isort==5.12.0
python -m pip install black==23.1.0
flake8 --version
- name: Lint
run: |
echo "Running isort"
isort -c -sp .
echo "Running black"
black -l 100 --check .
echo "Running flake8"
flake8 .
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: check-ast
Expand All @@ -16,19 +16,19 @@ repos:

- repo: https://github.com/psf/black
# rev: 19.3b0 # Replace by any tag/version: https://github.com/psf/black/tags
rev: 22.3.0
rev: 23.1.0
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.0
rev: 6.0.0
hooks:
- id: flake8
args: ['--max-line-length=88', '--ignore=E501,E203,E266,W503,E741']

- repo: https://github.com/pycqa/isort
rev: 5.8.0
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
Expand Down
2 changes: 1 addition & 1 deletion docker/common/install_apex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ nvcc --version
export TORCH_CUDA_ARCH_LIST=${TORCH_CUDA_ARCH_LIST}

# install apex now (note that we recommend a specific apex version for stability)
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" apex@https://github.com/NVIDIA/apex/tarball/9ce0a10fb6c2537ef6a59f27b7875e32a9e9b8b8
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" apex@https://github.com/NVIDIA/apex/tarball/95cea8e3e5b55b0260cc16279f2647412142d53e

popd

Expand Down
2 changes: 1 addition & 1 deletion docker/common/install_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ popd
export PATH=/opt/conda/bin:$PATH

## Follow the steps below to create and activate a conda environment.
conda create --name vissl_env python=3.6
conda create --name vissl_env python=3.10
bash -c "source activate vissl_env"
export PATH="/opt/conda/envs/vissl_env/bin:${PATH}"

Expand Down
6 changes: 3 additions & 3 deletions docker/conda/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG CUDA_VER
ARG CUDA_SUFFIX

# we always use cudnn version 7
FROM nvidia/cuda:${CUDA_VER}-cudnn7-devel
# we always use cudnn version 8
FROM nvidia/cuda:${CUDA_VER}-cudnn8-devel

ENV DEBIAN_FRONTEND noninteractive

Expand All @@ -24,7 +24,7 @@ RUN ./install_conda.sh && rm install_conda.sh
ENV PATH="/opt/conda/bin:${PATH}"

# install PyTorch.
RUN conda install pytorch==1.9.1 torchvision cudatoolkit=${CUDA_VER} -c pytorch -c conda-forge
RUN conda install pytorch==1.13.1 torchvision cudatoolkit=${CUDA_VER} -c pytorch -c conda-forge

# install apex
RUN conda install apex -c vissl
Expand Down
22 changes: 11 additions & 11 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Keep this sorted for easy search.
# Keep versions pinned for testing reproducibility.
cython==0.29.22
fvcore==0.1.3.post20210317
iopath==0.1.9
hydra-core==1.0.7
numpy==1.19.5
parameterized==0.7.4
scikit-learn==0.24.1
submitit==1.3.3
tabulate==0.8.9
timm==0.6.11
pandas
cython==0.29.33
fvcore==0.1.5.post20221221
iopath==0.1.10
hydra-core==1.3.2
numpy==1.23.5
parameterized==0.8.1
scikit-learn==1.2.1
submitit==1.4.5
tabulate==0.9.0
timm==0.6.12
pandas==1.5.3