-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements to Benchmark Scripts and Config Generation Workflow (#13)
* fix benches and add verify configs Signed-off-by: Yu Chin Fabian Lim <[email protected]> * update readme and add workflow Signed-off-by: Yu Chin Fabian Lim <[email protected]> * add packaging dep Signed-off-by: Yu Chin Fabian Lim <[email protected]> * update torch dep in framework and run-benches Signed-off-by: Yu Chin Fabian Lim <[email protected]> * take host env in run-benches * add display bench results script * rename summary.csv to raw_summary.csv and update run_benchmarks.sh * export environment variables in shell command * dump out pip requirements for repro, and add default FHT_branch --------- Signed-off-by: Yu Chin Fabian Lim <[email protected]>
- Loading branch information
Showing
9 changed files
with
146 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Standard | ||
import argparse | ||
|
||
# First Party | ||
# import this because of alot of internal contants | ||
from scripts.benchmarks.benchmark import gather_report | ||
|
||
|
||
def main(*directories: str, output_filename: str = "results.csv"): | ||
"gather outputs from a list of directories and output to a csv" | ||
|
||
df, constant = gather_report(*directories, raw=False) | ||
errors = [] | ||
try: | ||
# remove error messages if any | ||
errors = df.error_messages | ||
errors = errors.loc[errors.isna() == False] | ||
df = df.loc[df.error_messages.isna()] | ||
except: | ||
pass | ||
df = df.reset_index().drop("output_dir", axis=1) | ||
df.reindex(sorted(df.columns), axis=1).to_csv( | ||
output_filename, index=False | ||
) | ||
print("***************** Report Created ******************") | ||
print(f"Total lines: '{len(df)}'") | ||
print(f"Number columns included: '{len(df.columns)}'") | ||
print(f"Number columns excluded: '{len(constant)}'") | ||
print(f"Excluding number of exceptions caught: '{len(errors)}'") | ||
print(f"Written report to '{output_filename}'") | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
parser = argparse.ArgumentParser( | ||
prog="Acceleration Benchmarking Reporting Tool", | ||
description="This script gathers a set benchmarks to produce a CSV report", | ||
) | ||
parser.add_argument( | ||
"bench_outputs", | ||
nargs="+", | ||
help="list of directories from which to gather bench outputs.", | ||
) | ||
parser.add_argument( | ||
"--result_file", | ||
default="results.csv", | ||
help="name of final csv report file.", | ||
) | ||
args = parser.parse_args() | ||
main(args.bench_outputs, output_filename=args.result_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
OUTPUT_DIR=${1:-sample-configurations} | ||
|
||
GIT_DIFF=$(git diff HEAD -- $OUTPUT_DIR) | ||
echo "git diff of configurations with HEAD:" | ||
echo "$GIT_DIFF" | ||
|
||
function echoWarning() { | ||
LIGHT_YELLOW='\033[1;33m' | ||
NC='\033[0m' # No Color | ||
echo -e "${LIGHT_YELLOW}${1}${NC}" | ||
} | ||
|
||
if [ ! -z "$GIT_DIFF" ]; then | ||
echoWarning "At least one of the configs in the plugins should have changed." | ||
echoWarning "Please run 'tox -e gen-configs' to ensure that the sample-configurations are correctly generated!" | ||
echoWarning "After that commit the generated sample-configurations to remove this error." | ||
exit 1 | ||
fi | ||
|
||
echo "sample configurations up to date with configs in plugin directories" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters