Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f7dbd01
Added benchmarking script
misiugodfrey Sep 4, 2025
0f0e70b
Fixed misleading comment
misiugodfrey Sep 4, 2025
c9b6e8e
force overwrite on nsys profile files
misiugodfrey Sep 5, 2025
ce247b2
testing new timings method
misiugodfrey Sep 8, 2025
edb79af
Merge branch 'main' of https://github.com/rapidsai/velox-testing into…
misiugodfrey Sep 9, 2025
f9152bf
Merge branch 'main' of https://github.com/rapidsai/velox-testing into…
misiugodfrey Sep 9, 2025
2b4bb22
Added support for runs via curl
misiugodfrey Sep 10, 2025
2a39c8c
Merge branch 'main' of https://github.com/rapidsai/velox-testing into…
misiugodfrey Sep 10, 2025
f8a481d
Merge branch 'main' into misiug/Benchmarking
misiugodfrey Sep 16, 2025
a28a0b9
added nsys launch options and added a schema parameter
misiugodfrey Sep 17, 2025
58a1671
Additional requirements for fresh arm build
misiugodfrey Sep 17, 2025
897b6a7
Merge branch 'main' of https://github.com/rapidsai/velox-testing into…
misiugodfrey Sep 17, 2025
f36e738
Merge branch 'main' into misiug/Benchmarking
karthikeyann Sep 22, 2025
04a797f
Removed limits and added custom data/schema support
misiugodfrey Sep 23, 2025
8b0bd83
Removed limits and added custom data/schema support
misiugodfrey Sep 23, 2025
01d927d
Merge branch 'misiug/Benchmarking' of https://github.com/rapidsai/vel…
misiugodfrey Sep 23, 2025
78b9845
Fix profiling and permissions with output directory
misiugodfrey Sep 23, 2025
1aa86c7
Merge branch 'main' into misiug/Benchmarking
misiugodfrey Sep 23, 2025
8396e03
Added warmup queries and some other cleanup
misiugodfrey Sep 23, 2025
67b8430
Merge branch 'misiug/Benchmarking' of https://github.com/rapidsai/vel…
misiugodfrey Sep 23, 2025
5b140bc
minor adjustment
misiugodfrey Sep 23, 2025
bea0b45
formatting
misiugodfrey Sep 23, 2025
7762ad6
formatting
misiugodfrey Sep 23, 2025
bae3e63
fixed typo
misiugodfrey Sep 23, 2025
289b59a
Added number of iterations to benchmarking script
misiugodfrey Sep 24, 2025
85f1fc2
fixed avg parsing to handle the command-line case
misiugodfrey Sep 24, 2025
9c9a6b1
Changed cli to get elapsed time from web UI rather than time it.
misiugodfrey Sep 25, 2025
a42b376
Merge branch 'main' into misiug/Benchmarking
karthikeyann Sep 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
__pycache__/
# emacs backup files
*~
# default output for benchmark runs
benchmark_output
1 change: 1 addition & 0 deletions presto/docker/config/etc_common/catalog/hive.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ connector.name=hive-hadoop2
hive.metastore=file
hive.metastore.catalog.dir=file:/var/lib/presto/data/hive/metastore
hive.allow-drop-table=true
hive.file-splittable=false
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ discovery.uri=http://presto-coordinator:8080
presto.version=testversion

# Query execution settings
query.max-memory=2GB
query.max-memory-per-node=1GB
query.max-total-memory-per-node=1GB
query.max-memory=20GB
query.max-memory-per-node=10GB
query.max-total-memory-per-node=10GB

# Set required workers to 1 (minimum allowed) and reduce wait time
query-manager.required-workers=1
query-manager.required-workers-max-wait=10s

single-node-execution-enabled=true

# Set required configuration for Presto C++ workers as indicated in https://prestodb.io/docs/current/presto_cpp/properties.html#coordinator-properties
native-execution-enabled=true
optimizer.optimize-hash-generation=false
Expand Down
2 changes: 2 additions & 0 deletions presto/docker/config/etc_worker/config_native.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ http-server.http.port=8080
discovery.uri=http://presto-coordinator:8080

presto.version=testversion

task.max-drivers-per-task=4
11 changes: 11 additions & 0 deletions presto/docker/docker-compose.common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ services:
volumes:
- ./config/etc_common:/opt/presto-server/etc
- ../testing/integration_tests/data:/var/lib/presto/data/hive/data/integration_test
- ../testing/integration_tests/queries:/queries
- ../../benchmark_output:/benchmark_output

presto-base-coordinator:
extends:
Expand All @@ -25,3 +27,12 @@ services:
volumes:
- ./config/etc_worker/config_native.properties:/opt/presto-server/etc/config.properties
- ./config/etc_worker/node.properties:/opt/presto-server/etc/node.properties

# Cli interface for running queries from the command line.
# Example: docker compose -f docker-compose-native_gpu.yml exec presto-cli presto-cli --server presto-coordinator:8080 --catalog hive --schema sf1k --execute $(cat "$query.sql") > query_output.txt
presto-base-cli:
image: prestodb/presto:latest
container_name: presto-cli
command: ["tail", "-f", "/dev/null"] # Keep container running
depends_on:
- presto-coordinator
5 changes: 5 additions & 0 deletions presto/docker/docker-compose.java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ services:
- ./config/etc_worker/node.properties:/opt/presto-server/etc/node.properties
depends_on:
- presto-coordinator

presto-cli:
extends:
file: docker-compose.common.yml
service: presto-base-cli
5 changes: 5 additions & 0 deletions presto/docker/docker-compose.native-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ services:
- GPU=OFF
depends_on:
- presto-coordinator

presto-cli:
extends:
file: docker-compose.common.yml
service: presto-base-cli
5 changes: 5 additions & 0 deletions presto/docker/docker-compose.native-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ services:
- NVIDIA_VISIBLE_DEVICES=all
depends_on:
- presto-coordinator

presto-cli:
extends:
file: docker-compose.common.yml
service: presto-base-cli
4 changes: 3 additions & 1 deletion presto/docker/native_build.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Contributor Author

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.


Comment thread
karthikeyann marked this conversation as resolved.
RUN mkdir /runtime-libraries

RUN --mount=type=bind,source=presto/presto-native-execution,target=/presto_native_staging/presto \
Expand All @@ -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
Comment thread
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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 nsys launch presto_server ...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some of the arguments need to be given during nsys launch itself.
Please add required arguments for nsys here. I got this from our old velox benchmark scripts.

CMD bash -c "ldconfig && nsys launch -t nvtx,cuda,osrt \
        --cuda-memory-usage=true \
        --cuda-um-cpu-page-faults=true \
        --cuda-um-gpu-page-faults=true \
         presto_server --etc-dir=/opt/presto-server/etc"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add --gpu-metrics-devices, --cudabacktrace

97 changes: 97 additions & 0 deletions presto/scripts/run_benchmarks.sh
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).
Comment thread
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