| # Train a single CTA ablation variant. | |
| # | |
| # Usage: | |
| # bash scripts/train_cta_ablation.sh <VARIANT> [extra hydra overrides...] | |
| # | |
| # Examples: | |
| # bash scripts/train_cta_ablation.sh A1_full | |
| # bash scripts/train_cta_ablation.sh A2_no_asym | |
| # bash scripts/train_cta_ablation.sh B2_all_samples | |
| # bash scripts/train_cta_ablation.sh D4_mlp_predictor | |
| # | |
| # The output directory will be: | |
| # outputs/cta_ablation_<VARIANT>_<timestamp>/ | |
| set -euo pipefail | |
| cd "$(dirname "$0")/.." | |
| # load .env if present | |
| [ -f .env ] && set -a && . ./.env && set +a | |
| # NCCL optimization settings to prevent timeout errors | |
| export NCCL_TIMEOUT=3600 # 1 hour timeout (default 30min) | |
| export NCCL_ASYNC_ERROR_HANDLING=1 # Enable async error handling | |
| export NCCL_MAX_NCHANNELS=4 # Reduce number of channels for better stability | |
| export NCCL_MIN_NCHANNELS=4 # Set minimum channels | |
| export NCCL_BUFFSIZE=4194304 # 4MB buffer size | |
| # Additional optimization settings | |
| export CUDA_LAUNCH_BLOCKING=0 # Non-blocking CUDA operations | |
| export NCCL_P2P_DISABLE=0 # Enable peer-to-peer communication | |
| VARIANT="${1:-A1_full}" | |
| shift || true | |
| echo "[ablation] running variant: ${VARIANT}" | |
| echo "[ablation] NCCL settings: TIMEOUT=${NCCL_TIMEOUT}s, ASYNC_ERROR_HANDLING=${NCCL_ASYNC_ERROR_HANDLING}" | |
| python3 src/train.py \ | |
| method=cta_ablation \ | |
| data=fairtalking \ | |
| trainer=ddp \ | |
| backbone=timesformer \ | |
| method.ablation_variant="${VARIANT}" \ | |
| experiment_name="cta_ablation_${VARIANT}" \ | |
| "$@" | |