Download code/1028_run/tasks/yp_task.sh from yqi19/dagger: direct link, hf CLI and curl.
- Browser
- Download file 4.36 kB
-
https://huggingface.co/datasets/yqi19/dagger/resolve/main/code/1028_run/tasks/yp_task.sh
- Command line
-
hf download hf://datasets/yqi19/dagger/code/1028_run/tasks/yp_task.sh
-
curl -L -o yp_task.sh https://huggingface.co/datasets/yqi19/dagger/resolve/main/code/1028_run/tasks/yp_task.sh
4.36 kB
| # yp_task.sh (1028_run) — 4x parallel collection (physical GPU 0/1/2/3) + AMP training | |
| # Usage: TASK=battery bash yp_task.sh | |
| set -uo pipefail | |
| ROOT=/lustre/fsw/portfolios/nvr/users/jtremblay/yu | |
| RUN=$ROOT/1028_run; TASKS=$ROOT/1027_sim_tasks | |
| V5CODE=$TASKS/share_v5_sim2real_20260929/code | |
| CONDA=$ROOT/miniconda3; SPY=$CONDA/envs/simfoundry/bin/python; UPY=$CONDA/envs/ur5dp/bin/python | |
| HOME_FAKE=$RUN/home_fake | |
| YDIR=$TASKS/yu_parts_tasks | |
| TASK=${TASK:-battery} | |
| NAME=${TASK}_v1 | |
| log() { echo "== $(date '+%F %T') [$TASK] $*"; } | |
| mkdir -p $HOME_FAKE/ur5_sim2real_v5 $RUN/logs $V5CODE/sim_data $V5CODE/train_runs | |
| ln -sfn $CONDA $HOME_FAKE/miniconda3 | |
| ln -sfn $TASKS/share_v5_sim2real_20260929 $HOME_FAKE/ur5_sim2real_v5/share_v5_sim2real_20260929 | |
| ln -sfn $YDIR $HOME_FAKE/ur5_sim2real_v5/yu_parts_tasks | |
| export HOME=$HOME_FAKE | |
| source $CONDA/etc/profile.d/conda.sh | |
| export TORCHINDUCTOR_COMPILE_THREADS=1 OMNIGIBSON_HEADLESS=1 OMNI_KIT_ACCEPT_EULA=YES PYTHONUNBUFFERED=1 | |
| export OMNIGIBSON_RENDER_VIEWER_CAMERA=0 TORCH_COMPILE_DISABLE=1 TORCHDYNAMO_DISABLE=1 | |
| export OMNIGIBSON_DATA_PATH=/lustre/fsw/portfolios/nvr/users/jtremblay/yu/SimFoundry/deps/BEHAVIOR-1K/datasets | |
| DS_FSW=/lustre/fsw/portfolios/nvr/users/jtremblay/yu/SimFoundry/deps/BEHAVIOR-1K/datasets | |
| mkdir -p $DS_FSW/yu-assets/objects | |
| for c in $TASKS/yu_parts_tasks/object_assets/objects/*; do | |
| nm=$(basename $c); [ ! -e "$DS_FSW/yu-assets/objects/$nm" ] && ln -sfn "$c" "$DS_FSW/yu-assets/objects/$nm" || true | |
| done | |
| # 4 shard dirs — use physical GPU indices via OMNIGIBSON_GPU_ID | |
| # DO NOT set CUDA_VISIBLE_DEVICES: Isaac Sim uses absolute GPU index for Vulkan+PhysX | |
| DATA_DIR=$YDIR/data/$TASK/$NAME | |
| DATA_A=${DATA_DIR}_1028a; DATA_B=${DATA_DIR}_1028b | |
| DATA_C=${DATA_DIR}_1028c; DATA_D=${DATA_DIR}_1028d | |
| mkdir -p $DATA_A $DATA_B $DATA_C $DATA_D | |
| log "Collecting $TASK: 4x parallel (physical GPU 0/1/2/3), 15 demos each -> 50 total" | |
| OMNIGIBSON_GPU_ID=0 \ | |
| $SPY -u $YDIR/scripts/yp_collect.py \ | |
| --task $TASK --out $DATA_A --seeds 200-299 --max-kept 15 --dart --start-offset \ | |
| 2>&1 | tee $RUN/logs/${NAME}_1028a.log & | |
| PID_A=$! | |
| sleep 60 | |
| OMNIGIBSON_GPU_ID=1 \ | |
| $SPY -u $YDIR/scripts/yp_collect.py \ | |
| --task $TASK --out $DATA_B --seeds 300-399 --max-kept 15 --dart --start-offset \ | |
| 2>&1 | tee $RUN/logs/${NAME}_1028b.log & | |
| PID_B=$! | |
| sleep 60 | |
| OMNIGIBSON_GPU_ID=2 \ | |
| $SPY -u $YDIR/scripts/yp_collect.py \ | |
| --task $TASK --out $DATA_C --seeds 400-499 --max-kept 15 --dart --start-offset \ | |
| 2>&1 | tee $RUN/logs/${NAME}_1028c.log & | |
| PID_C=$! | |
| sleep 60 | |
| OMNIGIBSON_GPU_ID=3 \ | |
| $SPY -u $YDIR/scripts/yp_collect.py \ | |
| --task $TASK --out $DATA_D --seeds 500-599 --max-kept 20 --dart --start-offset \ | |
| 2>&1 | tee $RUN/logs/${NAME}_1028d.log & | |
| PID_D=$! | |
| wait $PID_A; log "GPU0 done" | |
| wait $PID_B; log "GPU1 done" | |
| wait $PID_C; log "GPU2 done" | |
| wait $PID_D; log "GPU3 done" | |
| FINAL=$RUN/data/${NAME}_1028 | |
| python3 $RUN/merge_shards.py $DATA_A $DATA_B $DATA_C $DATA_D $FINAL 50 | |
| kept=$($UPY -c "import json; d=json.load(open('$FINAL/collect_meta.json')); print(d['n_kept'])" 2>/dev/null || echo 0) | |
| log "Kept: $kept" | |
| [ "$kept" -lt 40 ] && { log "ERROR: only $kept demos"; exit 1; } | |
| ln -sfn $FINAL $V5CODE/sim_data/${NAME}_1028 | |
| log "Packing zarr" | |
| cd $V5CODE && $UPY ur5_import/scripts/pack_zarr.py --dir sim_data/${NAME}_1028 2>&1 | tee $RUN/logs/${NAME}_1028_train.log | |
| log "Training DP ($kept demos) with AMP + batch_size=256 + num_workers=16" | |
| cd $V5CODE/ur5_lab_code && export PYTHONPATH=src:. | |
| $UPY train.py --config-name=train_baseline_diffusion_unet task=sim_baseline \ | |
| task_name=${NAME}_1028 dataset_path=$FINAL n_demo=$kept \ | |
| training.device=cuda:0 training.seed=0 training.num_epochs=130 training.checkpoint_every=129 \ | |
| checkpoint.topk.k=0 training.resume=True checkpoint.save_last_ckpt=True \ | |
| +training.use_amp=True \ | |
| dataloader.batch_size=256 dataloader.num_workers=16 \ | |
| logging.mode=offline \ | |
| "policy._target_=algorithms.policy.diffusion_unet_baseline_aug_policy.DiffusionUnetBaselineAugPolicy" \ | |
| +policy.cam1_dropout=0.1 +policy.cam1_aug_p=0.5 +policy.cam1_erase_p=0.3 +policy.cam0_aug_p=0.3 \ | |
| "hydra.run.dir=$V5CODE/train_runs/${NAME}_1028_aug_s0" \ | |
| 2>&1 | tee -a $RUN/logs/${NAME}_1028_train.log | |
| rc=$?; log "Train exit $rc" | |
| [ $rc -eq 0 ] || { log "TRAIN FAILED"; exit 1; } | |
| log "DONE: $V5CODE/train_runs/${NAME}_1028_aug_s0/checkpoints/" | |