Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed May 12, 2023
2 parents 619b2de + 59dab9b commit 2740677
Show file tree
Hide file tree
Showing 600 changed files with 3,116 additions and 4,080 deletions.
4 changes: 1 addition & 3 deletions .azure/gpu-example-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ pr:
drafts: 'true'

jobs:
- template: testing-template.yml
- template: template-examples.yml
parameters:
domains:
- "image"
- "icevision"
- "vissl"
- "text"
- "tabular"
- "video"
96 changes: 43 additions & 53 deletions .azure/gpu-special-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,69 +19,59 @@ jobs:
timeoutInMinutes: "45"
# how much time to give 'run always even if cancelled tasks' before stopping them
cancelTimeoutInMinutes: "2"

pool: lit-rtx-3090
pool: "lit-rtx-3090"
variables:
DEVICES: $( python -c 'print("$(Agent.Name)".split("_")[-1])' )

container:
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.9-torch1.12-cuda11.6.1"
options: "--ipc=host --gpus=all"

# image: "pytorchlightning/pytorch_lightning:base-cuda-py3.9-torch1.11"
image: "pytorch/pytorch:1.11.0-cuda11.3-cudnn8-runtime"
options: "--ipc=host --gpus=all -v /usr/bin/docker:/tmp/docker:ro"
workspace:
clean: all

steps:

- bash: echo "##vso[task.setvariable variable=CUDA_VISIBLE_DEVICES]$(DEVICES)"
displayName: 'set visible devices'

- bash: |
echo $CUDA_VISIBLE_DEVICES
lspci | egrep 'VGA|3D'
whereis nvidia
nvidia-smi
python --version
pip --version
pip list
df -kh /dev/shm
displayName: 'Image info & NVIDIA'
- bash: |
echo "##vso[task.setvariable variable=CUDA_VISIBLE_DEVICES]$(DEVICES)"
echo "##vso[task.setvariable variable=CONTAINER_ID]$(head -1 /proc/self/cgroup|cut -d/ -f3)"
displayName: 'Set environment variables'
- bash: |
python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu >= 2, f'GPU: {mgpu}'"
displayName: 'Sanity check'
- script: |
/tmp/docker exec -t -u 0 $CONTAINER_ID \
sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
displayName: 'Install Sudo in container (thanks Microsoft!)'
- bash: |
# python -m pip install "pip==20.1"
pip install '.[image]' learn2learn
pip install '.[test]' --upgrade-strategy only-if-needed
pip list
displayName: 'Install dependencies'
- bash: |
echo $CUDA_VISIBLE_DEVICES
lspci | egrep 'VGA|3D'
whereis nvidia
nvidia-smi
python --version
pip --version
pip list
df -kh /dev/shm
displayName: 'Image info & NVIDIA'
- bash: |
bash tests/special_tests.sh
displayName: 'Testing: special'
- bash: |
python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu >= 2, f'GPU: {mgpu}'"
displayName: 'Sanity check'
- bash: |
python -m coverage report
python -m coverage xml
python -m coverage html
python -m codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) --flags=gpu,pytest --name="GPU-coverage" --env=linux,azure
ls -l
displayName: 'Statistics'
- script: |
sudo apt-get install -y build-essential gcc cmake software-properties-common
python -m pip install "pip==22.2.1"
pip --version
pip install '.[image,test]' -r requirements/testing_image.txt -U
pip list
env:
FREEZE_REQUIREMENTS: 1
displayName: 'Install dependencies'
- task: PublishTestResults@2
displayName: 'Publish test results'
inputs:
testResultsFiles: '$(Build.StagingDirectory)/test-results.xml'
testRunTitle: '$(Agent.OS) - $(Build.DefinitionName) - Python $(python.version)'
condition: succeededOrFailed()
- bash: |
bash tests/special_tests.sh
displayName: 'Testing: special'
- task: PublishCodeCoverageResults@1
displayName: 'Publish coverage report'
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: 'coverage.xml'
reportDirectory: '$(Build.SourcesDirectory)/htmlcov'
testRunTitle: '$(Agent.OS) - $(Build.BuildNumber)[$(Agent.JobName)] - Python $(python.version)'
condition: succeededOrFailed()
- bash: |
python -m coverage report
python -m coverage xml
# python -m codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) --flags=gpu,pytest --name="GPU-coverage" --env=linux,azure
ls -l
displayName: 'Statistics'
68 changes: 68 additions & 0 deletions .azure/template-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
jobs:
- ${{ each topic in parameters.domains }}:
- job:
displayName: "domain ${{topic}} with 2 GPU"
# how long to run the job before automatically cancelling
timeoutInMinutes: "45"
# how much time to give 'run always even if cancelled tasks' before stopping them
cancelTimeoutInMinutes: "2"

pool: "lit-rtx-3090"
variables:
DEVICES: $( python -c 'print("$(Agent.Name)".split("_")[-1])' )

# this need to have installed docker in the base image...
container:
# base ML image: mcr.microsoft.com/azureml/openmpi3.1.2-cuda10.2-cudnn8-ubuntu18.04
# image: "pytorchlightning/pytorch_lightning:base-cuda-py3.9-torch1.11"
image: "pytorch/pytorch:1.11.0-cuda11.3-cudnn8-runtime"
options: "-it --rm --gpus=all --shm-size=16g -v /usr/bin/docker:/tmp/docker:ro"

workspace:
clean: all
steps:

- bash: |
echo "##vso[task.setvariable variable=CUDA_VISIBLE_DEVICES]$(DEVICES)"
echo "##vso[task.setvariable variable=CONTAINER_ID]$(head -1 /proc/self/cgroup|cut -d/ -f3)"
displayName: 'Set environment variables'
- script: |
/tmp/docker exec -t -u 0 $CONTAINER_ID \
sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
displayName: 'Install Sudo in container (thanks Microsoft!)'
- bash: |
echo $CUDA_VISIBLE_DEVICES
lspci | egrep 'VGA|3D'
whereis nvidia
nvidia-smi
pip --version
pip list
df -kh /dev/shm
displayName: 'Image info & NVIDIA'
- script: |
python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu >= 2, f'GPU: {mgpu}'"
displayName: 'Sanity check'
- script: |
sudo apt-get install -y build-essential gcc cmake software-properties-common
python -m pip install "pip==22.2.1"
pip --version
pip install '.[${{topic}},test]' -r "requirements/testing_${{topic}}.txt" -U --prefer-binary
env:
FREEZE_REQUIREMENTS: 1
displayName: 'Install dependencies'
- script: |
pip list
python -m coverage run --source flash -m pytest tests/examples -vV --durations=30
displayName: 'Testing'
- bash: |
python -m coverage report
python -m coverage xml
# python -m codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) --flags=gpu,pytest --name="GPU-coverage" --env=linux,azure
ls -l
displayName: 'Statistics'
100 changes: 0 additions & 100 deletions .azure/testing-template.yml

This file was deleted.

Loading

0 comments on commit 2740677

Please sign in to comment.