-
Notifications
You must be signed in to change notification settings - Fork 670
119 lines (109 loc) · 4.8 KB
/
perf.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
name: Performance Regression
on:
schedule:
#run at 15:30 UTC (23:30 UTC+8) on Friday
- cron: '30 15 * * 5'
#run at 15:30 UTC (23:30 UTC+8) Every two weeks
# - cron: '30 15 13,27 * *'
#run it manually when the workflow is in the default branch
workflow_dispatch:
inputs:
test_commit:
description: 'Commit SHA to run the workflow on'
required: false
default: ''
#only for test push
# push:
# branches: [ ci-perf-yml ]
jobs:
run:
runs-on: perf
continue-on-error: false
#At most 2 days to finish
timeout-minutes: 2880
name: Checkpoints
steps:
- name: Set test commit
id: set_test_commit
run: |
if [ "${{ github.event.inputs.test_commit }}" = "" ]; then
echo "Using latest commit."
echo "commit_sha=${{ github.sha }}" >> $GITHUB_OUTPUT
else
echo "Using specified commit: ${{ github.event.inputs.test_commit }}"
echo "commit_sha=${{ github.event.inputs.test_commit }}" >> $GITHUB_OUTPUT
fi
- name: Determine if this is the biweekly run
id: determine_run
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "run_biweekly=true" >> $GITHUB_OUTPUT
elif [ $(( $(date +'%V') % 2 )) -eq 1 ]; then
echo "run_biweekly=true" >> $GITHUB_OUTPUT
else
echo "run_biweekly=false" >> $GITHUB_OUTPUT
fi
- name: Checkout code at specific commit
if: steps.determine_run.outputs.run_biweekly == 'true'
uses: actions/checkout@v2
with:
ref: ${{ steps.set_test_commit.outputs.commit_sha }}
submodules: 'recursive'
- name: Set env
if: steps.determine_run.outputs.run_biweekly == 'true'
run: |
SHORT_SHA=$(git rev-parse --short HEAD)
DATE=$(git show -s --format=%cd --date=format:%y%m%d HEAD)
echo "NOOP_HOME=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "NEMU_HOME=/nfs/home/share/ci-workloads/NEMU" >> $GITHUB_ENV
echo "AM_HOME=/nfs/home/share/ci-workloads/nexus-am" >> $GITHUB_ENV
echo "PERF_HOME=/nfs/home/share/ci-workloads/env-scripts/perf" >> $GITHUB_ENV
echo "SPEC_DIR=/nfs/home/ci-runner/master-perf-report/cr${DATE}-${SHORT_SHA}" >> $GITHUB_ENV
echo "CKPT_HOME=/nfs/home/share/checkpoints_profiles/spec06_rv64gcb_O3_20m_gcc12.2.0-intFpcOff-jeMalloc/checkpoint-0-0-0" >> $GITHUB_ENV
echo "CKPT_JSON_PATH=/nfs/home/share/checkpoints_profiles/spec06_rv64gcb_O3_20m_gcc12.2.0-intFpcOff-jeMalloc/checkpoint-0-0-0/cluster-0-0.json" >> $GITHUB_ENV
- name: Clean Up
if: steps.determine_run.outputs.run_biweekly == 'true'
run: |
python3 $GITHUB_WORKSPACE/scripts/xiangshan.py --clean
- name: Build EMU with DRAMsim3
if: steps.determine_run.outputs.run_biweekly == 'true'
run: |
if [ -e "$SPEC_DIR/emu" ]; then
mkdir -p $NOOP_HOME/build
cp $SPEC_DIR/emu $NOOP_HOME/build/emu
else
python3 $GITHUB_WORKSPACE/scripts/xiangshan.py --build \
--dramsim3 /nfs/home/share/ci-workloads/DRAMsim3 \
--with-dramsim3 --threads 16 \
--pgo $GITHUB_WORKSPACE/ready-to-run/coremark-2-iteration.bin \
--llvm-profdata llvm-profdata
mkdir -p $SPEC_DIR
cp $NOOP_HOME/build/emu $SPEC_DIR/emu
fi
- name: Run SPEC CPU2006 checkpoints
if: steps.determine_run.outputs.run_biweekly == 'true'
run: |
cd $PERF_HOME
python3 xs_autorun_multiServer.py $CKPT_HOME $CKPT_JSON_PATH \
--xs $NOOP_HOME --threads 16 --dir $SPEC_DIR --resume \
-L "node033 node034 node036 node037 node038 node039 node040 node041 node042"
find $NOOP_HOME/build/ -maxdepth 1 -name "*.vcd" -exec mv {} $SPEC_DIR \;
- name: Report SPEC CPU2006 score
if: steps.determine_run.outputs.run_biweekly == 'true'
run: |
cd $PERF_HOME
python3 xs_autorun_multiServer.py $CKPT_HOME $CKPT_JSON_PATH \
--xs $NOOP_HOME --threads 16 --dir $SPEC_DIR \
--check --dump-json-path $SPEC_DIR/err_ckps.json
python3 xs_autorun_multiServer.py $CKPT_HOME $CKPT_JSON_PATH \
--xs $NOOP_HOME --threads 16 --dir $SPEC_DIR --report \
> $SPEC_DIR/score.txt
mkdir $GITHUB_WORKSPACE/result
cp $SPEC_DIR/err_ckps.json $GITHUB_WORKSPACE/result/err_ckps.json
cp $SPEC_DIR/score.txt $GITHUB_WORKSPACE/result/score.txt
- name: Upload result
if: steps.determine_run.outputs.run_biweekly == 'true'
uses: actions/upload-artifact@v4
with:
name: result
path: result