flow_grpo_cxr / scripts /single_node /grpo_4gpu_cm.sh
zhui711's picture
Upload folder using huggingface_hub
535fb25 verified
Raw
History Blame Contribute Delete
1.52 kB
# 4 GPU radiomics OmniGen LoRA training with CM/GLCM reward features.
# Override config/port if needed:
# CONFIG_ENTRY=config/grpo.py:general_radiomics_omnigen_4gpu_cm_kl MAIN_PROCESS_PORT=29502 sh scripts/single_node/grpo_4gpu_cm.sh
CURRENT_SERVER_IP="169.254.3.1"
if ip -o -4 addr show 2>/dev/null | awk '{split($4, address, "/"); print address[1]}' | grep -qx "$CURRENT_SERVER_IP"; then
PROJECT_ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)
export PYTHONPATH=$PROJECT_ROOT:$PYTHONPATH
export OMNIGEN_CODE_ROOT=/home/wenting/zr/gen_code
export PYTORCH_CUDA_ALLOC_CONF=${PYTORCH_CUDA_ALLOC_CONF:-expandable_segments:True}
else
export PYTHONPATH=/NAS_REMOTE/vicky/wt/codes/cxr_syn:/NAS_REMOTE/vicky/wt/codes/cxr_syn/flow_grpo:$PYTHONPATH
export OMNIGEN_CODE_ROOT=/NAS_REMOTE/vicky/wt/codes/cxr_syn/gen_code
fi
export PYTHONPATH=$OMNIGEN_CODE_ROOT:$PYTHONPATH
export HF_TOKEN="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"
export HF_HOME="/NAS_REMOTE/vicky/wt/huggingface/models"
export HF_HUB_CACHE="/tmp/flow_grpo_hf_cache/hub"
export WANDB_API_KEY="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"
export CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:-0,1,2,3}
python3 -m accelerate.commands.launch \
--config_file scripts/accelerate_configs/multi_gpu.yaml \
--num_processes=${NUM_PROCESSES:-4} \
--main_process_port ${MAIN_PROCESS_PORT:-29501} \
scripts/train_omnigen.py \
--config ${CONFIG_ENTRY:-config/grpo.py:general_radiomics_omnigen_4gpu_cm_kl}