-
Notifications
You must be signed in to change notification settings - Fork 634
106 lines (90 loc) · 3.04 KB
/
rocm_ci.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
name: rocm-ci
on:
pull_request:
types: [labeled, synchronize, reopened]
workflow_dispatch: {}
push:
branches:
- main
- develop
jobs:
build:
if: github.repository == 'rocm/xformers'
runs-on: self-hosted
container:
image: 'rocm/pytorch-nightly:latest'
options: ' --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --device=/dev/kfd --device=/dev/dri --group-add video --ipc=host --shm-size 8G '
steps:
- uses: actions/checkout@v4
with:
path: '_xformers'
submodules: 'recursive'
set-safe-directory: true
fetch-depth: 0
- name: Get CPU info on Ubuntu
if: contains(runner.os, 'linux')
run: |
cat /proc/cpuinfo
- name: Get env vars
run: |
echo GITHUB_WORKFLOW = $GITHUB_WORKFLOW
echo HOME = $HOME
echo PWD = $PWD
echo GITHUB_ACTION = $GITHUB_ACTION
echo GITHUB_ACTIONS = $GITHUB_ACTIONS
echo GITHUB_REPOSITORY = $GITHUB_REPOSITORY
echo GITHUB_EVENT_NAME = $GITHUB_EVENT_NAME
echo GITHUB_EVENT_PATH = $GITHUB_EVENT_PATH
echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE
echo GITHUB_SHA = $GITHUB_SHA
echo GITHUB_REF = $GITHUB_REF
export GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
echo GIT_BRANCH = $GIT_BRANCH
export ROCM_PATH=/opt/rocm
echo ROCM_PATH = $ROCM_PATH
hipcc --version
rocm-smi
rocminfo | grep "gfx"
- name: Setup build env
run: |
conda create -n xformers python=3.11
export PATH=/opt/conda/envs/xformers/bin:$PATH
python -VV
python -m pip install -U torch --index-url=https://download.pytorch.org/whl/nightly/rocm6.1
python -c "import torch; print(f'PyTorch version {torch.__version__}')"
python -m pip install ninja scipy pytest pytest-html
- name: Pre-build clean
run: |
cd _xformers
git clean -ffdx
cd ..
- name: Build xformers
run: |
export PATH=/opt/conda/envs/xformers/bin:$PATH
export MAX_JOBS=144
python -m pip install -e ./_xformers --verbose
python -m xformers.info
- name: Run python tests
run: |
export PATH=/opt/conda/envs/xformers/bin:$PATH
python -m pytest --html=test_mem_eff_attention.html --self-contained-html -rpfs ./_xformers/tests/test_mem_eff_attention.py
- name: Archive logs
if: '!cancelled()'
uses: actions/upload-artifact@v4
with:
name: test results
path: test_mem_eff_attention.html
- name: Post-build clean
if: '!cancelled()'
run: |
cd _xformers
git clean -ffdx
cd ..
clean:
runs-on: self-hosted
if: ${{ needs.build.result != 'skipped' }}
needs: [build]
steps:
- name: Remove dangling Docker images
run: |
docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi