forked from Lightning-AI/litgpt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-gpu-test.yml
70 lines (61 loc) · 1.74 KB
/
azure-gpu-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
trigger:
branches:
include:
- "main"
- "wip"
pr:
branches:
include:
- "main"
- "wip"
- "carmocca/*"
jobs:
- job: testing
timeoutInMinutes: "20"
cancelTimeoutInMinutes: "2"
pool: "lit-rtx-3090"
variables:
DEVICES: $( python -c 'print("$(Agent.Name)".split("_")[-1])' )
container:
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.2-cuda12.1.0"
options: "--gpus=all --shm-size=8gb"
workspace:
clean: all
steps:
- bash: |
echo "##vso[task.setvariable variable=CUDA_VISIBLE_DEVICES]$(DEVICES)"
displayName: 'set env. vars'
- bash: |
echo $(DEVICES)
echo $CUDA_VISIBLE_DEVICES
whereis nvidia
nvidia-smi
which python && which pip
python --version
pip --version
pip list
displayName: "Image info & NVIDIA"
- script: |
pip install --upgrade pip
pip install '.[all,test]'
displayName: 'Install dependencies'
- script: |
pip uninstall -y torchvision torchaudio
pip install --pre 'nvfuser-cu121[torch]' --extra-index-url https://pypi.nvidia.com
displayName: 'Install PyTorch nightly'
- bash: |
set -e
pip list
python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu == 2, f'GPU: {mgpu}'"
displayName: "Env details"
- bash: pytest -v --disable-pytest-warnings --strict-markers --color=yes
displayName: 'Ordinary tests'
env:
PL_RUN_CUDA_TESTS: "1"
timeoutInMinutes: "5"
- bash: bash run_standalone_tests.sh
workingDirectory: tests
env:
PL_RUN_CUDA_TESTS: "1"
displayName: "Standalone tests"
timeoutInMinutes: "5"