Files
foxhunt/scripts/apply_batch_size_fix.sh
jgrusewski 8d89fe80ff chore: Second cleanup wave - organize root directory
- Archive: 85 agent .txt files → docs/archive/agents/legacy_txt/
- Scripts: Move 110 shell scripts → scripts/ (keep deploy.sh in root)
- Models: Move 18 .safetensors → ml/models/checkpoints/training_artifacts/
- Delete: 34 directories (~33GB freed) - target/, coverage_*, test artifacts
- Build: Clean 14 build artifacts (.rlib, .o, .pid, binaries)
- Tests: Move 14 .rs files → tests/standalone/
- SQL: Move 5 files → sql/ (keep init-db*.sql for Docker)
- Wave 153: Archive to docs/archive/historical/wave153/
- Docs: Archive 9 markdown files to wave_d/reports/ and historical/

Total impact: ~34GB freed (both waves), root directory cleaned from 583 to ~40 essential files
Directory count reduced from 65 to 31 (52% reduction)
All historical data preserved in organized archive structure
2025-10-30 01:26:02 +01:00

72 lines
3.2 KiB
Bash
Executable File

#!/bin/bash
# Apply batch_size_max 96→180 fix
set -e
echo "╔══════════════════════════════════════════════════════════════════════════════╗"
echo "║ Applying batch_size_max Fix (96 → 180) ║"
echo "╚══════════════════════════════════════════════════════════════════════════════╝"
echo ""
# Backup files
echo "1. Creating backups..."
cp ml/examples/hyperopt_mamba2_demo.rs ml/examples/hyperopt_mamba2_demo.rs.backup
cp ml/src/hyperopt/adapters/mamba2.rs ml/src/hyperopt/adapters/mamba2.rs.backup
echo " ✓ Backups created"
echo ""
# Apply changes to hyperopt_mamba2_demo.rs
echo "2. Updating hyperopt_mamba2_demo.rs..."
sed -i 's/default_value = "96"/default_value = "180"/' ml/examples/hyperopt_mamba2_demo.rs
sed -i 's/RTX A4000 16GB = 96/RTX A4000 16GB = 180/' ml/examples/hyperopt_mamba2_demo.rs
echo " ✓ Updated default to 180"
echo ""
# Apply changes to mamba2.rs
echo "3. Updating mamba2.rs adapter..."
sed -i 's/(4.0, 256.0),.*batch_size/(4.0, 180.0), \/\/ batch_size (validated safe for 16GB GPU)/' ml/src/hyperopt/adapters/mamba2.rs
echo " ✓ Updated bounds to (4.0, 180.0)"
echo ""
# Show changes
echo "4. Changes summary:"
echo ""
echo " hyperopt_mamba2_demo.rs:"
grep -A1 "batch_size_max" ml/examples/hyperopt_mamba2_demo.rs | grep "default_value"
echo ""
echo " mamba2.rs:"
grep "4.0, 180.0" ml/src/hyperopt/adapters/mamba2.rs || echo " (bounds updated)"
echo ""
# Verify
echo "5. Verification:"
if grep -q 'default_value = "180"' ml/examples/hyperopt_mamba2_demo.rs; then
echo " ✓ hyperopt_mamba2_demo.rs: UPDATED"
else
echo " ✗ hyperopt_mamba2_demo.rs: FAILED"
exit 1
fi
if grep -q '(4.0, 180.0)' ml/src/hyperopt/adapters/mamba2.rs; then
echo " ✓ mamba2.rs: UPDATED"
else
echo " ✗ mamba2.rs: FAILED"
exit 1
fi
echo ""
echo "╔══════════════════════════════════════════════════════════════════════════════╗"
echo "║ ✅ FIX APPLIED ║"
echo "╚══════════════════════════════════════════════════════════════════════════════╝"
echo ""
echo "Next steps:"
echo " 1. Rebuild: cargo build -p ml --release --features cuda"
echo " 2. Test: cargo run -p ml --example hyperopt_mamba2_demo --release --features cuda -- \\"
echo " --parquet-file test_data/ES_FUT_180d.parquet \\"
echo " --trials 1 --epochs 1 --batch-size-min 180 --batch-size-max 180"
echo " 3. Monitor: nvidia-smi --query-gpu=memory.used --format=csv -l 2"
echo ""
echo "Expected VRAM: ~7.7GB (48% of 16GB)"
echo "If stable, proceed with full hyperopt run."
echo ""