Revision 868c5892cf7607cdeca3df386fa7810ca1ba9b67 authored by Ananth Subramaniam on 14 April 2021, 00:51:52 UTC, committed by Facebook GitHub Bot on 14 April 2021, 00:52:48 UTC
Reviewed By: shuyingsunshine21 Differential Revision: D27674288 fbshipit-source-id: 21af95adf952d632d10289a45fba6dd7cba6b2d9
1 parent 401d337
config.yml
# Use 2.1 for orbs
version: 2.1
# -------------------------------------------------------------------------------------
# Environments to run the jobs in
# -------------------------------------------------------------------------------------
gpu: &gpu
environment:
CUDA_VERSION: "10.2"
machine:
image: ubuntu-1604:201903-01
resource_class: gpu.medium
# -------------------------------------------------------------------------------------
# Re-usable commands
# -------------------------------------------------------------------------------------
cache_key: &cache_key cache-key-{{ .Environment.CIRCLE_JOB }}-{{ checksum ".circleci/config.yml" }}-{{ checksum "setup.py"}}-{{ checksum "requirements.txt"}}
install_dep: &install_dep
- run:
name: Install Dependencies
command: |
source activate mmf
pip install --upgrade setuptools
pip install --upgrade torch torchvision
pip install --progress-bar off flake8==3.7.9
pip install --progress-bar off black==19.3b0
pip install --progress-bar off isort==4.3.21
pip install --progress-bar off pytest
pip install --progress-bar off fairscale==0.3.2
python setup.py clean --all
python setup.py install
python -c 'import torch; print("Torch version:", torch.__version__)'
python -m torch.utils.collect_env
install_repo: &install_repo
- run:
name: Install Repository
command: |
source activate mmf
python setup.py build develop
run_unittests: &run_unittests
- run:
name: Run Unit Tests
command: |
source activate mmf
cd tests
pytest --junitxml=test-results/junit.xml -v .
install_nvidia_driver: &install_nvidia_driver
- run:
name: Install NVIDIA Driver
working_directory: ~/
command: |
wget -q --no-clobber -P ~/nvidia-downloads 'https://pytorch-ci-utils.s3.us-east-2.amazonaws.com/nvidia-drivers/NVIDIA-Linux-x86_64-440.64.run'
sudo /bin/bash ~/nvidia-downloads/NVIDIA-Linux-x86_64-440.64.run -s --no-drm
pyenv versions
nvidia-smi
pyenv global 3.7.0
create_conda_env: &create_conda_env
- run:
name: Install and Create Conda Environment
command: |
curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod +x ~/miniconda.sh
~/miniconda.sh -b -p $HOME/miniconda
rm ~/miniconda.sh
echo 'export PATH=$HOME/miniconda/bin:$PATH' >> $BASH_ENV
source $BASH_ENV
if [ ! -d ~/miniconda/envs/mmf ]
then
conda create -y -n mmf python=3.7
fi
source activate mmf
python --version
which python
which pip
pip install --upgrade pip
# -------------------------------------------------------------------------------------
# Jobs to run
# -------------------------------------------------------------------------------------
jobs:
# GPU config initially taken from detectron2
gpu_tests:
<<: *gpu
working_directory: ~/mmf
steps:
- checkout
# Cache the nvidia driver downloads
- restore_cache:
key: nvidia-downloads-v4
- <<: *install_nvidia_driver
- save_cache:
key: nvidia-downloads-v4
paths:
- "~/nvidia-downloads/"
- <<: *create_conda_env
- restore_cache:
key: *cache_key
- <<: *install_dep
# Cache the miniconda directory that contains dependencies
- save_cache:
paths:
- ~/miniconda/
key: *cache_key
- <<: *install_repo
- <<: *run_unittests
- store_test_results:
path: tests/test-results
workflows:
version: 2
build:
jobs:
- gpu_tests
Computing file changes ...