Skip to content

General-purpose tool for running multiple experiments in parallel using tmux sessions with timing and logging

License

Notifications You must be signed in to change notification settings

mtuann/ml-tmux-runner

Repository files navigation

🚀 ML with tmux Experiment Runner

General-purpose tool for running multiple experiments in parallel using tmux sessions with timing and logging

Python tmux License

⚡ Quick Start

# 🔧 Generate example commands
python generate_commands.py --count-example --output count_commands.txt

# 🏃 Run experiments with timing
python run_experiments.py --commands-file count_commands.txt --session count_demo --attach --show-cmd --stay-open

# 📊 Monitor sessions
python monitor_experiments.py --list

✨ Features

  • 🔄 Parallel Execution: Multiple commands in separate tmux windows
  • ⏱️ Timing Info: Start time, end time, elapsed time for each window
  • 📝 Auto Logging: stdbuf -oL -eL tee for real-time logging
  • 🎛️ Session Management: Create, monitor, kill tmux sessions
  • 🎯 Command Generation: Generate parameter sweeps automatically
  • 📈 Real-time Monitoring: Live status updates

🛠️ Tools

Tool Description Icon
run_experiments.py 🚀 Main experiment runner
generate_commands.py 🔧 Command generator 🎯
monitor_experiments.py 📊 Session monitor 👁️
tmux_count.py 🧮 Example script (count/random/fibonacci) 🔢

📋 Command Format

stdbuf -oL -eL python -u script.py --param value 2>&1 | stdbuf -oL -eL tee logs/output.log

🎯 Examples

🔧 Generate Parameter Sweeps

python generate_commands.py --template "python script.py --param {param}" --params "param=1,2,3" --output commands.txt

🏃 Run with Timing

python run_experiments.py --commands-file commands.txt --session my_exp --attach --show-cmd --stay-open

📊 Monitor Progress

python monitor_experiments.py --monitor my_exp

🧮 tmux_count.py Modes

# Sequential counting
python tmux_count.py --mode count --start 1 --end 10 --step 1

# Random numbers
python tmux_count.py --mode random --start 1 --end 100 --count 5

# Fibonacci sequence
python tmux_count.py --mode fibonacci --count 10

📦 Requirements

  • 🐍 Python 3.6+
  • 🖥️ tmux
  • 🐚 bash

🚀 Installation

# Clone repository
git clone <your-repo-url>
cd fl-experiment-runner

# Make scripts executable
chmod +x *.py

# Install tmux (if needed)
# Ubuntu/Debian: sudo apt-get install tmux
# macOS: brew install tmux

📊 Output Example

==========================================
EXPERIMENT STARTED
Start Time: Mon Jan 15 14:30:25 +07 2024
Command: stdbuf -oL -eL python -u tmux_count.py --mode count --start 1 --end 5
==========================================
[experiment output...]
==========================================
EXPERIMENT COMPLETED
End Time: Mon Jan 15 14:30:28 +07 2024
Elapsed Time: 00:00:03 (3s)
==========================================

🤝 Contributing

  1. 🍴 Fork the repository
  2. 🌿 Create your feature branch (git checkout -b feature/AmazingFeature)
  3. 💾 Commit your changes (git commit -m 'Add some AmazingFeature')
  4. 📤 Push to the branch (git push origin feature/AmazingFeature)
  5. 🔀 Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Built with ❤️ for the research community
  • Inspired by the need for efficient parallel experiment execution
  • Powered by tmux and Python 🐍

About

General-purpose tool for running multiple experiments in parallel using tmux sessions with timing and logging

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages