-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (64 loc) · 2.58 KB
/
benchmarking.yaml
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
name: Continuous Benchmarking
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
types: [opened, reopened, edited, synchronize]
workflow_dispatch:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
benchmark_pr_branch:
name: Continuous Benchmarking PRs with Bencher
# DO NOT REMOVE: For handling Fork PRs see Pull Requests from Forks
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bencherdev/bencher@main
- name: Set Flags
run: export USE_CUDA=0
- name: Install Protobuf
run: sudo apt install protobuf-compiler
- name: Install Python dependencies
uses: py-actions/py-dependency-install@v4
with:
path: "PyTorch_requirements.txt"
- name: Make Build Directory
run: mkdir build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
# Configure CMake with benchmarking option on
run: |
cmake --debug-output -DNT_USE_PCH=ON -DNT_ENABLE_BENCHMARKING=ON -DCMAKE_PREFIX_PATH=`python3 -c 'import torch;print(torch.utils.cmake_prefix_path)'` -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ..
echo :::: Build directory post-CMake:
ls
echo
echo :::: _deps directory:
ls _deps
echo
echo :::: benchmark link file:
cat benchmarks/CMakeFiles/benchmarks.dir/link.txt
- name: Build
working-directory: ${{github.workspace}}/build
# Build your program with the given configuration
run: make --trace #cmake --build ${{github.workspace}}/build
- name: Track PR Benchmarks with Bencher
working-directory: ${{github.workspace}}/build
run: |
ls
bencher run \
--project nutens \
--token '${{ secrets.BENCHER_API_TOKEN }}' \
--branch '${{ github.head_ref }}' \
--branch-start-point '${{ github.base_ref }}' \
--branch-start-point-hash '${{ github.event.pull_request.base.sha }}' \
--testbed ubuntu-latest \
--adapter cpp_google \
--err \
--github-actions '${{ secrets.GITHUB_TOKEN }}' \
"./benchmarks/benchmarks --benchmark_format=json --benchmark_repetitions=16 --benchmark_min_warmup_time=60" \