@@ -3,29 +3,14 @@ name: 'Benchmark'
33on : pull_request
44
55jobs :
6- file-changes :
7- name : Detect File Changes
8- runs-on : ' ubuntu-latest'
9- outputs :
10- checkall : ${{ steps.changes.outputs.checkall }}
11- steps :
12- - name : Clone
13- uses : actions/checkout@v4
14-
15- - name : Detect Changes
16- uses : dorny/paths-filter@v3
17- id : changes
18- with :
19- filters : " .github/file-filter.yml"
20-
216 self :
227 name : Georgia Tech | Phoenix (NVHPC)
238 if : github.repository == 'MFlowCode/MFC'
249 strategy :
2510 matrix :
2611 device : ['cpu', 'gpu']
2712 runs-on :
28- group : phoenix
13+ group : phoenix
2914 labels : gt
3015 timeout-minutes : 1400
3116 env :
@@ -48,16 +33,39 @@ jobs:
4833 run : |
4934 (cd pr && bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/bench.sh ${{ matrix.device }}) &
5035 (cd master && bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/bench.sh ${{ matrix.device }}) &
51- wait %1 && wait %2
36+ wait
37+
38+ (cd pr && bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/bench.sh ${{ matrix.device }} --single) &
39+ (cd master && bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/bench.sh ${{ matrix.device }} --single) &
40+ wait
41+
42+ - name : Check Speedup
43+ run : |
44+ cd pr
45+ . ./mfc.sh load -c p -m ${{ matrix.device }}
46+
47+ single_time=$(grep "Runtime:" bench-${{ matrix.device }}-single.yaml | awk '{print $2}')
48+ double_time=$(grep "Runtime:" bench-${{ matrix.device }}.yaml | awk '{print $2}')
49+ speedup=$(echo "$double_time / $single_time" | bc -l)
50+
51+ echo "Single precision time: $single_time"
52+ echo "Double precision time: $double_time"
53+ echo "Speedup: $speedup"
54+
55+ if (( $(echo "$speedup < 1.5" | bc -l) )); then
56+ echo "Error: Speedup is less than 1.5x in single precision"
57+ exit 1
58+ fi
5259
5360 - name : Generate & Post Comment
5461 run : |
55- (cd pr && . ./mfc.sh load -c p -m g)
56- (cd pr && ./mfc.sh bench_diff ../master/bench-${{ matrix.device }}.yaml ../pr/bench-${{ matrix.device }}.yaml)
62+ cd pr
63+ . ./mfc.sh load -c p -m ${{ matrix.device }}
64+ ./mfc.sh bench_diff ../master/bench-${{ matrix.device }}.yaml bench-${{ matrix.device }}.yaml
5765
5866 - name : Archive Logs
5967 uses : actions/upload-artifact@v3
60- if : always()
68+ if : always()
6169 with :
6270 name : logs-${{ matrix.device }}
6371 path : |
0 commit comments