-
Notifications
You must be signed in to change notification settings - Fork 59
149 lines (124 loc) · 4.59 KB
/
build-numpy.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
name: NumPy
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '0 5 * * *'
permissions: read-all
jobs:
np-multiarray-tgl:
if: github.repository == 'intel/x86-simd-sort'
runs-on: intel-ubuntu-24.04
steps:
- name: Checkout x86-simd-sort
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
path: x86-simd-sort
- name: Specify branch name
working-directory: ${{ github.workspace }}/x86-simd-sort
run: git switch -c pr-branch
- name: Install build dependencies
run: |
sudo apt update
sudo apt -y install g++-12 gcc-12 git
- name: Checkout NumPy main
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: numpy/numpy
submodules: recursive
fetch-depth: 0
ref: main
path: numpy
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: '3.11'
- name: Install Intel SDE
run: |
curl -o /tmp/sde.tar.xz https://downloadmirror.intel.com/788820/sde-external-9.27.0-2023-09-13-lin.tar.xz
mkdir /tmp/sde && tar -xvf /tmp/sde.tar.xz -C /tmp/sde/
sudo mv /tmp/sde/* /opt/sde && sudo ln -s /opt/sde/sde64 /usr/bin/sde
- name: Install NumPy dependencies
working-directory: ${{ github.workspace }}/numpy
run: |
pip install -r requirements/build_requirements.txt
pip install -r requirements/test_requirements.txt
- name: Update x86-simd-sort
working-directory: ${{ github.workspace }}/numpy
run: |
cd numpy/_core/src/npysort/x86-simd-sort
git remote add temp ${{ github.workspace }}/x86-simd-sort
git fetch temp
git checkout temp/pr-branch
- name: Build and run NumPy tests
working-directory: ${{ github.workspace }}/numpy
env:
CXX: g++-12
CC: gcc-12
run: |
spin build -- -Dallow-noblas=true
export NUMPY_SITE=$(realpath build-install/usr/lib/python*/site-packages/)
export PYTHONPATH="$PYTHONPATH:$NUMPY_SITE"
cd build-install &&
sde -tgl -- python -m pytest $NUMPY_SITE/numpy/_core/tests/test_multiarray.py
np-multiarray-spr:
if: github.repository == 'intel/x86-simd-sort'
runs-on: intel-ubuntu-24.04
steps:
- name: Checkout x86-simd-sort
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
path: x86-simd-sort
- name: Specify branch name
working-directory: ${{ github.workspace }}/x86-simd-sort
run: git switch -c pr-branch
- name: Install build dependencies
run: |
sudo apt update
sudo apt -y install g++-12 gcc-12 git
- name: Install Intel SDE
run: |
curl -o /tmp/sde.tar.xz https://downloadmirror.intel.com/788820/sde-external-9.27.0-2023-09-13-lin.tar.xz
mkdir /tmp/sde && tar -xvf /tmp/sde.tar.xz -C /tmp/sde/
sudo mv /tmp/sde/* /opt/sde && sudo ln -s /opt/sde/sde64 /usr/bin/sde
- name: Checkout NumPy main
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: numpy/numpy
submodules: recursive
fetch-depth: 0
ref: main
path: numpy
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: '3.11'
- name: Install NumPy dependencies
working-directory: ${{ github.workspace }}/numpy
run: |
pip install -r requirements/build_requirements.txt
pip install -r requirements/test_requirements.txt
- name: Update x86-simd-sort
working-directory: ${{ github.workspace }}/numpy
run: |
cd numpy/_core/src/npysort/x86-simd-sort
git remote add temp ${{ github.workspace }}/x86-simd-sort
git fetch temp
git checkout temp/pr-branch
- name: Build NumPy with cpu basline SPR
working-directory: ${{ github.workspace }}/numpy
env:
CXX: g++-12
CC: gcc-12
run: |
spin build -- -Dallow-noblas=true -Dcpu-baseline=avx512_spr
- name: Run tests on SPR
working-directory: ${{ github.workspace }}/numpy
run: |
export NUMPY_SITE=$(realpath build-install/usr/lib/python*/site-packages/)
export PYTHONPATH="$PYTHONPATH:$NUMPY_SITE"
cd build-install &&
sde -spr -- python -c "import numpy; numpy.show_config()" &&
sde -spr -- python -m pytest $NUMPY_SITE/numpy/_core/tests/test_multiarray.py