forked from google/XNNPACK
-
Notifications
You must be signed in to change notification settings - Fork 0
865 lines (811 loc) · 29.1 KB
/
Copy pathbuild.yml
File metadata and controls
865 lines (811 loc) · 29.1 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
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
name: Build and Run Tests
on:
workflow_call:
inputs:
run-tests:
description: 'Whether to also run unit tests, where possible.'
default: true
required: false
type: boolean
update-caches:
description: 'Whether to update the `ccache` or `bazel` caches, where possible.'
default: false
required: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}-${{ inputs.update-caches }}
cancel-in-progress: true
jobs:
cmake-linux-x86_64:
runs-on: 'ubuntu-24.04-8core'
timeout-minutes: 60
container:
image: ghcr.io/google/xnnpack/standard:latest
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CCACHE_DIR: /home/xnnpack/.ccache
steps:
- uses: actions/checkout@v6
- name: Mount ccache
uses: actions/cache@v5
with:
path: /home/xnnpack/.ccache
key: ccache-${{ runner.os }}-${{ github.job }}-${{ github.run_id }}
restore-keys: |
ccache-${{ runner.os }}-${{ github.job }}-
- name: Configure ccache limit
run: |
ccache -M 500M
ccache -z
- name: Configure and build
run: scripts/build-local.sh
- name: Run tests
if: ${{ inputs.run-tests }}
run: ctest --output-on-failure --parallel $(nproc)
working-directory: build/local
- name: Print ccache stats
run: ccache -s
cmake-linux-aarch64:
runs-on: 'arm-ubuntu-arm-22.04-8core'
timeout-minutes: 60
container:
image: ghcr.io/google/xnnpack/standard:latest
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CCACHE_DIR: /home/xnnpack/.ccache
steps:
- uses: actions/checkout@v6
- name: Mount ccache
uses: actions/cache@v5
with:
path: /home/xnnpack/.ccache
key: ccache-${{ runner.os }}-${{ github.job }}-${{ github.run_id }}
restore-keys: |
ccache-${{ runner.os }}-${{ github.job }}-
- name: Configure ccache limit
run: |
ccache -M 500M
ccache -z
- name: Configure and build
run: scripts/build-local.sh
- name: Run tests
if: ${{ inputs.run-tests }}
run: ctest --output-on-failure --parallel $(nproc)
working-directory: build/local
- name: Print ccache stats
run: ccache -s
cmake-linux-armhf:
runs-on: arm-ubuntu-arm-22.04-8core
timeout-minutes: 60
container:
image: ghcr.io/google/xnnpack/standard:latest
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CCACHE_DIR: /home/xnnpack/.ccache
steps:
- uses: actions/checkout@v6
- name: Mount ccache
uses: actions/cache@v5
with:
path: /home/xnnpack/.ccache
key: ccache-armhf-${{ runner.os }}-${{ github.job }}-${{ github.run_id }}
restore-keys: |
ccache-armhf-${{ runner.os }}-${{ github.job }}-
- name: Configure ccache limit
run: |
ccache -M 500M
ccache -z
- name: Configure and build
run: scripts/build-linux-armhf.sh -DCMAKE_BUILD_TYPE=Release
- name: Run tests
if: ${{ inputs.run-tests }}
run: ctest --output-on-failure --parallel $(nproc)
working-directory: build/linux/armhf
- name: Print ccache stats
run: ccache -s
cmake-linux-riscv64:
runs-on: 'ubuntu-24.04-16core'
timeout-minutes: 60
container:
image: ghcr.io/google/xnnpack/riscv:latest
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CCACHE_DIR: /home/xnnpack/.ccache
steps:
- uses: actions/checkout@v6
- name: Mount ccache
uses: actions/cache@v5
with:
path: /home/xnnpack/.ccache
key: ccache-riscv64-${{ runner.os }}-${{ github.job }}-${{ github.run_id }}
restore-keys: |
ccache-riscv64-${{ runner.os }}-${{ github.job }}-
- name: Configure ccache limit
run: |
ccache -M 500M
ccache -z
- name: Configure and build
run: |
scripts/build-linux-riscv64.sh \
-DCMAKE_BUILD_TYPE=Release \
-DXNNPACK_ENABLE_RISCV_VECTOR=ON \
-DUSE_GNU_SOURCE=ON \
-DRISCV_TOOLCHAIN_ROOT=/opt/riscv \
-DRISCV_QEMU_ROOT=/opt/qemu
- name: Run tests (no operator tests)
if: ${{ inputs.run-tests }}
run: ctest --output-on-failure --label-exclude operator --parallel $(nproc)
working-directory: build/linux/riscv64
- name: Print ccache stats
run: ccache -s
cmake-windows-arm64:
runs-on: windows-2022-8core
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}
max-size: "500M"
save: ${{ inputs.update-caches }}
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup build environment
shell: bash
run: |
echo "VCVARSALL=$(vswhere -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" >> $GITHUB_ENV
- name: Configure and build
run: scripts/build-windows-arm64.cmd
shell: cmd
working-directory: ${{ github.workspace }}
env:
CFLAGS: "/UNDEBUG"
CXXFLAGS: "/UNDEBUG"
- name: Print ccache stats
run: ccache -s
shell: bash
cmake-windows-x64:
runs-on: windows-2022-8core
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}
max-size: "500M"
save: ${{ inputs.update-caches }}
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup build environment
shell: bash
run: |
echo "VCVARSALL=$(vswhere -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" >> $GITHUB_ENV
- name: Configure and build
run: scripts/build-windows-x64.cmd
shell: cmd
working-directory: ${{ github.workspace }}
env:
CFLAGS: "/UNDEBUG"
CXXFLAGS: "/UNDEBUG"
- name: Run tests
if: ${{ inputs.run-tests }}
run: ctest -C Release --output-on-failure --parallel $NUMBER_OF_PROCESSORS
working-directory: ${{ github.workspace }}/build/windows/x64
- name: Print ccache stats
run: ccache -s
shell: bash
cmake-windows-x86:
runs-on: windows-2022-8core
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}
max-size: "500M"
save: ${{ inputs.update-caches }}
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup build environment
shell: bash
run: |
echo "VCVARSALL=$(vswhere -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" >> $GITHUB_ENV
- name: Configure and build
run: scripts/build-windows-x86.cmd
shell: cmd
working-directory: ${{ github.workspace }}
env:
CFLAGS: "/UNDEBUG"
CXXFLAGS: "/UNDEBUG"
- name: Run tests
if: ${{ inputs.run-tests }}
run: ctest -C Release --output-on-failure --parallel $NUMBER_OF_PROCESSORS
working-directory: ${{ github.workspace }}/build/windows/x86
- name: Print ccache stats
run: ccache -s
shell: bash
gn-windows-x86_64:
runs-on: 'windows-2022-8core'
timeout-minutes: 30
env:
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
steps:
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}
max-size: "500M"
save: ${{ inputs.update-caches }}
- name: Install Depot Tools
uses: newkdev/setup-depot-tools@v1.0.1
- name: Write .gclient
shell: powershell
run: |
Set-Content -Path .gclient -Value "
solutions = [
{ 'name': 'XNNPACK',
'url': 'https://github.com/google/XNNPACK',
'deps_file': 'DEPS',
'managed': False,
'custom_deps': {},
},
]
"
working-directory: ${{ github.workspace }}
- name: Setup build environment
shell: bash
run: |
echo "VCVARSALL=$(vswhere -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" >> $GITHUB_ENV
- name: Sync to commit and run hooks
shell: powershell
run: gclient sync -vv --revision $env:GITHUB_SHA
- name: Write LASTCHANGE files
shell: powershell
run: |
$LastChangeContents = @(
"LASTCHANGE=$env:GITHUB_SHA-$env:GITHUB_REF_NAME"
"LASTCHANGE_YEAR=$(git log -1 --pretty=%Y)"
)
Set-Content -Path build/util/LASTCHANGE -Value $LastChangeContents
$UnixTime = git log -1 --pretty=%ct
Set-Content -Path build/util/LASTCHANGE.committime -Value $UnixTime
working-directory: ${{ github.workspace }}\XNNPACK
- name: Generate build files (x64, dchecks)
run: |
gn gen --check --args="is_debug=false symbol_level=0 dcheck_always_on=true cc_wrapper=\`"ccache\`" target_cpu=\`"x64\`"" out/x64.dchecks
working-directory: ${{ github.workspace }}\XNNPACK
shell: powershell
- name: Build all targets (x64 Release + debug checks)
run: |
autoninja -C out/x64.dchecks
working-directory: ${{ github.workspace }}\XNNPACK
- name: Run tests (x64)
run: |
python3 scripts/run-gn-tests.py out/x64.dchecks
working-directory: ${{ github.workspace }}\XNNPACK
cmake-macos-arm64:
runs-on: macos-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- name: Install ninja
run: brew install ninja
- name: Create output directory
run: mkdir -p build/macos/arm64
working-directory: ${{ github.workspace }}
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}
max-size: "500M"
save: ${{ inputs.update-caches }}
- name: Generate CMake project
run: |
cmake \
-G Ninja \
-DCMAKE_CONFIGURATION_TYPES=Release \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DHAVE_STD_REGEX=TRUE \
../../..
working-directory: ${{ github.workspace }}/build/macos/arm64
- name: Build with Xcode
run: |
cmake \
--build \
build/macos/arm64 \
-j$(sysctl -n hw.ncpu)
working-directory: ${{ github.workspace }}
cmake-android:
strategy:
matrix:
arch: [arm64, armv7, x86]
runs-on: 'ubuntu-24.04-8core'
timeout-minutes: 60
container:
image: ghcr.io/google/xnnpack/android:latest
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CCACHE_DIR: /home/xnnpack/.ccache
steps:
- uses: actions/checkout@v6
- name: Mount ccache
uses: actions/cache@v5
with:
path: /home/xnnpack/.ccache
key: ccache-android-${{ matrix.arch }}-${{ github.sha }}
restore-keys: |
ccache-android-${{ matrix.arch }}-
- name: Configure ccache limit
run: |
ccache -M 500M
ccache -z
- name: Configure and build
run: scripts/build-android-${{ matrix.arch }}.sh
- name: Print ccache stats
run: ccache -s
cmake-ios-arm64:
runs-on: macos-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- name: Create output directory
run: mkdir -p build/ios/arm64
working-directory: ${{ github.workspace }}
- name: Generate CMake project
run: cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DXNNPACK_BUILD_BENCHMARKS=OFF -DXNNPACK_BUILD_TESTS=OFF ../../..
working-directory: ${{ github.workspace }}/build/ios/arm64
- name: Build with Xcode
run: cmake --build build/ios/arm64 --parallel $(sysctl -n hw.ncpu) -- -quiet
working-directory: ${{ github.workspace }}
gn-linux-arm:
runs-on: 'ubuntu-24.04-8core'
timeout-minutes: 15
env:
CCACHE_SLOPPINESS: time_macros,modules
CCACHE_DIR: /home/runner/.cache/ccache
CCACHE_DEPEND: 1
CCACHE_MAX_SIZE: 5G
CCACHE_COMPILERCHECK: content
steps:
- name: Restore ccache
id: cache-ccache-restore
uses: actions/cache@v5
with:
path: |
/home/runner/.cache/ccache
key: ccache-linux-arm-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
ccache-linux-arm-${{ github.ref_name }}-
ccache-linux-arm-master-
- name: Install system dependencies
run: |
sudo apt-get install -y ccache qemu-user qemu-user-static g++-arm-linux-gnueabihf
- name: Install Depot Tools
uses: newkdev/setup-depot-tools@v1.0.1
- name: Write .gclient
run: |
cat <<EOF > .gclient
solutions = [
{ "name" : 'xnnpack',
"url" : 'https://github.com/google/XNNPACK',
"deps_file" : 'DEPS',
"managed" : False,
"custom_deps" : {
},
"custom_vars": {},
},
]
EOF
- name: Sync to commit and run hooks
run: gclient sync --reset --force --upstream --revision $GITHUB_SHA
- name: Install sysroot
run: ./build/linux/sysroot_scripts/install-sysroot.py --arch=armhf
working-directory: ${{ github.workspace }}/xnnpack
- name: Check GN formatting
run: |
git cl format --presubmit --no-clang-format --no-python --diff
working-directory: ${{ github.workspace }}/xnnpack
- name: Generate build files
run: |
gn gen --check --args="is_debug=false clang_use_chrome_plugins=false dcheck_always_on=true cc_wrapper=\"ccache\" symbol_level=0 target_cpu=\"arm\" use_siso=true" out/arm.dchecks
working-directory: ${{ github.workspace }}/xnnpack
- name: Build all targets (Release + debug checks)
run: |
autoninja -C out/arm.dchecks
working-directory: ${{ github.workspace }}/xnnpack
- name: Print ccache stats
run: ccache -s
- name: Run tests
run: |
python3 scripts/run-gn-tests.py out/arm.dchecks --sysroot=/usr/arm-linux-gnueabihf --architecture=arm --shards=32
working-directory: ${{ github.workspace }}/xnnpack
gn-linux-x86_64:
runs-on: 'ubuntu-24.04-8core'
timeout-minutes: 15
env:
CCACHE_SLOPPINESS: time_macros,modules
CCACHE_DIR: /home/runner/.cache/ccache
CCACHE_DEPEND: 1
CCACHE_MAX_SIZE: 5G
CCACHE_COMPILERCHECK: content
steps:
- name: Restore ccache
id: cache-ccache-restore
uses: actions/cache@v5
with:
path: |
/home/runner/.cache/ccache
key: ccache-linux-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
ccache-linux-${{ github.ref_name }}-
ccache-linux-master-
- name: Install ccache
run: |
sudo apt-get install -y ccache
- name: Install Depot Tools
uses: newkdev/setup-depot-tools@v1.0.1
- name: Write .gclient
run: |
cat <<EOF > .gclient
solutions = [
{ "name" : 'xnnpack',
"url" : 'https://github.com/google/XNNPACK',
"deps_file" : 'DEPS',
"managed" : False,
"custom_deps" : {
},
"custom_vars": {},
},
]
EOF
- name: Sync to commit and run hooks
run: gclient sync --reset --force --upstream --revision $GITHUB_SHA
- name: Check GN formatting
run: |
git cl format --presubmit --no-clang-format --no-python --diff
working-directory: ${{ github.workspace }}/xnnpack
- name: Generate build files (with AVX512)
run: |
gn gen --check --args="is_debug=false clang_use_chrome_plugins=false dcheck_always_on=true cc_wrapper=\"ccache\" symbol_level=0 xnnpack_enable_avx512=true target_cpu=\"x64\" use_siso=true" out/x64.dchecks
working-directory: ${{ github.workspace }}/xnnpack
- name: Build all targets (Release + debug checks, with AVX512)
run: |
autoninja -C out/x64.dchecks
working-directory: ${{ github.workspace }}/xnnpack
- name: Generate build files (no AVX512)
run: |
gn gen --check --args="is_debug=false clang_use_chrome_plugins=false dcheck_always_on=true cc_wrapper=\"ccache\" symbol_level=0 xnnpack_enable_avx512=false target_cpu=\"x64\" use_siso=true" out/x64.dchecks
working-directory: ${{ github.workspace }}/xnnpack
- name: Build all targets (Release + debug checks, without AVX512)
run: |
autoninja -C out/x64.dchecks
working-directory: ${{ github.workspace }}/xnnpack
- name: Print ccache stats
run: ccache -s
- name: Run tests
run: |
python3 scripts/run-gn-tests.py out/x64.dchecks
working-directory: ${{ github.workspace }}/xnnpack
bazel-linux-x86_64-clang-18:
runs-on: 'ubuntu-24.04-8core'
timeout-minutes: 60
container:
image: ghcr.io/google/xnnpack/standard:latest
env:
CC: clang-18
CXX: clang++-18
BAZEL_DEFINES: |
--define=ynn_enable_x86_avx512fp16=false
steps:
- uses: actions/checkout@v6
- name: Mount Bazel Cache
uses: actions/cache@v5
with:
path: |
/home/xnnpack/.cache/bazel/disk_cache
/home/xnnpack/.cache/bazel/repo_cache
key: bazel-clang18-opt-${{ runner.os }}-${{ github.job }}-${{ hashFiles('WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }}
restore-keys: |
bazel-clang18-opt-${{ runner.os }}-${{ github.job }}-
- name: Build tests
if: ${{ !inputs.run-tests }}
run: |
bazel build \
-c opt \
--disk_cache=/home/xnnpack/.cache/bazel/disk_cache \
--repository_cache=/home/xnnpack/.cache/bazel/repo_cache \
--test_output=errors \
${BAZEL_DEFINES} \
-- \
//test/... \
//bench/... \
//ynnpack/...
- name: Build and run tests
if: ${{ inputs.run-tests }}
run: |
bazel test \
-c opt \
--disk_cache=/home/xnnpack/.cache/bazel/disk_cache \
--repository_cache=/home/xnnpack/.cache/bazel/repo_cache \
--test_output=errors \
--local_test_jobs=HOST_CPUS \
${BAZEL_DEFINES} \
-- \
//test/... \
//bench/... \
//ynnpack/... \
//litert/...
- name: Compress disk cache
if: ${{ inputs.update-caches }}
run: |
mkdir -p /home/xnnpack/.cache/bazel/disk_cache
find /home/xnnpack/.cache/bazel/disk_cache -type f -atime +7 -delete
bazel-linux-x86_64-gcc-9:
runs-on: 'ubuntu-24.04-8core'
timeout-minutes: 60
container:
image: ghcr.io/google/xnnpack/standard:latest
env:
CC: gcc-9
CXX: g++-9
BAZEL_DEFINES: |
--define=xnn_enable_avxvnni=false
--define=xnn_enable_avx256vnni=false
--define=xnn_enable_avxvnniint8=false
--define=xnn_enable_avx512amx=false
--define=xnn_enable_avx512fp16=false
--define=xnn_enable_avx512bf16=false
--define=xnn_enable_avx512vnni=false
--define=xnn_enable_avx512vnnigfni=false
--define=xnn_enable_avx512skx=false
--define=xnn_enable_avx512f=false
--define=ynn_enable_x86_amx=false
--define=ynn_enable_x86_avx512=false
steps:
- uses: actions/checkout@v6
- name: Mount Bazel Cache
uses: actions/cache@v5
with:
path: |
/home/xnnpack/.cache/bazel/disk_cache
/home/xnnpack/.cache/bazel/repo_cache
key: bazel-gcc9-opt-${{ runner.os }}-${{ github.job }}-${{ hashFiles('WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }}
restore-keys: |
bazel-gcc9-opt-${{ runner.os }}-${{ github.job }}-
- name: Build tests
if: ${{ !inputs.run-tests }}
run: |
bazel build \
-c opt \
--disk_cache=/home/xnnpack/.cache/bazel/disk_cache \
--repository_cache=/home/xnnpack/.cache/bazel/repo_cache \
${BAZEL_DEFINES} \
-- \
//test/... \
//bench/... \
//ynnpack/...
- name: Build and run tests
if: ${{ inputs.run-tests }}
run: |
bazel test \
-c opt \
--disk_cache=/home/xnnpack/.cache/bazel/disk_cache \
--repository_cache=/home/xnnpack/.cache/bazel/repo_cache \
--test_output=errors \
--local_test_jobs=HOST_CPUS \
${BAZEL_DEFINES} \
-- \
//test/... \
//bench/... \
//ynnpack/... \
//litert/... \
-//ynnpack/kernels/dot:get_dot_kernel_test
- name: Compress disk cache
if: ${{ inputs.update-caches }}
run: |
mkdir -p /home/xnnpack/.cache/bazel/disk_cache
find /home/xnnpack/.cache/bazel/disk_cache -type f -atime +7 -delete
bazel-linux-aarch64-clang18:
runs-on: 'arm-ubuntu-arm-22.04-8core'
timeout-minutes: 60
container:
image: ghcr.io/google/xnnpack/standard:latest
env:
CC: clang-18
CXX: clang++-18
steps:
- uses: actions/checkout@v6
- name: Mount Bazel Cache
uses: actions/cache@v5
with:
path: |
/home/xnnpack/.cache/bazel/disk_cache
/home/xnnpack/.cache/bazel/repo_cache
key: bazel-clang18-opt-${{ runner.os }}-${{ github.job }}-${{ hashFiles('WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }}
restore-keys: |
bazel-clang18-opt-${{ runner.os }}-${{ github.job }}-
- name: Build tests
if: ${{ !inputs.run-tests }}
run: |
bazel build \
-c opt \
--disk_cache=/home/xnnpack/.cache/bazel/disk_cache \
--repository_cache=/home/xnnpack/.cache/bazel/repo_cache \
--test_output=errors \
-- \
//test/... \
//bench/... \
//ynnpack/...
- name: Build and run tests
if: ${{ inputs.run-tests }}
run: |
bazel test \
-c opt \
--disk_cache=/home/xnnpack/.cache/bazel/disk_cache \
--repository_cache=/home/xnnpack/.cache/bazel/repo_cache \
--test_output=errors \
--local_test_jobs=HOST_CPUS \
--test_tag_filters=-not_run:arm \
-- \
//test/... \
//bench/... \
//ynnpack/... \
//litert/...
- name: Compress disk cache
if: ${{ inputs.update-caches }}
run: |
mkdir -p /home/xnnpack/.cache/bazel/disk_cache
find /home/xnnpack/.cache/bazel/disk_cache -type f -atime +7 -delete
bazel-linux-aarch64-gcc13:
# This ensures we have solid test coverage for _Float16
runs-on: 'arm-ubuntu-arm-22.04-8core'
timeout-minutes: 60
container:
image: ghcr.io/google/xnnpack/standard:latest
env:
CC: gcc-13
CXX: g++-13
BAZEL_DEFINES: |
--define=ynn_enable_arm64_sme=false
--define=ynn_enable_arm_neonbf16=false
--define=ynn_enable_arm64_sve=false
steps:
- uses: actions/checkout@v6
- name: Mount Bazel Cache
uses: actions/cache@v5
with:
path: |
/home/xnnpack/.cache/bazel/disk_cache
/home/xnnpack/.cache/bazel/repo_cache
key: bazel-gcc13-opt-${{ runner.os }}-${{ github.job }}-${{ hashFiles('WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }}
restore-keys: |
bazel-gcc13-opt-${{ runner.os }}-${{ github.job }}-
- name: Build tests
if: ${{ !inputs.run-tests }}
run: |
bazel build \
-c opt \
--disk_cache=/home/xnnpack/.cache/bazel/disk_cache \
--repository_cache=/home/xnnpack/.cache/bazel/repo_cache \
${BAZEL_DEFINES} \
-- \
//test/... \
//bench/... \
//ynnpack/... \
//litert/...
- name: Build and run tests
if: ${{ inputs.run-tests }}
run: |
bazel test \
-c opt \
--disk_cache=/home/xnnpack/.cache/bazel/disk_cache \
--repository_cache=/home/xnnpack/.cache/bazel/repo_cache \
--test_output=errors \
--local_test_jobs=HOST_CPUS \
${BAZEL_DEFINES} \
--test_tag_filters=-not_run:arm \
-- \
//test/... \
//bench/... \
//ynnpack/... \
//litert/...
- name: Compress disk cache
if: ${{ inputs.update-caches }}
run: |
mkdir -p /home/xnnpack/.cache/bazel/disk_cache
find /home/xnnpack/.cache/bazel/disk_cache -type f -atime +7 -delete
bazel-linux-aarch64-sme2-qemu:
runs-on: "arm-ubuntu-arm-22.04-8core"
timeout-minutes: 60
container:
image: ghcr.io/google/xnnpack/sme2:latest
env:
CC: clang-20
CXX: clang++-20
QEMU_ARGS: -cpu max
steps:
- uses: actions/checkout@v6
- name: Mount bazel cache
uses: actions/cache@v5
with:
path: "/home/xnnpack/.cache/bazel"
key: bazel-clang20-opt-sme2-${{ runner.os }}-${{ github.job }}-${{ hashFiles('WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }}
restore-keys: bazel-clang20-opt-sme2-${{ runner.os }}-${{ github.job }}-
- name: Build microkernel and subgraph tests
if: ${{ !inputs.run-tests }}
run: |
bazel build \
-c opt \
--copt=-g1 \
--copt=-DGOOGLE_COMMANDLINEFLAGS_FULL_API=1 \
--platforms=//build_config:aarch64_linux \
--run_under="qemu-aarch64 ${QEMU_ARGS} " \
--define xnn_enable_arm_sme2=true \
--dynamic_mode=off \
--features=fully_static_link \
--disk_cache=/home/xnnpack/.cache/bazel/disk_cache \
//test:qs8_qc8w_igemm_minmax_fp32_test \
//test:qp8_f32_qc4w_gemm_minmax_test \
//test:pf32_gemm_minmax_test \
//test:pf16_gemm_minmax_test \
//test:pqs8_qc8w_gemm_minmax_test \
//test/subgraph/... \
//ynnpack/...
working-directory: ${{ github.workspace }}
- name: Build and run microkernel tests
if: ${{ inputs.run-tests }}
run: |
bazel test \
-c opt \
--copt=-g1 \
--copt=-DGOOGLE_COMMANDLINEFLAGS_FULL_API=1 \
--platforms=//build_config:aarch64_linux \
--run_under="qemu-aarch64 ${QEMU_ARGS} " \
--define xnn_enable_arm_sme2=true \
--dynamic_mode=off \
--features=fully_static_link \
--disk_cache=/home/xnnpack/.cache/bazel/disk_cache \
--test_tag_filters=-not_run:arm,-noemulator \
//test:qs8_qc8w_igemm_minmax_fp32_test \
//test:qp8_f32_qc4w_gemm_minmax_test \
//test:pf32_gemm_minmax_test \
//test:pf16_gemm_minmax_test \
//test:pqs8_qc8w_gemm_minmax_test \
--cache_test_results=no \
--test_filter="*NEONSME2*" \
--test_output=errors \
--test_timeout=600 \
--local_test_jobs=$(nproc)
- name: Build and run subgraph tests
if: ${{ inputs.run-tests }}
run: |
bazel test \
-c opt \
--copt=-g1 \
--copt=-DGOOGLE_COMMANDLINEFLAGS_FULL_API=1 \
--platforms=//build_config:aarch64_linux \
--run_under="qemu-aarch64 ${QEMU_ARGS} " \
--define xnn_enable_arm_sme2=true \
--dynamic_mode=off \
--features=fully_static_link \
--disk_cache=/home/xnnpack/.cache/bazel/disk_cache \
--test_tag_filters=-not_run:arm,-noemulator \
//test/subgraph/... \
//ynnpack/... \
--cache_test_results=no \
--test_output=errors \
--test_timeout=600 \
--local_test_jobs=$(nproc)
- name: Compress disk cache
if: ${{ inputs.update-caches }}
run: |
mkdir -p /home/xnnpack/.cache/bazel
find "/home/xnnpack/.cache/bazel" -type f -atime +7 -delete