From 9be16517d800974b5321afa568e5eec1f4ff2168 Mon Sep 17 00:00:00 2001 From: bmaltais Date: Sun, 25 Jun 2023 11:03:32 -0400 Subject: [PATCH] Update runpod setup --- config_files/accelerate/runpod.yaml | 22 ++++++++++++++++++++++ setup-runpod.sh | 14 ++++++++------ 2 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 config_files/accelerate/runpod.yaml diff --git a/config_files/accelerate/runpod.yaml b/config_files/accelerate/runpod.yaml new file mode 100644 index 0000000..1198fe6 --- /dev/null +++ b/config_files/accelerate/runpod.yaml @@ -0,0 +1,22 @@ +command_file: null +commands: null +compute_environment: LOCAL_MACHINE +deepspeed_config: {} +distributed_type: 'NO' +downcast_bf16: 'no' +dynamo_backend: 'NO' +fsdp_config: {} +gpu_ids: all +machine_rank: 0 +main_process_ip: null +main_process_port: null +main_training_function: main +megatron_lm_config: {} +mixed_precision: 'no' +num_machines: 1 +num_processes: 1 +rdzv_backend: static +same_network: true +tpu_name: null +tpu_zone: null +use_cpu: false \ No newline at end of file diff --git a/setup-runpod.sh b/setup-runpod.sh index 6bea4c9..498e13e 100644 --- a/setup-runpod.sh +++ b/setup-runpod.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash # This gets the directory the script is run from so pathing can work relative to the script where needed. -SCRIPT_DIR="$(cd -- $(dirname -- "$0") && pwd)" +SCRIPT_DIR="$(cd -- "$(dirname -- "$0")" && pwd)" -# Install tk -echo "Install tk and python3.10-venv..." +# Install tk and python3.10-venv +echo "Installing tk and python3.10-venv..." apt update -y && apt install -y python3-tk python3.10-venv # Check if the venv folder doesn't exist @@ -14,12 +14,14 @@ if [ ! -d "$SCRIPT_DIR/venv" ]; then fi # Activate the virtual environment -echo "Activate venv..." +echo "Activating venv..." source "$SCRIPT_DIR/venv/bin/activate" || exit 1 # Run setup_linux.py script with platform requirements +echo "Running setup_linux.py..." python "$SCRIPT_DIR/setup/setup_linux.py" --platform-requirements-file=requirements_runpod.txt # Configure accelerate -echo "Accelerate config..." -accelerate config +echo "Configuring accelerate..." +cp "$SCRIPT_DIR/config_files/accelerate/runpod.yaml" "/root/.cache/huggingface/accelerate/default_config.yaml" +echo "To manually configure accelerate run: $SCRIPT_DIR/venv/bin/activate"