Skip to content

Commit

Permalink
pkg: fix skip links (#1572)
Browse files Browse the repository at this point in the history
(cherry picked from commit 50388cf)
  • Loading branch information
Borda committed Mar 10, 2023
1 parent dd653b3 commit 5d7b1aa
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 39 deletions.
58 changes: 20 additions & 38 deletions .azure/gpu-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ jobs:

variables:
DEVICES: $( python -c 'name = "$(Agent.Name)" ; gpus = name.split("_")[-1] if "_" in name else "0,1"; print(gpus)' )
HF_CACHE_DIR: "$(Pipeline.Workspace)/ci-cache_huggingface"
# these two caches assume to run repetitively on the same set of machines
# see: https://github.com/microsoft/azure-pipelines-agent/issues/4113#issuecomment-1439241481
TORCH_HOME: "/var/tmp/torch"
TRANSFORMERS_CACHE: "/var/tmp/huggingface"
FREEZE_REQUIREMENTS: 1

container:
Expand Down Expand Up @@ -86,7 +89,7 @@ jobs:
sudo apt-get install -y build-essential gcc g++ cmake ffmpeg git libsndfile1 unzip --no-install-recommends
pip install pip -U
pip install -e . -r ./requirements/devel.txt
# pip install pandas --force-reinstall # fixing some strange numpy erro for oldest config.
# pip install pandas --force-reinstall # fixing some strange numpy error for oldest config.
pip install mkl-service==2.4.0 # needed for the gpu multiprocessing
pip list
displayName: 'Install environment'
Expand All @@ -97,18 +100,14 @@ jobs:
python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu >= 2, f'GPU: {mgpu}'"
displayName: 'Sanity check'
- task: Cache@2
inputs:
key: transformers | "$(Agent.OS)"
restoreKeys: transformers
path: $(HF_CACHE_DIR)
cacheHitVar: HF_CACHE_RESTORED
- bash: |
printf "cache location: $(HF_CACHE_DIR)\n"
printf "hit the HF cache: $(variables.HF_CACHE_RESTORED)\n"
mkdir -p $(HF_CACHE_DIR) # in case cache was void
ls -lh $(HF_CACHE_DIR) # show what was restored...
displayName: 'Show HF cache'
printf "cache location: $(TORCH_HOME)\n"
mkdir -p $(TORCH_HOME) # in case cache was void
ls -lh $(TORCH_HOME)
printf "cache location: $(TRANSFORMERS_CACHE)\n"
mkdir -p $(TRANSFORMERS_CACHE) # in case cache was void
ls -lh $(TRANSFORMERS_CACHE)
displayName: 'Show caches'
- bash: python -m pytest torchmetrics --timeout=180 --durations=50
env:
Expand All @@ -124,9 +123,7 @@ jobs:
workingDirectory: tests
displayName: 'Pull testing data from S3'
- bash: |
python -m pytest unittests -v --cov=torchmetrics --timeout=180 --durations=500 \
--junitxml=$(Build.StagingDirectory)/test-results.xml
- bash: python -m pytest unittests -v --cov=torchmetrics --timeout=180 --durations=500
env:
CUDA_LAUNCH_BLOCKING: 1
workingDirectory: tests
Expand All @@ -135,32 +132,12 @@ jobs:
- bash: |
python -m coverage report
python -m coverage xml
python -m codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) --flags=gpu,unittest --name="GPU-coverage" --env=linux,azure
python -m codecov --token=$(CODECOV_TOKEN) --name="GPU-coverage" \
--commit=$(Build.SourceVersion) --flags=gpu,unittest --env=linux,azure
ls -l
workingDirectory: tests
env:
TRANSFORMERS_CACHE: $(HF_CACHE_DIR)
displayName: 'Statistics'
- task: PublishTestResults@2
displayName: 'Publish test results'
inputs:
testResultsFiles: '$(Build.StagingDirectory)/test-results.xml'
testRunTitle: '$(Agent.OS) - $(Build.DefinitionName) - Python $(python.version)'
condition: succeededOrFailed()
# if future steps should run even if this step fails
continueOnError: true

# todo: re-enable after schema check pass, also atm it seems does not have any effect
#- task: PublishCodeCoverageResults@1
# displayName: 'Publish coverage report'
# inputs:
# codeCoverageTool: 'Cobertura'
# summaryFileLocation: '$(Build.SourcesDirectory)/coverage.xml'
# reportDirectory: '$(Build.SourcesDirectory)/htmlcov'
# testRunTitle: '$(Agent.OS) - $(Build.BuildNumber)[$(Agent.JobName)] - Python $(python.version)'
# condition: succeededOrFailed()

- bash: |
set -e
FILES="*.py"
Expand Down Expand Up @@ -190,3 +167,8 @@ jobs:
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: 'python'
workingDirectory: tests
displayName: 'Test integrations'

- bash: |
printf "cache location: $(TRANSFORMERS_CACHE)\n"
ls -lh $(TRANSFORMERS_CACHE) # show what was restored...
displayName: 'Show HF artifacts'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ______________________________________________________________________
![Conda](https://img.shields.io/conda/dn/conda-forge/torchmetrics)
[![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/Lightning-AI/metrics/blob/master/LICENSE)

[![CI testing - complete](https://github.com/Lightning-AI/metrics/actions/workflows/ci_test-full.yml/badge.svg?event=push)](https://github.com/Lightning-AI/metrics/actions/workflows/ci_test-full.yml)
[![CI testing - complete](https://github.com/Lightning-AI/metrics/actions/workflows/ci-tests-full.yml/badge.svg?event=push)](https://github.com/Lightning-AI/metrics/actions/workflows/ci-tests-full.yml)
[![Build Status](https://dev.azure.com/Lightning-AI/Metrics/_apis/build/status/Lightning-AI.metrics?branchName=master)](https://dev.azure.com/Lightning-AI/Metrics/_build/latest?definitionId=3&branchName=master)
[![codecov](https://codecov.io/gh/Lightning-AI/metrics/branch/master/graph/badge.svg?token=NER6LPI3HS)](https://codecov.io/gh/Lightning-AI/metrics)

Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ def _parse_requirements(strs: Union[str, Iterable[str]]) -> Iterator[_Requiremen
line += next(lines)
except StopIteration:
return
if "@" in line or re.search("https?://", line):
# skip lines with links like `pesq @ git+https://github.com/ludlows/python-pesq`
continue
# If there's a pip argument, save it
if line.startswith("--"):
pip_argument = line
Expand Down

0 comments on commit 5d7b1aa

Please sign in to comment.