metrics/azure-pipelines.yml

99 строки
3.2 KiB
YAML
Исходник Постоянная ссылка Обычный вид История

# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
trigger:
tags:
include:
- '*'
branches:
include:
- master
- release/*
- refs/tags/*
pr:
- master
- release/*
jobs:
- job: pytest
# 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: gridai-spot-pool
container:
audio metrics: SNR, SI_SDR, SI_SNR (#292) * add snr, si_sdr, si_snr * format * add noqa: F401 to __init__.py * remove types in doc, change estimate to preds, remove EPS * update functional.rst * update CHANGELOG.md * switch preds and target * switch preds and target in Example * add SNR, SI_SNR, SI_SDR module implementation * add test * add module doc * use _check_same_shape * to alphabetical order * update test * move Base to the top of Audio * add soundfile * gcc * fix mocking * image * doctest * mypy * fix requirements * fix dtype * something * update * adjust * Apply suggestions from code review * update test_snr * update test_si_snr * new snr: use torch.finfo(preds.dtype).eps * update test_snr.py * new si_sdr imp * update test_si_sdr * update test_si_snr * remove pb_bss_eval * add museval * update test files * remove museval * add funcs update return None annotation * add 'Setup ffmpeg' * update "Setup ffmpeg" * use setup-conda@v1 * multi-OS * update atol to 1e-5 * Apply suggestions from code review * change atol to 1e-2 * update * fix 'Setup Linux' not activated * add sudo * reduce Time to 100 to reduce the test time * increase timeoutInMinutes to 40 * install ffmpeg * timeout-minutes to 55 * +git * show-error-codes * .detach().cpu().numpy() first * add numpy * numpy * ignore_errors torchmetrics.audio.* * solve mypy no-redef error * remove --quiet * pypesq * apt * add # type: ignore * try without test_si_snr & test_si_sdr * test_import_speechmetrics * test_speechmetrics_si_sdr * test_si_sdr_functional * test audio only * install libsndfile1 * add sisnr sisdr test * test all & add quiet & remove test_speechmetrics * remove sudo & install libsndfile1 * add test * update * fix tests * typing * fix typing * fix bus error * SRMRpy * pesq * gcc * comment -u root cuda 10.2 whoami * env Co-authored-by: quancs <quancs@qq.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Nicki Skafte <skaftenicki@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Jirka <jirka.borovec@seznam.cz> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
2021-06-22 20:39:22 +03:00
image: "pytorch/pytorch:1.8.1-cuda10.2-cudnn7-runtime"
options: "--runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all --name ci-container -v /usr/bin/docker:/tmp/docker:ro"
workspace:
clean: all
steps:
- bash: |
audio metrics: SNR, SI_SDR, SI_SNR (#292) * add snr, si_sdr, si_snr * format * add noqa: F401 to __init__.py * remove types in doc, change estimate to preds, remove EPS * update functional.rst * update CHANGELOG.md * switch preds and target * switch preds and target in Example * add SNR, SI_SNR, SI_SDR module implementation * add test * add module doc * use _check_same_shape * to alphabetical order * update test * move Base to the top of Audio * add soundfile * gcc * fix mocking * image * doctest * mypy * fix requirements * fix dtype * something * update * adjust * Apply suggestions from code review * update test_snr * update test_si_snr * new snr: use torch.finfo(preds.dtype).eps * update test_snr.py * new si_sdr imp * update test_si_sdr * update test_si_snr * remove pb_bss_eval * add museval * update test files * remove museval * add funcs update return None annotation * add 'Setup ffmpeg' * update "Setup ffmpeg" * use setup-conda@v1 * multi-OS * update atol to 1e-5 * Apply suggestions from code review * change atol to 1e-2 * update * fix 'Setup Linux' not activated * add sudo * reduce Time to 100 to reduce the test time * increase timeoutInMinutes to 40 * install ffmpeg * timeout-minutes to 55 * +git * show-error-codes * .detach().cpu().numpy() first * add numpy * numpy * ignore_errors torchmetrics.audio.* * solve mypy no-redef error * remove --quiet * pypesq * apt * add # type: ignore * try without test_si_snr & test_si_sdr * test_import_speechmetrics * test_speechmetrics_si_sdr * test_si_sdr_functional * test audio only * install libsndfile1 * add sisnr sisdr test * test all & add quiet & remove test_speechmetrics * remove sudo & install libsndfile1 * add test * update * fix tests * typing * fix typing * fix bus error * SRMRpy * pesq * gcc * comment -u root cuda 10.2 whoami * env Co-authored-by: quancs <quancs@qq.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Nicki Skafte <skaftenicki@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Jirka <jirka.borovec@seznam.cz> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
2021-06-22 20:39:22 +03:00
whoami
id
lspci | egrep 'VGA|3D'
whereis nvidia
nvidia-smi
python --version
pip --version
pip list
displayName: 'Image info & NVIDIA'
audio metrics: SNR, SI_SDR, SI_SNR (#292) * add snr, si_sdr, si_snr * format * add noqa: F401 to __init__.py * remove types in doc, change estimate to preds, remove EPS * update functional.rst * update CHANGELOG.md * switch preds and target * switch preds and target in Example * add SNR, SI_SNR, SI_SDR module implementation * add test * add module doc * use _check_same_shape * to alphabetical order * update test * move Base to the top of Audio * add soundfile * gcc * fix mocking * image * doctest * mypy * fix requirements * fix dtype * something * update * adjust * Apply suggestions from code review * update test_snr * update test_si_snr * new snr: use torch.finfo(preds.dtype).eps * update test_snr.py * new si_sdr imp * update test_si_sdr * update test_si_snr * remove pb_bss_eval * add museval * update test files * remove museval * add funcs update return None annotation * add 'Setup ffmpeg' * update "Setup ffmpeg" * use setup-conda@v1 * multi-OS * update atol to 1e-5 * Apply suggestions from code review * change atol to 1e-2 * update * fix 'Setup Linux' not activated * add sudo * reduce Time to 100 to reduce the test time * increase timeoutInMinutes to 40 * install ffmpeg * timeout-minutes to 55 * +git * show-error-codes * .detach().cpu().numpy() first * add numpy * numpy * ignore_errors torchmetrics.audio.* * solve mypy no-redef error * remove --quiet * pypesq * apt * add # type: ignore * try without test_si_snr & test_si_sdr * test_import_speechmetrics * test_speechmetrics_si_sdr * test_si_sdr_functional * test audio only * install libsndfile1 * add sisnr sisdr test * test all & add quiet & remove test_speechmetrics * remove sudo & install libsndfile1 * add test * update * fix tests * typing * fix typing * fix bus error * SRMRpy * pesq * gcc * comment -u root cuda 10.2 whoami * env Co-authored-by: quancs <quancs@qq.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Nicki Skafte <skaftenicki@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Jirka <jirka.borovec@seznam.cz> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
2021-06-22 20:39:22 +03:00
- script: |
/tmp/docker exec -t -u 0 ci-container \
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: |
audio metrics: SNR, SI_SDR, SI_SNR (#292) * add snr, si_sdr, si_snr * format * add noqa: F401 to __init__.py * remove types in doc, change estimate to preds, remove EPS * update functional.rst * update CHANGELOG.md * switch preds and target * switch preds and target in Example * add SNR, SI_SNR, SI_SDR module implementation * add test * add module doc * use _check_same_shape * to alphabetical order * update test * move Base to the top of Audio * add soundfile * gcc * fix mocking * image * doctest * mypy * fix requirements * fix dtype * something * update * adjust * Apply suggestions from code review * update test_snr * update test_si_snr * new snr: use torch.finfo(preds.dtype).eps * update test_snr.py * new si_sdr imp * update test_si_sdr * update test_si_snr * remove pb_bss_eval * add museval * update test files * remove museval * add funcs update return None annotation * add 'Setup ffmpeg' * update "Setup ffmpeg" * use setup-conda@v1 * multi-OS * update atol to 1e-5 * Apply suggestions from code review * change atol to 1e-2 * update * fix 'Setup Linux' not activated * add sudo * reduce Time to 100 to reduce the test time * increase timeoutInMinutes to 40 * install ffmpeg * timeout-minutes to 55 * +git * show-error-codes * .detach().cpu().numpy() first * add numpy * numpy * ignore_errors torchmetrics.audio.* * solve mypy no-redef error * remove --quiet * pypesq * apt * add # type: ignore * try without test_si_snr & test_si_sdr * test_import_speechmetrics * test_speechmetrics_si_sdr * test_si_sdr_functional * test audio only * install libsndfile1 * add sisnr sisdr test * test all & add quiet & remove test_speechmetrics * remove sudo & install libsndfile1 * add test * update * fix tests * typing * fix typing * fix bus error * SRMRpy * pesq * gcc * comment -u root cuda 10.2 whoami * env Co-authored-by: quancs <quancs@qq.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Nicki Skafte <skaftenicki@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Jirka <jirka.borovec@seznam.cz> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
2021-06-22 20:39:22 +03:00
set -ex
sudo apt-get update
sudo apt-get install -y gcc cmake ffmpeg git libsndfile1
# python -m pip install "pip==20.1"
pip install --requirement ./requirements/devel.txt --upgrade-strategy only-if-needed
pip uninstall -y torchmetrics
pip list
displayName: 'Install dependencies'
- bash: |
python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu >= 2, f'GPU: {mgpu}'"
displayName: 'Sanity check'
- bash: |
python -m pytest torchmetrics tests -v --cov=torchmetrics --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
displayName: 'Testing'
- 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'
- task: PublishTestResults@2
displayName: 'Publish test results'
inputs:
testResultsFiles: '$(Build.StagingDirectory)/test-results.xml'
testRunTitle: '$(Agent.OS) - $(Build.DefinitionName) - Python $(python.version)'
condition: succeededOrFailed()
# 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: |
python -m pytest integrations -v --durations=25
displayName: 'Integrations'