-
-
Notifications
You must be signed in to change notification settings - Fork 140
262 lines (249 loc) · 12.2 KB
/
make-macos.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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# for Linux environment
name: Make CI (for MacOS)
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
jobs:
build-macos:
# macos-13
# https://docs.github.com/ja/actions/using-github-hosted-runners/about-github-hosted-runners
# https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
runs-on: macos-13
strategy:
matrix:
edition:
- YANEURAOU_ENGINE_NNUE
- "YANEURAOU_ENGINE_KPPT,YANEURAOU_ENGINE_KPP_KKPT"
- YANEURAOU_ENGINE_MATERIAL
- YANEURAOU_ENGINE_DEEP_COREML
- "YANEURAOU_MATE_ENGINE,TANUKI_MATE_ENGINE"
- USER_ENGINE
compiler:
- clang++
#- g++-11
target:
- "normal,tournament"
archcpu:
- APPLEAVX2
- APPLESSE42
- APPLEM1
exclude:
- compiler: g++-11
archcpu: APPLEAVX2
- compiler: g++-11
archcpu: APPLESSE42
- compiler: g++-11
archcpu: APPLEM1
steps:
- name: Checkout own repository
uses: actions/checkout@v2
with:
path: main
- name: make
uses: actions/github-script@v5
env:
JOBS: '8'
EDITION: '${{ matrix.edition }}'
COMPILER: '${{ matrix.compiler }}'
TARGET: '${{ matrix.target }}'
CPU: '${{ matrix.archcpu }}'
OS: 'macos11'
with:
script: |
const fs = require('fs');
const {JOBS, EDITION, COMPILER, TARGET, CPU, OS, EXTRA} = process.env;
const editionh = {
"YANEURAOU_ENGINE_NNUE": "YANEURAOU_ENGINE_NNUE",
"YANEURAOU_ENGINE_NNUE_HALFKP_1024X2_8_32": "YANEURAOU_ENGINE_NNUE_HALFKP_1024X2_8_32",
"YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32": "YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32",
"YANEURAOU_ENGINE_NNUE_HALFKPE9": "YANEURAOU_ENGINE_NNUE_HALFKPE9",
"YANEURAOU_ENGINE_NNUE_KP256": "YANEURAOU_ENGINE_NNUE_KP256",
"YANEURAOU_ENGINE_DEEP_TENSOR_RT": "YANEURAOU_ENGINE_DEEP_TENSOR_RT",
"YANEURAOU_ENGINE_KPPT": "YANEURAOU_ENGINE_KPPT",
"YANEURAOU_ENGINE_KPP_KKPT": "YANEURAOU_ENGINE_KPP_KKPT",
"YANEURAOU_ENGINE_MATERIAL": "YANEURAOU_ENGINE_MATERIAL",
"YANEURAOU_ENGINE_MATERIAL2": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=2",
"YANEURAOU_ENGINE_MATERIAL3": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=3",
"YANEURAOU_ENGINE_MATERIAL4": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=4",
"YANEURAOU_ENGINE_MATERIAL5": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=5",
"YANEURAOU_ENGINE_MATERIAL6": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=6",
"YANEURAOU_ENGINE_MATERIAL7": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=7",
"YANEURAOU_ENGINE_MATERIAL8": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=8",
"YANEURAOU_ENGINE_MATERIAL9": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=9",
"YANEURAOU_ENGINE_MATERIAL10": "YANEURAOU_ENGINE_MATERIAL MATERIAL_LEVEL=10",
"YANEURAOU_ENGINE_DEEP_COREML": "YANEURAOU_ENGINE_DEEP_COREML",
"YANEURAOU_MATE_ENGINE": "YANEURAOU_MATE_ENGINE",
"TANUKI_MATE_ENGINE": "TANUKI_MATE_ENGINE",
"USER_ENGINE": "USER_ENGINE",
};
const dirh = {
"YANEURAOU_ENGINE_NNUE": "NNUE",
"YANEURAOU_ENGINE_NNUE_HALFKP_1024X2_8_32":"NNUE1024",
"YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32": "NNUE_HALFKP_VM",
"YANEURAOU_ENGINE_NNUE_HALFKPE9": "NNUE_HALFKPE9",
"YANEURAOU_ENGINE_NNUE_KP256": "NNUE_KP256",
"YANEURAOU_ENGINE_DEEP_TENSOR_RT": "DEEP_TRT",
"YANEURAOU_ENGINE_KPPT": "KPPT",
"YANEURAOU_ENGINE_KPP_KKPT": "KPP_KKPT",
"YANEURAOU_ENGINE_MATERIAL": "MaterialLv1",
"YANEURAOU_ENGINE_MATERIAL2": "MaterialLv2",
"YANEURAOU_ENGINE_MATERIAL3": "MaterialLv3",
"YANEURAOU_ENGINE_MATERIAL4": "MaterialLv4",
"YANEURAOU_ENGINE_MATERIAL5": "MaterialLv5",
"YANEURAOU_ENGINE_MATERIAL6": "MaterialLv6",
"YANEURAOU_ENGINE_MATERIAL7": "MaterialLv7",
"YANEURAOU_ENGINE_MATERIAL8": "MaterialLv8",
"YANEURAOU_ENGINE_MATERIAL9": "MaterialLv9",
"YANEURAOU_ENGINE_MATERIAL10": "MaterialLv10",
"YANEURAOU_ENGINE_DEEP_COREML": "FukauraOu_CoreML",
"YANEURAOU_MATE_ENGINE": "YaneuraOu_MATE",
"TANUKI_MATE_ENGINE": "tanuki_MATE",
"USER_ENGINE": "USER",
};
const fileh = {
"YANEURAOU_ENGINE_NNUE": "YaneuraOu_NNUE",
"YANEURAOU_ENGINE_NNUE_HALFKP_1024X2_8_32":"YaneuraOu_NNUE1024",
"YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32": "YaneuraOu_NNUE_HALFKP_VM",
"YANEURAOU_ENGINE_NNUE_HALFKPE9": "YaneuraOu_NNUE_HalfKPE9",
"YANEURAOU_ENGINE_NNUE_KP256": "YaneuraOu_NNUE_KP256",
"YANEURAOU_ENGINE_DEEP_TENSOR_RT": "YaneuraOu_Deep_TRT",
"YANEURAOU_ENGINE_KPPT": "YaneuraOu_KPPT",
"YANEURAOU_ENGINE_KPP_KKPT": "YaneuraOu_KPP_KKPT",
"YANEURAOU_ENGINE_MATERIAL": "YaneuraOu_MaterialLv1",
"YANEURAOU_ENGINE_MATERIAL2": "YaneuraOu_MaterialLv2",
"YANEURAOU_ENGINE_MATERIAL3": "YaneuraOu_MaterialLv3",
"YANEURAOU_ENGINE_MATERIAL4": "YaneuraOu_MaterialLv4",
"YANEURAOU_ENGINE_MATERIAL5": "YaneuraOu_MaterialLv5",
"YANEURAOU_ENGINE_MATERIAL6": "YaneuraOu_MaterialLv6",
"YANEURAOU_ENGINE_MATERIAL7": "YaneuraOu_MaterialLv7",
"YANEURAOU_ENGINE_MATERIAL8": "YaneuraOu_MaterialLv8",
"YANEURAOU_ENGINE_MATERIAL9": "YaneuraOu_MaterialLv9",
"YANEURAOU_ENGINE_MATERIAL10": "YaneuraOu_MaterialLv10",
"YANEURAOU_ENGINE_DEEP_COREML": "FukauraOu_CoreML",
"YANEURAOU_MATE_ENGINE": "YaneuraOu_MATE",
"TANUKI_MATE_ENGINE": "tanuki_MATE",
"USER_ENGINE": "user",
};
for(let edition of EDITION.split(',')) {
for(let compiler of COMPILER.split(',')) {
for(let target of TARGET.split(',')) {
for(let cpu of CPU.split(',')) {
const builddir = `../build/${OS}/${dirh[edition]}`;
const filename = `${fileh[edition]}-${OS}-${compiler}-${target}-${cpu.toLowerCase()}`;
let log = '';
await io.mkdirP(`./main/source/${builddir}`);
await exec.exec('nice', `make -j${JOBS} ${target} TARGET_CPU=${cpu} YANEURAOU_EDITION=${editionh[edition]} COMPILER=${compiler} TARGET=${builddir}/${filename}`.split(' '), {
"cwd": "./main/source/",
listeners: {
stdout: (data) => { log += data.toString(); },
stderr: (data) => { log += data.toString(); },
}
});
await exec.exec(`make`, `clean TARGET_CPU=${cpu} YANEURAOU_EDITION=${edition}`.split(' '), {"cwd": "./main/source/"});
fs.writeFileSync(`./main/source/${builddir}/${filename}.log`, log);
}}}}
- uses: actions/upload-artifact@v4
with:
name: build-macos_${{ github.run_number }}_${{ matrix.edition }}_${{ matrix.compiler }}_${{ matrix.target }}_${{ matrix.archcpu }}_${{ github.sha }}
path: ./main/build/**/**/*
build-macos-suisho:
# macos-13
# https://docs.github.com/ja/actions/using-github-hosted-runners/about-github-hosted-runners
# https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
runs-on: macos-13
strategy:
matrix:
edition:
- YANEURAOU_ENGINE_NNUE
compiler:
- clang++
- g++-11
target:
- normal
- tournament
archcpu:
#- AVX2
#- SSE42
- APPLEAVX2
- APPLESSE42
- APPLEM1
exclude:
- compiler: g++-11
archcpu: APPLEAVX2
- compiler: g++-11
archcpu: APPLESSE42
- compiler: g++-11
archcpu: APPLEM1
steps:
- name: Checkout own repository
uses: actions/checkout@v2
with:
path: main
- name: suisho5 embedded_nnue
run: |
curl -LRo ./main/source/eval/nnue/embedded_nnue.cpp.gz "https://github.com/mizar/YaneuraOu/releases/download/resource/suisho5_20211123.halfkp.nnue.cpp.gz";
gzip -df ./main/source/eval/nnue/embedded_nnue.cpp.gz;
- name: make
uses: actions/github-script@v5
env:
JOBS: '8'
EDITION: '${{ matrix.edition }}'
COMPILER: '${{ matrix.compiler }}'
TARGET: '${{ matrix.target }}'
CPU: '${{ matrix.archcpu }}'
OS: 'macos13'
with:
script: |
const fs = require('fs');
const {JOBS, EDITION, COMPILER, TARGET, CPU, OS, EXTRA} = process.env;
const editionh = {
"YANEURAOU_ENGINE_NNUE": "YANEURAOU_ENGINE_NNUE",
"YANEURAOU_ENGINE_NNUE_HALFKP_1024X2_8_32": "YANEURAOU_ENGINE_NNUE_HALFKP_1024X2_8_32",
"YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32": "YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32",
"YANEURAOU_ENGINE_NNUE_HALFKPE9": "YANEURAOU_ENGINE_NNUE_HALFKPE9",
"YANEURAOU_ENGINE_NNUE_KP256": "YANEURAOU_ENGINE_NNUE_KP256",
};
const dirh = {
"YANEURAOU_ENGINE_NNUE": "NNUE",
"YANEURAOU_ENGINE_NNUE_HALFKP_1024X2_8_32":"NNUE1024",
"YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32": "NNUE_HALFKP_VM",
"YANEURAOU_ENGINE_NNUE_HALFKPE9": "NNUE_HALFKPE9",
"YANEURAOU_ENGINE_NNUE_KP256": "NNUE_KP256",
};
const fileh = {
"YANEURAOU_ENGINE_NNUE": "Suisho5_YaneuraOu",
"YANEURAOU_ENGINE_NNUE_HALFKP_1024X2_8_32":"YaneuraOu_NNUE1024",
"YANEURAOU_ENGINE_NNUE_HALFKP_VM_256X2_32_32": "YaneuraOu_NNUE_HALFKP_VM",
"YANEURAOU_ENGINE_NNUE_HALFKPE9": "YaneuraOu_NNUE_HalfKPE9",
"YANEURAOU_ENGINE_NNUE_KP256": "YaneuraOu_NNUE_KP256",
};
for(let edition of EDITION.split(',')) {
for(let compiler of COMPILER.split(',')) {
for(let target of TARGET.split(',')) {
for(let cpu of CPU.split(',')) {
const builddir = `../build/${OS}/${dirh[edition]}`;
const filename = `${fileh[edition]}-${OS}-${compiler}-${target}-${cpu.toLowerCase()}`;
let log = '';
await io.mkdirP(`./main/source/${builddir}`);
await exec.exec('nice', `make -j${JOBS} ${target} TARGET_CPU=${cpu} YANEURAOU_EDITION=${editionh[edition]} COMPILER=${compiler} TARGET=${builddir}/${filename} EVAL_EMBEDDING=ON EXTRA_CPPFLAGS='-DENGINE_OPTIONS=\\\\\"\\\"option=name=FV_SCALE=type=spin=default=24=min=1=max=128\\;option=name=BookFile=type=combo=default=no_book=var=no_book=var=standard_book.db=var=yaneura_book1.db=var=yaneura_book2.db=var=yaneura_book3.db=var=yaneura_book4.db=var=user_book1.db=var=user_book2.db=var=user_book3.db=var=book.bin\\\\\\\"\"'`.split(' '), {
"cwd": "./main/source/",
listeners: {
stdout: (data) => { log += data.toString(); },
stderr: (data) => { log += data.toString(); },
}
});
await exec.exec(`make`, `clean TARGET_CPU=${cpu} YANEURAOU_EDITION=${edition} EVAL_EMBEDDING=ON`.split(' '), {"cwd": "./main/source/"});
fs.writeFileSync(`./main/source/${builddir}/${filename}.log`, log);
}}}}
- name: add resource
run: |
echo 'Suisho5(20211123)-YaneuraOu' > ./main/build/macos13/NNUE/engine_name.txt;
echo 'yaneurao, tayayan' >> ./main/build/macos13/NNUE/engine_name.txt;
# - uses: actions/upload-artifact@v4
# with:
# name: build-macos-embed_${{ github.run_number }}_${{ matrix.edition }}_${{ matrix.compiler }}_${{ matrix.target }}_${{ matrix.archcpu }}_${{ github.sha }}
# path: ./main/build/**/**/*