forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (106 loc) · 3.62 KB
/
_buck-build-test.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
name: buck
on:
workflow_call:
inputs:
test-matrix:
required: true
type: string
description: |
A JSON description of what configs to run later on.
defaults:
run:
shell: bash -e -l {0}
jobs:
filter:
runs-on: [self-hosted, linux.large]
outputs:
test-matrix: ${{ steps.filter.outputs.test-matrix }}
is-test-matrix-empty: ${{ steps.filter.outputs.is-test-matrix-empty }}
keep-going: ${{ steps.filter.outputs.keep-going }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
fetch-depth: 1
submodules: false
- name: Select all requested test configurations
id: filter
uses: ./.github/actions/filter-test-configs
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
test-matrix: ${{ inputs.test-matrix }}
buck-build-test:
needs: filter
if: github.repository_owner == 'pytorch' && needs.filter.outputs.is-test-matrix-empty == 'False'
strategy:
matrix: ${{ fromJSON(needs.filter.outputs.test-matrix) }}
fail-fast: false
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
- name: Setup miniconda
uses: pytorch/test-infra/.github/actions/setup-miniconda@main
with:
python-version: 3.8
environment-file: .github/requirements/conda-env-${{ runner.os }}-${{ runner.arch }}
- name: Install Buck
uses: nick-fields/retry@3e91a01664abd3c5cd539100d10d33b9c5b68482
with:
timeout_minutes: 10
max_attempts: 5
command: |
sudo apt update -q
wget -q https://github.com/facebook/buck/releases/download/v2021.01.12.01/buck.2021.01.12.01_all.deb
sudo apt install ./buck.2021.01.12.01_all.deb
- name: Download third party libraries and generate wrappers
uses: nick-fields/retry@3e91a01664abd3c5cd539100d10d33b9c5b68482
with:
timeout_minutes: 10
max_attempts: 5
command: |
bash scripts/buck_setup.sh
- name: Build tools
run: |
buck build tools: --keep-going
- name: Run tools tests
run: |
buck test tools:selective_build_test tools:gen_oplist_test tools:gen_operators_yaml_test
- name: Build c10
run: |
buck build c10:c10
- name: Build XNNPACK
run: |
buck build third_party:XNNPACK
- name: Build QNNPACK
run: |
buck build aten/src/ATen/native/quantized/cpu/qnnpack:pytorch_qnnpack
- name: Test QNNPACK
run: |
buck test aten/src/ATen/native/quantized/cpu/qnnpack:pytorch_qnnpack_test
- name: Build aten_cpu
run: |
buck build :aten_cpu
- name: Build torch_mobile_core
run: |
buck build :torch_mobile_core
- name: Build pt_ops_full
run: |
buck build :pt_ops_full
- name: Build mobile benchmark
run: |
buck build :ptmobile_benchmark
- name: Run lite interpreter model
run: |
buck run :ptmobile_benchmark -- --model=ios/TestApp/models/mobilenet_v2.ptl --input_dims=1,3,224,224 --input_type=float
- name: Build everything
run: |
buck build //... --keep-going
- name: Build aten_cpu@shared
run: |
buck build :aten_cpu#linux-x86_64,shared