Download other_transfer/scripts/train_sft_2gpu.sh from hk239/PhysVLM: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/datasets/hk239/PhysVLM/resolve/main/other_transfer/scripts/train_sft_2gpu.sh
- Command line
-
hf download hf://datasets/hk239/PhysVLM/other_transfer/scripts/train_sft_2gpu.sh
-
curl -L -o train_sft_2gpu.sh https://huggingface.co/datasets/hk239/PhysVLM/resolve/main/other_transfer/scripts/train_sft_2gpu.sh
1.06 kB
| # Interactive 2xH100 LoRA SFT. Run this on the compute node, not the login node. | |
| # Effective batch = 1 * 16 * 2 = 32 | |
| set -euo pipefail | |
| ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | |
| cd "$ROOT" | |
| export PYTHONPATH="$ROOT/src${PYTHONPATH:+:$PYTHONPATH}" | |
| export HF_HOME="${HF_HOME:-$ROOT/.cache/huggingface}" | |
| export TOKENIZERS_PARALLELISM=false | |
| if [[ -n "${PHYSICS_SFT_CONDA_ENV:-}" ]]; then | |
| # shellcheck disable=SC1091 | |
| source ~/.bashrc | |
| conda activate "$PHYSICS_SFT_CONDA_ENV" | |
| elif [[ -x "$ROOT/.venv/bin/python" ]]; then | |
| # shellcheck disable=SC1091 | |
| source "$ROOT/.venv/bin/activate" | |
| fi | |
| PYTHON="$(command -v python)" | |
| echo "cwd=$(pwd) python=$PYTHON CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:-all}" | |
| nvidia-smi -L || true | |
| # DDP, not ZeRO-3: LoRA 7B fits on one H100; ZeRO-3 made the first step take many minutes. | |
| "$PYTHON" -m accelerate.commands.launch --num_processes 2 \ | |
| --config_file configs/accelerate_ddp_2gpu.yaml \ | |
| src/physics_model/sft.py --config configs/sft_qwen25vl_7b_2gpu.yaml \ | |
| --skip-length-scan | |