1*da0073e9SAndroid Build Coastguard Worker#!/bin/bash 2*da0073e9SAndroid Build Coastguard Worker 3*da0073e9SAndroid Build Coastguard Worker# This is a very simple script that runs all three benchmark suites 4*da0073e9SAndroid Build Coastguard Worker# and then runs a log parsing script to get the logs into a csv form 5*da0073e9SAndroid Build Coastguard Worker# and uploads the result to GitHub Gist for easy copy paste into Google 6*da0073e9SAndroid Build Coastguard Worker# Spreadsheet. 7*da0073e9SAndroid Build Coastguard Worker# 8*da0073e9SAndroid Build Coastguard Worker# Useful flag sets: 9*da0073e9SAndroid Build Coastguard Worker# 10*da0073e9SAndroid Build Coastguard Worker# Run models that are skipped in dynamic CI only, to update skips 11*da0073e9SAndroid Build Coastguard Worker# ./run_all.sh --training --backend aot_eager --dynamic-ci-skips-only 12*da0073e9SAndroid Build Coastguard Worker# 13*da0073e9SAndroid Build Coastguard Worker# Run CI models with dynamic shapes, training, aot_eager 14*da0073e9SAndroid Build Coastguard Worker# ./run_all.sh --training --backend aot_eager --dynamic-shapes --ci 15*da0073e9SAndroid Build Coastguard Worker# 16*da0073e9SAndroid Build Coastguard Worker# Run CI models with dynamic shapes, inference, inductor 17*da0073e9SAndroid Build Coastguard Worker# ./run_all.sh --backend inductor --dynamic-shapes --ci 18*da0073e9SAndroid Build Coastguard Worker# 19*da0073e9SAndroid Build Coastguard Worker# WARNING: this will silently clobber .csv and .log files in your CWD! 20*da0073e9SAndroid Build Coastguard Worker 21*da0073e9SAndroid Build Coastguard Workerset -x 22*da0073e9SAndroid Build Coastguard Worker 23*da0073e9SAndroid Build Coastguard Worker# Some QoL for people running this script on Meta servers 24*da0073e9SAndroid Build Coastguard Workerif getent hosts fwdproxy; then 25*da0073e9SAndroid Build Coastguard Worker export https_proxy=http://fwdproxy:8080 http_proxy=http://fwdproxy:8080 no_proxy=.fbcdn.net,.facebook.com,.thefacebook.com,.tfbnw.net,.fb.com,.fburl.com,.facebook.net,.sb.fbsbx.com,localhost 26*da0073e9SAndroid Build Coastguard Workerfi 27*da0073e9SAndroid Build Coastguard Worker 28*da0073e9SAndroid Build Coastguard Worker# Feel free to edit these, but we expect most users not to need to modify this 29*da0073e9SAndroid Build Coastguard WorkerBASE_FLAGS=( --accuracy --explain --timing --print-graph-breaks ) 30*da0073e9SAndroid Build Coastguard WorkerDATE="$(date)" 31*da0073e9SAndroid Build Coastguard WorkerWORK="$PWD" 32*da0073e9SAndroid Build Coastguard Worker 33*da0073e9SAndroid Build Coastguard Workercd "$(dirname "$BASH_SOURCE")"/../.. 34*da0073e9SAndroid Build Coastguard Worker 35*da0073e9SAndroid Build Coastguard Workerpython benchmarks/dynamo/benchmarks.py --output "$WORK"/benchmarks.csv "${BASE_FLAGS[@]}" "$@" 2>&1 | tee "$WORK"/sweep.log 36*da0073e9SAndroid Build Coastguard Workergh gist create -d "Sweep logs for $(git rev-parse --abbrev-ref HEAD) $* - $(git rev-parse HEAD) $DATE" "$WORK"/sweep.log | tee -a "$WORK"/sweep.log 37*da0073e9SAndroid Build Coastguard Workerpython benchmarks/dynamo/parse_logs.py "$WORK"/sweep.log > "$WORK"/final.csv 38*da0073e9SAndroid Build Coastguard Workergh gist create "$WORK"/final.csv 39