Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
16b3b23
Slurm scripts
misiugodfrey Jan 28, 2026
ba18211
untested refactor
misiugodfrey Jan 30, 2026
5883a96
Refactor
Jan 30, 2026
0e61ed7
fix config bug
Jan 30, 2026
a8c995b
more generate fixes
Jan 30, 2026
30efdd6
Appeneded to launch
Jan 30, 2026
5a3e4b4
reverted script changes and copy metadata
Feb 3, 2026
cf4db8f
Merge branch 'main' into misiug/slurmscripts
misiugodfrey Feb 4, 2026
cb86355
remove dead code
Feb 4, 2026
82da5a2
remove absolute paths
Feb 4, 2026
e2d76ce
Merge branch 'main' of https://github.com/rapidsai/velox-testing into…
misiugodfrey Feb 7, 2026
90aceba
Store Results for Validation (#226)
quasiben Feb 10, 2026
b2b31ef
Merge branch 'main' into misiug/slurmscripts
karthikeyann Feb 10, 2026
03ac13c
Applied config changes in a heirarchy. Sorted out GPU_IDs
misiugodfrey Feb 11, 2026
9650e93
More config changes
misiugodfrey Feb 11, 2026
f860f7f
Updated configs and fixed merge breaks
Feb 11, 2026
29895a8
config for run-multiple
Feb 12, 2026
495ba1e
Merge branch 'misiug/slurmscripts' of https://github.com/rapidsai/vel…
Feb 12, 2026
2ec686c
Merge branch 'main' of https://github.com/rapidsai/velox-testing into…
Feb 13, 2026
100b111
coord image
Feb 13, 2026
60bfdf4
duplicate worker configs every time
Feb 13, 2026
fd9dd2e
Merge branch 'main' of https://github.com/rapidsai/velox-testing into…
Feb 13, 2026
21bb50e
save all results
Feb 13, 2026
923c555
Pull hive_metastore from data source
Feb 13, 2026
2936d88
pre-check
misiugodfrey Feb 13, 2026
a5df54f
fix ignoring of num_iterations
Feb 13, 2026
5f39713
Merge branch 'main' of https://github.com/rapidsai/velox-testing into…
Feb 13, 2026
53caa9d
fix merge with python 3.12
Feb 13, 2026
668ab08
slurm profiling - first pass
Feb 14, 2026
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
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,14 @@ presto/docker/config/generated*/
# Generated Presto Docker Compose files
presto/docker/docker-compose/generated*/

# Slurm logs and results
presto/slurm/presto-nvl72/logs/
presto/slurm/presto-nvl72/*.err
presto/slurm/presto-nvl72/*.out
presto/slurm/presto-nvl72/result_dir/
presto/slurm/presto-nvl72/kept_results/
presto/slurm/presto-nvl72/worker_data/
presto/slurm/presto-nvl72/profiles/
presto/slurm/presto-nvl72/worker_info/

devstate*
22 changes: 13 additions & 9 deletions benchmark_data_tools/duckdb_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import duckdb


def quote_ident(name: str) -> str:
return '"' + name.replace('"', '""') + '"'


def init_benchmark_tables(benchmark_type, scale_factor):
tables = duckdb.sql("SHOW TABLES").fetchall()
assert len(tables) == 0
Expand All @@ -22,27 +26,27 @@ def init_benchmark_tables(benchmark_type, scale_factor):
def drop_benchmark_tables():
tables = duckdb.sql("SHOW TABLES").fetchall()
for (table,) in tables:
duckdb.sql(f"DROP TABLE {table}")
duckdb.sql(f"DROP TABLE {quote_ident(table)}")


def create_table(table_name, data_path):
duckdb.sql(f"DROP TABLE IF EXISTS {table_name}")
duckdb.sql(f"CREATE TABLE {table_name} AS SELECT * FROM '{data_path}/*.parquet';")
duckdb.sql(f"DROP TABLE IF EXISTS {quote_ident(table_name)}")
duckdb.sql(f"CREATE TABLE {quote_ident(table_name)} AS SELECT * FROM '{data_path}/*.parquet';")


# Generates a sample table with a small limit.
# This is mainly used to extract the schema from the parquet files.
def create_not_null_table_from_sample(table_name, data_path):
duckdb.sql(f"DROP TABLE IF EXISTS {table_name}")
duckdb.sql(f"CREATE TABLE {table_name} AS SELECT * FROM '{data_path}/*.parquet' LIMIT 10;")
ret = duckdb.sql(f"DESCRIBE TABLE {table_name}").fetchall()
duckdb.sql(f"DROP TABLE IF EXISTS {quote_ident(table_name)}")
duckdb.sql(f"CREATE TABLE {quote_ident(table_name)} AS SELECT * FROM '{data_path}/*.parquet' LIMIT 10;")
ret = duckdb.sql(f"DESCRIBE TABLE {quote_ident(table_name)}").fetchall()
for row in ret:
duckdb.sql(f"ALTER TABLE {table_name} ALTER COLUMN {row[0]} SET NOT NULL;")
duckdb.sql(f"ALTER TABLE {quote_ident(table_name)} ALTER COLUMN {row[0]} SET NOT NULL;")


def create_table_from_sample(table_name, data_path):
duckdb.sql(f"DROP TABLE IF EXISTS {table_name}")
duckdb.sql(f"CREATE TABLE {table_name} AS SELECT * FROM '{data_path}/*.parquet' LIMIT 10;")
duckdb.sql(f"DROP TABLE IF EXISTS {quote_ident(table_name)}")
duckdb.sql(f"CREATE TABLE {quote_ident(table_name)} AS SELECT * FROM '{data_path}/*.parquet' LIMIT 10;")


def is_decimal_column(column_type):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ optimizer.generate-domain-filters=true
# Upper limit for broadcasted table size to avoid memory blowups.
# See: https://github.com/prestodb/presto/issues/22161#issuecomment-1994128619
join-max-broadcast-table-size={{ .JoinMaxBroadcastTableSizeMb }}MB
# Default is AUTOMATIC, ucx exchange does not support BROADCAST partition type.
# overwritten to "PARTITIONED" in multi-node context
join-distribution-type=AUTOMATIC

# Client request timeout to avoid hung queries.
Expand All @@ -58,7 +58,7 @@ query.execution-policy=phased
# Kill queries based on total reservation on blocked nodes to recover memory.
query.low-memory-killer.policy=total-reservation-on-blocked-nodes
# Upper limit on query wall time to keep tests bounded.
query.max-execution-time=30m
query.max-execution-time=10m
# Keep metadata of up to 1000 queries for UI and debugging.
query.max-history=1000
# Memory quotas per node and cluster to protect stability.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ system-mem-limit-gb={{ sub .ContainerMemoryGb .GeneratorParameters.MemoryPushBac
system-mem-shrink-gb=20

# Optimize for single-node execution when the entire query can run locally.
# overwritten to "false" in multi-node settings.
single-node-execution-enabled=true

# Enable cuDF (CPU mode will ignore this setting)
cudf.enabled=true
# overwritten to "true" in multi-node settings.
cudf.exchange=false
# Port number currently must be exactly 3 more than server port (ignored if cudf.exchange is false)
cudf.exchange.server.port=8083
# overwritten when cudf.exchange is enabled (ignored otherwise)
cudf.exchange.server.port=0000
cudf.memory_resource=async

async-data-cache-enabled=false
17 changes: 2 additions & 15 deletions presto/scripts/common_functions.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
#!/bin/bash

# Copyright (c) 2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0

function wait_for_worker_node_registration() {
trap "rm -rf node_response.json" RETURN

echo "Waiting for a worker node to be registered..."
HOSTNAME=${1:-localhost}
PORT=${2:-8080}
COORDINATOR_URL=http://${HOSTNAME}:${PORT}
echo "Coordinator URL: $COORDINATOR_URL"
local -r MAX_RETRIES=12
Expand Down
22 changes: 15 additions & 7 deletions presto/scripts/generate_presto_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,23 @@ if [ ! -x "${SCRIPT_DIR}/../pbench/pbench" ]; then
echo_error "ERROR: generate_presto_config.sh script cannot find pbench at ${SCRIPT_DIR}/../pbench/pbench"
fi

# This function duplicates the worker configs when we are running multiple workers.
# It also adds certain config options to the workers if those options apply only to multi-worker environments.
function duplicate_worker_configs() {
local worker_id=$1
echo "Duplicating worker configs for GPU ID $worker_id"
local worker_config="${CONFIG_DIR}/etc_worker_${worker_id}"
local worker_native_config="${worker_config}/config_native.properties"
local coord_config="${CONFIG_DIR}/etc_coordinator"
local worker_native_config="${worker_config}/config_native.properties"
local coord_native_config="${coord_config}/config_native.properties"
# Need to stagger the port numbers because ucx exchange currently expects to be exactly
# 3 higher than the http port.
local http_port="10$(printf "%02d\n" "$worker_id")0"
local exch_port="10$(printf "%02d\n" "$worker_id")3"
rm -rf ${worker_config}
cp -r ${CONFIG_DIR}/etc_worker ${worker_config}

# Single node execution needs to be disabled if we are running multiple workers.
# Some configs should only be applied if we are in a multi-worker environment.
if [[ ${NUM_WORKERS} -gt 1 ]]; then
sed -i "s+single-node-execution-enabled.*+single-node-execution-enabled=false+g" ${coord_native_config}
sed -i "s+single-node-execution-enabled.*+single-node-execution-enabled=false+g" ${worker_native_config}
Expand Down Expand Up @@ -72,7 +76,7 @@ RAM_GB=$(lsmem -b | grep "Total online memory" | awk '{print int($4 / (1024*1024
if [[ -z ${VARIANT_TYPE} || ! ${VARIANT_TYPE} =~ ^(cpu|gpu|java)$ ]]; then
echo_error "ERROR: VARIANT_TYPE must be set to a valid variant type (cpu, gpu, java)."
fi
if [[ -z ${VCPU_PER_WORKER} ]]; then
if [[ -z ${VCPU_PER_WORKER:-} ]]; then
if [[ "${VARIANT_TYPE}" == "gpu" ]]; then
VCPU_PER_WORKER=2
else
Expand Down Expand Up @@ -122,6 +126,7 @@ EOF
fi

COORD_CONFIG="${CONFIG_DIR}/etc_coordinator/config_native.properties"
WORKER_CONFIG="${CONFIG_DIR}/etc_worker/config_native.properties"
# now perform other variant-specific modifications to the generated configs
if [[ "${VARIANT_TYPE}" == "gpu" ]]; then
# for GPU variant, uncomment these optimizer settings
Expand Down Expand Up @@ -158,10 +163,13 @@ fi

# We want to propagate any changes from the original worker config to the new worker configs even if
# we did not re-generate the configs.
if [[ -n "$NUM_WORKERS" && -n "$GPU_IDS" && "$VARIANT_TYPE" == "gpu" ]]; then
# Count the number of GPU IDs provided
IFS=',' read -ra GPU_ID_ARRAY <<< "$GPU_IDS"
for i in "${GPU_ID_ARRAY[@]}"; do
if [[ -n "$NUM_WORKERS" && "$VARIANT_TYPE" == "gpu" ]]; then
if [[ -n ${GPU_IDS:-} ]]; then
WORKER_IDS=($(echo "$GPU_IDS" | tr ',' ' '))
else
WORKER_IDS=($(seq 0 $((NUM_WORKERS - 1))))
fi
for i in "${WORKER_IDS[@]}"; do
duplicate_worker_configs $i
done
fi
15 changes: 14 additions & 1 deletion presto/scripts/run_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ OPTIONS:
stored inside a directory under the --output-dir path with a name matching the tag name.
Tags must contain only alphanumeric and underscore characters.
-p, --profile Enable profiling of benchmark queries.
--profile-script-path Path to profiler functions script (default: ./profiler_functions.sh).
--skip-drop-cache Skip dropping system caches before each benchmark query (dropped by default).
-m, --metrics Collect detailed metrics from Presto REST API after each query.
Metrics are stored in query-specific directories.
Expand Down Expand Up @@ -147,6 +148,15 @@ parse_args() {
PROFILE=true
shift
;;
--profile-script-path)
if [[ -n $2 ]]; then
PROFILE_SCRIPT_PATH=$2
shift 2
else
echo "Error: --profile-script-path requires a value"
exit 1
fi
;;
--skip-drop-cache)
SKIP_DROP_CACHE=true
shift
Expand Down Expand Up @@ -218,7 +228,10 @@ if [[ -n ${TAG} ]]; then
fi

if [[ "${PROFILE}" == "true" ]]; then
PYTEST_ARGS+=("--profile --profile-script-path $(readlink -f ./profiler_functions.sh)")
if [[ -z "${PROFILE_SCRIPT_PATH:-}" ]]; then
PROFILE_SCRIPT_PATH="$(readlink -f ./profiler_functions.sh)"
fi
PYTEST_ARGS+=("--profile --profile-script-path ${PROFILE_SCRIPT_PATH}")
fi

if [[ "${METRICS}" == "true" ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ OPTIONS:
-s, --schema-name Name of the schema that will contain the created tables.
-d, --data-dir-name Name of the directory inside the PRESTO_DATA_DIR path for the benchmark data.
--skip-analyze-tables Skip analyzing tables after creating them. Default is to analyze tables.
--no-docker Skip the setup/teardown steps that require docker.
$SCRIPT_EXTRA_OPTIONS_DESCRIPTION

EXAMPLES:
Expand All @@ -49,6 +50,7 @@ fi
# Compute the directory where this script resides (if not already set by caller)
SCRIPT_DIR="${SCRIPT_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}"

NO_DOCKER=false
SKIP_ANALYZE_TABLES=false
parse_args() {
while [[ $# -gt 0 ]]; do
Expand Down Expand Up @@ -88,6 +90,10 @@ parse_args() {
SKIP_ANALYZE_TABLES=true
shift
;;
--no-docker)
NO_DOCKER=true
shift
;;
*)
SCRIPT_EXTRA_OPTIONS_UNKNOWN_ARG=true
if [[ -n $SCRIPT_EXTRA_OPTIONS_PARSER ]]; then
Expand Down
15 changes: 10 additions & 5 deletions presto/scripts/setup_benchmark_tables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ function cleanup() {

trap cleanup EXIT

"${SCRIPT_DIR}/start_native_cpu_presto.sh"

source "${SCRIPT_DIR}/common_functions.sh"
# These scripts are used in some non-docker environments, so provide the option to skip
# the docker setup/teardown.
if [[ -z "$NO_DOCKER" ]]; then
"${SCRIPT_DIR}/start_native_cpu_presto.sh"
source "${SCRIPT_DIR}/common_functions.sh"
wait_for_worker_node_registration
fi

wait_for_worker_node_registration

"${SCRIPT_DIR}/../../scripts/run_py_script.sh" -p $SCHEMA_GEN_SCRIPT_PATH \
--benchmark-type $BENCHMARK_TYPE \
Expand All @@ -53,4 +56,6 @@ if [[ "$SKIP_ANALYZE_TABLES" == "false" ]]; then
"${SCRIPT_DIR}/analyze_tables.sh" -s $SCHEMA_NAME
fi

"${SCRIPT_DIR}/stop_presto.sh"
if [[ -z "$NO_DOCKER" ]]; then
"${SCRIPT_DIR}/stop_presto.sh"
fi
13 changes: 6 additions & 7 deletions presto/scripts/start_presto_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ fi
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# Get the root of the git repository
REPO_ROOT="$(git -C "${SCRIPT_DIR}" rev-parse --show-toplevel)"
if command -v git &> /dev/null; then
REPO_ROOT="$(git -C "${SCRIPT_DIR}" rev-parse --show-toplevel)"
else
REPO_ROOT="$SCRIPT_DIR/../.."
fi


# Validate sibling repos
if [[ "$VARIANT_TYPE" == "java" ]]; then
Expand Down Expand Up @@ -88,12 +93,6 @@ else
echo "Internal error: unexpected VARIANT_TYPE value: $VARIANT_TYPE"
fi

# Default GPU_IDS if NUM_WORKERS is set but GPU_IDS is not
if [[ -n $NUM_WORKERS && -z $GPU_IDS ]]; then
# Generate default GPU IDs: 0,1,2,...,N-1
export GPU_IDS=$(seq -s, 0 $((NUM_WORKERS - 1)))
fi

"${SCRIPT_DIR}/stop_presto.sh"

"${SCRIPT_DIR}/generate_presto_config.sh"
Expand Down
Loading
Loading