Skip to content

Commit

Permalink
update running scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sanaAyrml committed Jan 6, 2025
1 parent 56193f8 commit c806b91
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 31 deletions.
8 changes: 2 additions & 6 deletions research/rxrx1/fedavg/run_fold_experiment.slrm
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
# path_to_folder_for_dataset/ \
# path_to_desired_venv/ \
# client_side_learning_rate_value \
# server_address\
# client_beta
# server_address
#
# Example:
# sbatch research/rxrx1/fedavg/run_fold_experiment.slrm \
Expand All @@ -32,8 +31,7 @@
# /datasets/rxrx1 \
# /h/demerson/vector_repositories/fl4health_env/ \
# 0.0001 \
# 0.0.0.0:8080\
# 0.1
# 0.0.0.0:8080
#
# Notes:
# 1) The sbatch command above should be run from the top level directory of the repository.
Expand Down Expand Up @@ -66,7 +64,6 @@ DATASET_DIR=$3
VENV_PATH=$4
CLIENT_LR=$5
SERVER_ADDRESS=$6
CLIENT_BETA=$7

# Create the artifact directory
mkdir "${ARTIFACT_DIR}"
Expand Down Expand Up @@ -149,7 +146,6 @@ do
--learning_rate ${CLIENT_LR} \
--server_address ${SERVER_ADDRESS} \
--seed ${SEED} \
--beta ${CLIENT_BETA} \
--use_partitioned_data \
> ${CLIENT_LOG_PATH} 2>&1 &
done
Expand Down
44 changes: 19 additions & 25 deletions research/rxrx1/fedavg/run_hp_sweep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ DATASET_DIR=$3
VENV_PATH=$4

LR_VALUES=( 0.00001 0.0001 0.001 0.01 0.1 )
BETA_VALUES=( 0.1 0.5 5.0 )

SERVER_PORT=8100

Expand All @@ -35,29 +34,24 @@ SWEEP_DIRECTORY="${ARTIFACT_DIR}hp_sweep_results"
echo "Creating sweep folder at ${SWEEP_DIRECTORY}"
mkdir ${SWEEP_DIRECTORY}

for BETA_VALUE in "${BETA_VALUES[@]}"; do
echo "Creating folder for beta ${BETA_VALUE}"
mkdir "${SWEEP_DIRECTORY}/beta_${BETA_VALUE}"
for LR_VALUE in "${LR_VALUES[@]}";
do
EXPERIMENT_NAME="lr_${LR_VALUE}_beta_${BETA_VALUE}"
echo "Beginning Experiment ${EXPERIMENT_NAME}"
EXPERIMENT_DIRECTORY="${SWEEP_DIRECTORY}/beta_${BETA_VALUE}/${EXPERIMENT_NAME}/"
echo "Creating experiment folder ${EXPERIMENT_DIRECTORY}"
mkdir "${EXPERIMENT_DIRECTORY}"
SERVER_ADDRESS="0.0.0.0:${SERVER_PORT}"
echo "Server Address: ${SERVER_ADDRESS}"
SBATCH_COMMAND="research/rxrx1/fedavg/run_fold_experiment.slrm \
${SERVER_CONFIG_PATH} \
${EXPERIMENT_DIRECTORY} \
${DATASET_DIR} \
${VENV_PATH} \
${LR_VALUE} \
${SERVER_ADDRESS}\
${BETA_VALUE}"
echo "Running sbatch command ${SBATCH_COMMAND}"
sbatch ${SBATCH_COMMAND}
((SERVER_PORT=SERVER_PORT+1))
done
for LR_VALUE in "${LR_VALUES[@]}";
do
EXPERIMENT_NAME="lr_${LR_VALUE}"
echo "Beginning Experiment ${EXPERIMENT_NAME}"
EXPERIMENT_DIRECTORY="${SWEEP_DIRECTORY}/${EXPERIMENT_NAME}/"
echo "Creating experiment folder ${EXPERIMENT_DIRECTORY}"
mkdir "${EXPERIMENT_DIRECTORY}"
SERVER_ADDRESS="0.0.0.0:${SERVER_PORT}"
echo "Server Address: ${SERVER_ADDRESS}"
SBATCH_COMMAND="research/rxrx1/fedavg/run_fold_experiment.slrm \
${SERVER_CONFIG_PATH} \
${EXPERIMENT_DIRECTORY} \
${DATASET_DIR} \
${VENV_PATH} \
${LR_VALUE} \
${SERVER_ADDRESS}"
echo "Running sbatch command ${SBATCH_COMMAND}"
sbatch ${SBATCH_COMMAND}
((SERVER_PORT=SERVER_PORT+1))
done
echo Experiments Launched

0 comments on commit c806b91

Please sign in to comment.