-
Notifications
You must be signed in to change notification settings - Fork 394
162 lines (156 loc) · 6.09 KB
/
nightly-pipeline.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Fast Release Nightly CI/CD Pipeline
on:
schedule:
- cron: '0 0 * * *'
jobs:
fast-release-docker-build:
if: github.server_url != 'https://github.com'
name: Docker build for torch-gpu fast release
runs-on: ubuntu-latest
steps:
- name: Install Tools
run: |
sudo apt update -qq
sudo apt install --no-install-recommends -y curl ca-certificates
sudo cp /tmp/certs/certificate-package.crt /usr/local/share/ca-certificates/certificate-package.crt
sudo update-ca-certificates
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Check for Dockerfile Update
run: |
echo "docker-updated="$(if [ -n "$(git diff --name-only HEAD^ HEAD -- Jenkins/fast-release/Dockerfile.torch-gpu)" ]; then echo true; else echo false; fi) >> $GITHUB_ENV
- uses: ./.github/actions/docker-build-image
if: env.docker-updated == 'true'
with:
dockerfile: Jenkins/fast-release/Dockerfile.torch-gpu
docker-login: ${{ secrets.DOCKER_LOGIN }}
docker-password: ${{ secrets.DOCKER_CREDENTIALS }}
docker-registry: ${{ vars.DOCKER_REGISTRY }}
image-name: "${{ vars.DOCKER_IMAGE }}torch"
image-tag: "fast-release-latest"
build-args: |
REGISTRY=${{ vars.DOCKER_REGISTRY_TMP }}/
PYTHON_VERSION=3.10
BUILDKIT_INLINE_CACHE=1
build-pypi-whl:
if: github.server_url != 'https://github.com'
name: Build AIMET pypi wheel
runs-on: k8s-gpu
needs: [fast-release-docker-build]
env:
AIMET_VARIANT: torch-gpu
FAST_RELEASE: true
defaults:
run:
shell: bash
container:
image: "${{ vars.DOCKER_REGISTRY }}/${{ vars.DOCKER_IMAGE }}torch:fast-release-latest"
credentials:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_CREDENTIALS }}
outputs:
version: ${{ steps.version.outputs.nightly_version }}
steps:
- uses: actions/checkout@v4
- name: Install Tools
run: |
sudo apt-get update
sudo apt-get install python3 python3-pip -y
python3 -m pip install --upgrade pip
python3 -m pip install lastversion
- name: Format the Version String
id: version
run: |
set +e
CUR_VER=$(lastversion https://artifacts.codelinaro.org/ui/native/aimet/ 2>/dev/null)
if [ $? -ne 0 ]; then
CUR_VER=${{ vars.VERSION }}
fi
echo "Current Aimet-Torch Version: " $CUR_VER
IFS='.' read -r -a VERSION_SPLIT <<< "$CUR_VER"
VERSION_SPLIT[2]=$((VERSION_SPLIT[2] + 1))
NIGHTLY_VERSION="${VERSION_SPLIT[0]}.${VERSION_SPLIT[1]}.b${VERSION_SPLIT[2]}"
echo "Updates Nightly Version: " $NIGHTLY_VERSION
echo "NIGHTLY_VERSION=$NIGHTLY_VERSION" >> $GITHUB_ENV
echo "nightly_version=$NIGHTLY_VERSION" >> $GITHUB_OUTPUT
unset IFS
- name: Make the Pypi Wheel
run: |
mkdir -p build/staging/universal
cmake -S . -B ./build -DENABLE_CUDA=ON -DENABLE_TORCH=ON -DENABLE_TENSORFLOW=OFF -DENABLE_ONNX=OFF -DPIP_INDEX=${{ vars.PYPI_INDEX }} -DSW_VERSION=${{ env.NIGHTLY_VERSION }} -DCMAKE_INSTALL_PREFIX="build/staging/universal"
cmake --build ./build --parallel 4 --target all --target install --target packageaimet
- uses: actions/upload-artifact@v3
with:
name: aimet-torch-${{ env.NIGHTLY_VERSION }}
path: build/**/*.whl
if-no-files-found: error
retention-days: 1d
pypi-unit-tests:
if: github.server_url != 'https://github.com'
name: AIMET Pypi Unit Test
runs-on: k8s-gpu
needs: [build-pypi-whl]
env:
pytest_github_report: true
pytest_use_zeros: true
VERSION: ${{needs.build-pypi-whl.outputs.version}}
defaults:
run:
shell: bash
container:
image: "${{ vars.DOCKER_REGISTRY_TMP }}/nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04"
credentials:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_CREDENTIALS }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v2
with:
name: aimet-torch-${{ env.VERSION }}
path: .
- name: Install Tools
run: |
apt-get update
apt-get install python3 python3-pip -y
python3 -m pip install --upgrade pip
python3 -m pip install packaging/dist/aimet_torch-*.whl
python3 -m pip install bs4 deepspeed onnxruntime peft pytest spconv transformers torch==2.2.2 torchvision==0.17.2
python3 -m pip install pytorch-ignite --no-dependencies
- name: Run Unit Tests
run: pytest TrainingExtensions/torch/test/python/
pypi-acceptance-tests:
if: github.server_url != 'https://github.com'
name: AIMET Pypi Acceptance Tests
runs-on: k8s-gpu
needs: [build-pypi-whl]
env:
pytest_github_report: true
pytest_use_zeros: true
DEPENDENCY_DATA_PATH: /data
VERSION: ${{needs.build-pypi-whl.outputs.version}}
defaults:
run:
shell: bash
container:
image: "${{ vars.DOCKER_REGISTRY_TMP }}/nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04"
credentials:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_CREDENTIALS }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v2
with:
name: aimet-torch-${{ env.VERSION }}
path: .
- name: Install Tools
run: |
apt-get update
apt-get install python3 python3-pip -y
python3 -m pip install packaging/dist/aimet_torch-*.whl
python3 -m pip install bs4 deepspeed==0.15.2 peft pytest safetensors torch==2.2.2 torchvision==0.17.2 transformers==4.27.4 wget
python3 -m pip install pytorch-ignite --no-dependencies
- name: Verify Dependency Data
run: python3 NightlyTests/torch/dependencies.py NightlyTests/torch/resnet18_eval_scores.csv True
- name: Run Acceptance Tests
run: pytest NightlyTests/torch/