forked from mit-han-lab/torchsparse
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (79 loc) · 2.41 KB
/
post-commit.yaml
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
name: Torchsparse Post-Commit
on:
push:
branches:
- zendar-main
workflow_dispatch:
workflow_call:
jobs:
build:
name: Build Wheel for Torchsparse
runs-on:
- self-hosted
- amd_2004_runner_v3
timeout-minutes: 30
outputs:
wheel: "${{ steps.build.wheelfile }}"
env:
PDM_DIR: __pdm
PDM: __pdm/bin/pdm
steps:
- uses: actions/checkout@v3
- name: Install CUDA 12.1.1
shell: bash
run: |
pushd ..
INSTALLER=cuda_12.1.1_530.30.02_linux.run
VERSION=12.1.1
BASE=https://developer.download.nvidia.com/compute/cuda
SHASUM=d74022d41d80105319dfa21beea39b77a5b9919539c0487a05caaf2446d6a70e
if sha256sum ${INSTALLER} \
| awk '/^'"${SHASUM}"' *'"${INSTALLER}"'$/'
then
echo "Already downloaded the installer, reusing"
else
wget ${BASE}/${VERSION}/local_installers/${INSTALLER}
fi
chmod +x ./${INSTALLER}
echo "running installer $(pwd)/${INSTALLER}; unpacking in $(pwd)/cuda"
mkdir -p cuda
./${INSTALLER} --toolkit --silent --installpath=$(pwd)/cuda
popd
- name: Install PDM
shell: bash
run: |
curl \
-sSL \
-o install-pdm.py \
https://raw.githubusercontent.com/pdm-project/pdm/2.5.3/install-pdm.py
python3 install-pdm.py --path "${PDM_DIR}"
- name: PDM Sync
shell: bash
run: |
CUDA_PATH="$(pwd | xargs dirname)/cuda"
LD_LIBRARY_PATH="${CUDA_PATH}/lib64"
export CUDA_PATH LD_LIBRARY_PATH
"${PDM}" sync --clean
- name: Build Wheel
shell: bash
run: |
CUDA_PATH="$(pwd | xargs dirname)/cuda"
LD_LIBRARY_PATH="${CUDA_PATH}/lib64"
export CUDA_PATH LD_LIBRARY_PATH
"${PDM}" build
- name: Locate Wheel
id: locate
shell: bash
run: |
find dist -mindepth 1 -name '*.whl' \
| xargs printf "wheel=%s\n" \
>> "${GITHUB_OUTPUT}"
find dist -mindepth 1 -name '*.whl' \
| xargs basename \
| xargs printf "name=%s\n" \
>> "${GITHUB_OUTPUT}"
- name: Archive Wheel
uses: actions/upload-artifact@v3
with:
name: ${{ steps.locate.outputs.name }}
path: ${{ steps.locate.outputs.wheel }}