fairtalking-second-work / scripts /fix_disk_space.sh
huahua123313's picture
Add files using upload-large-folder tool
7c2871f verified
Raw
History Blame Contribute Delete
3.29 kB
#!/usr/bin/env bash
# Disk space fix script for fairtalking-second-work
# Provides multiple solutions for disk quota exceeded error
set -euo pipefail
echo "=== Disk Space Fix Script ==="
echo "Current disk usage on /apdcephfs_gy4/share_303628665: 100%"
echo "Available space on /apdcephfs_gy8/share_303628665: 7.7T"
echo ""
# Solution 1: Create symbolic link to gy8 (recommended)
echo "Solution 1: Create symbolic link to available space"
echo "---------------------------------------------------"
if [ ! -d "/apdcephfs_gy8/share_303628665/joywu/research/fairtalking-second-work" ]; then
echo "Creating directory on gy8..."
mkdir -p /apdcephfs_gy8/share_303628665/joywu/research/fairtalking-second-work
fi
# Check if symbolic link already exists
if [ ! -L "/apdcephfs_gy4/share_303628665/joywu/research/fairtalking-second-work/outputs" ]; then
echo "Creating symbolic link for outputs directory..."
# Move existing outputs to gy8 if they exist
if [ -d "/apdcephfs_gy4/share_303628665/joywu/research/fairtalking-second-work/outputs" ]; then
mv /apdcephfs_gy4/share_303628665/joywu/research/fairtalking-second-work/outputs /apdcephfs_gy8/share_303628665/joywu/research/fairtalking-second-work/
fi
# Create symbolic link
ln -sf /apdcephfs_gy8/share_303628665/joywu/research/fairtalking-second-work/outputs /apdcephfs_gy4/share_303628665/joywu/research/fairtalking-second-work/outputs
echo "✓ Outputs directory linked to gy8"
else
echo "✓ Outputs symbolic link already exists"
fi
# Solution 2: Clean up temporary files
echo ""
echo "Solution 2: Clean up temporary files"
echo "-----------------------------------"
# Clean Hydra outputs (takes a lot of space)
if [ -d "outputs" ]; then
echo "Cleaning old Hydra outputs..."
find outputs -name "*.yaml" -type f -delete 2>/dev/null || true
find outputs -name "hydra" -type d -exec rm -rf {} + 2>/dev/null || true
echo "✓ Temporary files cleaned"
fi
# Clean Python cache
if [ -d "__pycache__" ]; then
echo "Cleaning Python cache..."
find . -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true
echo "✓ Python cache cleaned"
fi
# Solution 3: Alternative test location
echo ""
echo "Solution 3: Run test in alternative location"
echo "-------------------------------------------"
echo "You can also run the test directly from gy8:"
echo "cd /apdcephfs_gy8/share_303628665/joywu/research/fairtalking-second-work"
echo "bash scripts/test_cta_mmdf.sh"
# Solution 4: Quick test with minimal output
echo ""
echo "Solution 4: Quick test with minimal Hydra output"
echo "-----------------------------------------------"
echo "Run test with environment variable to disable Hydra config saving:"
echo "HYDRA_FULL_ERROR=1 python3 src/train.py \\"
echo " method=cta \\"
echo " data=fairtalking_mmdf \\"
echo " trainer=ddp \\"
echo " backbone=timesformer \\"
echo " +test_only=true \\"
echo " +test_ckpt=outputs/cta/checkpoints/last.ckpt \\"
echo " hydra.output_subdir=null \\"
echo " hydra/job_logging=disabled"
echo ""
echo "=== Summary ==="
echo "✓ Symbolic link created for outputs directory"
echo "✓ Temporary files cleaned"
echo "✓ Multiple solutions provided"
echo ""
echo "Now you can run: bash scripts/test_cta_mmdf.sh"