-
Notifications
You must be signed in to change notification settings - Fork 23
Added benchmarking script #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
f7dbd01
0f0e70b
c9b6e8e
ce247b2
edb79af
f9152bf
2b4bb22
2a39c8c
f8a481d
a28a0b9
58a1671
897b6a7
f36e738
04a797f
8b0bd83
01d927d
78b9845
1aa86c7
8396e03
67b8430
5b140bc
bea0b45
7762ad6
bae3e63
289b59a
85f1fc2
9c9a6b1
a42b376
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,5 @@ | |
| __pycache__/ | ||
| # emacs backup files | ||
| *~ | ||
| # default output for benchmark runs | ||
| benchmark_output | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,8 @@ ENV CUDA_ARCHITECTURES="70;75;80;86;89;90;100;120" | |
| ENV EXTRA_CMAKE_FLAGS=${EXTRA_CMAKE_FLAGS} | ||
| ENV NUM_THREADS=${NUM_THREADS} | ||
|
|
||
| RUN rpm --import https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub && dnf config-manager --add-repo "https://developer.download.nvidia.com/devtools/repos/rhel$(source /etc/os-release; echo ${VERSION_ID%%.*})/$(rpm --eval '%{_arch}' | sed s/aarch/arm/)/" && dnf install -y nsight-systems-cli-2025.5.1.121 | ||
|
|
||
|
karthikeyann marked this conversation as resolved.
|
||
| RUN mkdir /runtime-libraries | ||
|
|
||
| RUN --mount=type=bind,source=presto/presto-native-execution,target=/presto_native_staging/presto \ | ||
|
|
@@ -24,4 +26,4 @@ RUN mkdir /usr/lib64/presto-native-libs && \ | |
| cp /runtime-libraries/* /usr/lib64/presto-native-libs/ && \ | ||
| echo "/usr/lib64/presto-native-libs" > /etc/ld.so.conf.d/presto_native.conf | ||
|
karthikeyann marked this conversation as resolved.
Outdated
|
||
|
|
||
| CMD bash -c "ldconfig && presto_server --etc-dir=/opt/presto-server/etc" | ||
| CMD bash -c "ldconfig && nsys launch presto_server --etc-dir=/opt/presto-server/etc" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did this work? I was just assuming this would work but @karthikeyann tried it last night and couldn't get it to work until he started the container in interactive mode and manually ran
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has been working for me - at least in so far as it generates profiles. What issue was he running into when he attempted this approach?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. some of the arguments need to be given during
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| #!/bin/bash | ||
|
|
||
| BASE_DIR="$(dirname $(realpath $0))/../.." | ||
| CREATE_TABLES="" | ||
| CREATE_PROFILES="" | ||
| QUERIES="Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22" | ||
|
|
||
| function print_help() { | ||
| cat << EOF | ||
|
|
||
| Usage: $0 [OPTIONS] | ||
|
|
||
| This script runs tpch benchmarks | ||
|
|
||
| OPTIONS: | ||
| -h, --help Show this help message. | ||
| -c, --create-tables Create the tpch tables. | ||
| -p, --profile Profile queries with nsys | ||
| -q, --queries Set of benchmark queries to run. This should be a comma separate list of query numbers. | ||
| By default, all benchmark queries are run. | ||
|
|
||
| EXAMPLES: | ||
| $0 -c -q "Q1, Q2" -p | ||
| $0 -h | ||
|
|
||
| EOF | ||
| } | ||
|
|
||
| function parse_args() { | ||
| while [[ $# -gt 0 ]]; do | ||
| case $1 in | ||
| -h|--help) | ||
| print_help | ||
| exit 0 | ||
| ;; | ||
| -c|--create-tables) | ||
| CREATE_TABLES=true | ||
| shift 1 | ||
| ;; | ||
| -p|--profile) | ||
| CREATE_PROFILES=true | ||
| shift 1 | ||
| ;; | ||
| -q|--queries) | ||
| if [[ -n $2 ]]; then | ||
| QUERIES=$2 | ||
| shift 2 | ||
| else | ||
| echo "Error: --queries requires a value" | ||
| exit 1 | ||
| fi | ||
| ;; | ||
| *) | ||
| echo "Error: Unknown argument $1" | ||
| print_help | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| done | ||
| } | ||
|
|
||
| function create_tables() { | ||
| pattern="\/([^\/]*)\.sql" | ||
| for sql_file in $(ls $BASE_DIR/presto/testing/integration_tests/schemas/tpch/*.sql); do | ||
| if [[ "$sql_file" =~ $pattern ]]; then | ||
| table_name="${BASH_REMATCH[1]}" | ||
| drop_table="DROP TABLE IF EXISTS $table_name" | ||
| else | ||
| echo "failed to parse schema files" | ||
| exit 1 | ||
| fi | ||
| docker compose -f $BASE_DIR/presto/docker/docker-compose.native-gpu.yml exec presto-cli presto-cli --server presto-coordinator:8080 --catalog hive --schema tpch_test --execute "$drop_table" | ||
| table_dir="/var/lib/presto/data/hive/data/integration_test/tpch/$table_name" | ||
| create_table=$(cat $sql_file | sed "s+{file_path}+$table_dir+g") | ||
| docker compose -f $BASE_DIR/presto/docker/docker-compose.native-gpu.yml exec presto-cli presto-cli --server presto-coordinator:8080 --catalog hive --schema tpch_test --execute "$create_table" | ||
| done | ||
| } | ||
|
|
||
| # TODO: Q5 uses a constant that needs to be modified based on the SF of the data (it currently is not). | ||
|
karthikeyann marked this conversation as resolved.
Outdated
|
||
| function run_queries() { | ||
| worker_exec="docker compose -f $BASE_DIR/presto/docker/docker-compose.native-gpu.yml exec presto-native-worker-gpu" | ||
| cli_exec="docker compose -f $BASE_DIR/presto/docker/docker-compose.native-gpu.yml exec presto-cli" | ||
| for query in $QUERIES; do | ||
| sql=$(cat $BASE_DIR/presto/testing/integration_tests/queries/tpch/queries.json | jq ".$query") | ||
| sql="${sql:1:-1}" # remove quotes wrapping query. | ||
| sql=$(echo "$sql" | sed "s/LIMIT .*//g") # removing limits | ||
| out="$BASE_DIR/benchmark_output/tpch/$query.out" | ||
| echo "running $query" | ||
| [ -z "$CREATE_PROFILES" ] || $worker_exec bash -c "nsys start -o /benchmark_output/$query.nsys-rep --force-overwrite true" | ||
| $cli_exec presto-cli --server presto-coordinator:8080 --catalog hive --schema tpch_test --execute "$sql" > $out | ||
| [ -z "$CREATE_PROFILES" ] || $worker_exec bash -c "nsys stop" | ||
| done | ||
| } | ||
|
|
||
| parse_args "$@" | ||
| [ -z "$CREATE_TABLES" ] || create_tables | ||
| run_queries | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Install a pinned version of nsys to the container.