lightning/.azure/hpu-tests.yml

95 lines
2.9 KiB
YAML

# Pipeline to run the HPU tests in DL1 Instance
trigger:
tags:
include:
- '*'
branches:
include:
- "master"
- "release/*"
- "refs/tags/*"
pr:
- "master"
- "release/*"
variables:
- name: continue
value: '1'
jobs:
- job: testing
# how long to run the job before automatically cancelling
timeoutInMinutes: "10"
# how much time to give 'run always even if cancelled tasks' before stopping them
cancelTimeoutInMinutes: "2"
pool: intel-hpus
workspace:
clean: all
steps:
- bash: |
CHANGED_FILES=$(git diff --name-status origin/master -- . | awk '{print $2}')
FILTER='src/pytorch_lightning|requirements/pytorch|tests/tests_pytorch|examples/pl_*'
echo $CHANGED_FILES > changed_files.txt
MATCHES=$(cat changed_files.txt | grep -E $FILTER)
echo $MATCHES
if [ -z "$MATCHES" ]; then
echo "Skip"
echo "##vso[task.setvariable variable=continue]0"
else
echo "Continue"
echo "##vso[task.setvariable variable=continue]1"
fi
displayName: Skipper
- bash: |
apt-get install -y hwinfo
hwinfo --short
displayName: 'Instance HW info'
condition: eq(variables['continue'], '1')
- bash: |
pip install -e .[extra] -r requirements/pytorch/test.txt
env:
PACKAGE_NAME: pytorch
FREEZE_REQUIREMENTS: 1
displayName: 'Install dependencies'
condition: eq(variables['continue'], '1')
- bash: |
python -m pytest -sv accelerators/test_hpu.py --forked --junitxml=hpu1_test-results.xml
workingDirectory: tests/tests_pytorch
displayName: 'Single card HPU test'
condition: eq(variables['continue'], '1')
- bash: |
python -m pytest -sv accelerators/test_hpu.py --forked --hpus 8 --junitxml=hpu8_test-results.xml
workingDirectory: tests/tests_pytorch
displayName: 'Multi card(8) HPU test'
condition: eq(variables['continue'], '1')
- bash: |
python -m pytest -sv plugins/precision/hpu/test_hpu.py --hmp-bf16 \
'plugins/precision/hpu/ops_bf16.txt' --hmp-fp32 \
'plugins/precision/hpu/ops_fp32.txt' --forked \
--junitxml=hpu1_precision_test-results.xml
workingDirectory: tests/tests_pytorch
displayName: 'HPU precision test'
condition: eq(variables['continue'], '1')
- bash: |
export PYTHONPATH="${PYTHONPATH}:$(pwd)"
python "pl_hpu/mnist_sample.py"
workingDirectory: examples
displayName: 'Testing: HPU examples'
condition: eq(variables['continue'], '1')
- task: PublishTestResults@2
inputs:
testResultsFiles: 'hpu*_test-results.xml'
testRunTitle: '$(Agent.OS) - $(Build.DefinitionName) - Python $(python.version)'
condition: and(succeededOrFailed(), eq(variables['continue'], '1'))
displayName: 'Publish test results'