Files
foxhunt/deploy_mamba2_hyperopt.sh
jgrusewski 6da9d262db feat(ml): MAMBA-2 P0 fixes + hyperparameter optimization (13 params)
CRITICAL P0 FIXES (Validated - Loss 0.87 → 0.07):
- Add sigmoid activation to inference and training (ml/src/mamba/mod.rs:798, 1538)
- Fix config.total_decay_steps (was hardcoded 10000) (ml/src/mamba/mod.rs:2271)
- Update d_state: 16→64, 32→64 (Mamba-2 spec) (ml/src/mamba/mod.rs:178, 730)

HYPERPARAMETER OPTIMIZATION:
- Implement 13-parameter Bayesian optimization with argmin
- Add async data loading with 3-batch prefetch (+20-30% speedup)
- Create hyperopt adapter: ml/src/hyperopt/adapters/mamba2.rs
- Add example: ml/examples/hyperopt_mamba2_demo.rs

VALIDATION:
- Local test: Loss 0.07 vs 0.87 (12× improvement)
- Val loss: 0.04-0.14 vs 1.2 (27× improvement)
- Accuracy: 12-30% vs 1-5% (3-6× improvement)
- All binaries rebuilt and uploaded to Runpod S3

DEPLOYMENT:
- RTX 4090 pod active (n0fq2ikt4uk0zy)
- Training: 10 trials × 50 epochs, batch_size=256
- Expected: 1.3 days, $10.41 cost

Fixes #P0-sigmoid #P0-decay-steps #hyperopt-mamba2
2025-10-28 14:11:18 +01:00

76 lines
3.5 KiB
Bash
Executable File

#!/bin/bash
# MAMBA2 13-Parameter Hyperopt Deployment Script
# This script will keep trying until a GPU becomes available
set -e
COMMAND="/runpod-volume/binaries/hyperopt_mamba2_demo --parquet-file /runpod-volume/test_data/ES_FUT_180d.parquet --trials 50 --epochs 50 --n-initial 10 --seed 42"
echo "╔════════════════════════════════════════════════════════════════════╗"
echo "║ MAMBA2 13-Parameter Hyperopt Deployment ║"
echo "╚════════════════════════════════════════════════════════════════════╝"
echo ""
echo "Configuration:"
echo " Binary: hyperopt_mamba2_demo (20.1 MB)"
echo " Dataset: ES_FUT_180d.parquet (2.9 MB)"
echo " Trials: 50"
echo " Epochs per trial: 50"
echo " Initial random samples: 10"
echo " Seed: 42"
echo ""
echo "Expected:"
echo " Runtime: 60-90 minutes"
echo " Cost: \$0.17-0.26 (RTX A4000 @ \$0.17/hr)"
echo ""
echo "Attempting deployment..."
echo ""
cd /home/jgrusewski/Work/foxhunt
# Try deployment
python3 scripts/runpod_deploy.py \
--gpu-type "RTX A4000" \
--command "$COMMAND" \
--container-disk 50
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo ""
echo "╔════════════════════════════════════════════════════════════════════╗"
echo "║ ✅ DEPLOYMENT SUCCESSFUL ║"
echo "╚════════════════════════════════════════════════════════════════════╝"
echo ""
echo "Next steps:"
echo " 1. Monitor progress: Check Runpod console at https://www.runpod.io/console/pods"
echo " 2. Wait 60-90 minutes for hyperopt to complete"
echo " 3. Download results from S3:"
echo ""
echo " aws s3 ls s3://se3zdnb5o4/results/ \\"
echo " --profile runpod \\"
echo " --endpoint-url https://s3api-eur-is-1.runpod.io \\"
echo " --recursive"
echo ""
echo " 4. Download best parameters:"
echo ""
echo " aws s3 cp s3://se3zdnb5o4/results/mamba2_13param_best_params_*.json \\"
echo " /tmp/mamba2_best_params.json \\"
echo " --profile runpod \\"
echo " --endpoint-url https://s3api-eur-is-1.runpod.io"
echo ""
else
echo ""
echo "╔════════════════════════════════════════════════════════════════════╗"
echo "║ ⚠️ DEPLOYMENT FAILED - No GPU Available ║"
echo "╚════════════════════════════════════════════════════════════════════╝"
echo ""
echo "Runpod GPUs in EUR-IS-1 are currently unavailable."
echo ""
echo "Options:"
echo " 1. Try again in 5-10 minutes (availability fluctuates)"
echo " 2. Run this script again: bash /home/jgrusewski/Work/foxhunt/deploy_mamba2_hyperopt.sh"
echo " 3. Monitor availability: https://www.runpod.io/console/gpu-cloud"
echo ""
exit 1
fi