forked from huawei-csl/pto-kernels
-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (76 loc) · 2.93 KB
/
python-packaging.yml
File metadata and controls
91 lines (76 loc) · 2.93 KB
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
name: Multi-platform Manylinux wheels
on:
workflow_dispatch:
jobs:
manylinux-wheels-build:
name: manylinux build (py${{ matrix.py_ver }})
continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
arch: x86_64
python_version: py3.10
py_ver: "310"
- os: ubuntu-22.04
arch: x86_64
python_version: py3.11
py_ver: "311"
- os: ubuntu-22.04-arm
arch: aarch64
python_version: py3.10
py_ver: "310"
- os: ubuntu-22.04-arm
arch: aarch64
python_version: py3.11
py_ver: "311"
runs-on: ${{ matrix.os }}
container:
image: quay.io/ascend/manylinux:8.5.1-910b-manylinux_2_28-${{ matrix.python_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Show OS
run: cat /etc/os-release
- name: Run bash commands
shell: bash
run: |
source /usr/local/Ascend/ascend-toolkit/set_env.sh
source /usr/local/Ascend/nnal/atb/set_env.sh
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/Ascend/ascend-toolkit/latest/`uname -i`-linux/devlib # to avoid libascend_hal.so issue
pip3 install pyyaml setuptools pytest packaging pybind11[global]
pip3 install -r requirements.txt
pip3 install torch-npu==2.8.0.post2 --extra-index-url https://download.pytorch.org/whl/cpu
make clean build_wheel
- name: Install built wheel
run: pip install pto_kernels-*.whl
- name: Inspect installed package
run: |
export SITE_PACKAGES=$(python3 -c "import site; print(site.getsitepackages()[0])")
echo "$SITE_PACKAGES"
yum install -y -q tree
tree ${SITE_PACKAGES}/pto_kernels
- name: Show wheel info
run: auditwheel show pto_kernels*.whl
- name: Repair wheel
run: |
export SITE_PACKAGES=$(python3 -c "import site; print(site.getsitepackages()[0])")
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${SITE_PACKAGES}/pto_kernels/:${SITE_PACKAGES}/pto_kernels/lib:${SITE_PACKAGES}/pto_kernels/lib64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/Ascend/ascend-toolkit/latest/`uname -i`-linux/devlib # to avoid libascend_hal.so issue
auditwheel repair \
--plat manylinux_2_27_${{ matrix.arch }} \
--exclude libtorch.so \
--exclude libtorch_cpu.so \
--exclude libc10.so \
--exclude libhccl.so \
--exclude libprofapi.so \
--exclude libtorch_npu.so \
pto_kernels*.whl \
-w wheelhouse/
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: pto_kernels-${{ matrix.py_ver }}
path: wheelhouse/pto_kernels*manylinux*.whl
retention-days: 1