easy-runner


Nameeasy-runner JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/liuzuxin/easy-runner
SummaryA lightweight tool for managing and executing multiple parallel experiments.
upload_time2023-06-14 06:28:56
maintainer
docs_urlNone
authorZuxin Liu
requires_python>=3.6
licenseMIT
keywords reinforcement learning platform pytorch
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  <h1>EasyRunner</h1>
</div>
<div align="center">

  <a>![Python 3.8+](https://img.shields.io/badge/Python-3.6%2B-brightgreen.svg)</a>
  [![License](https://img.shields.io/badge/License-MIT-blue.svg)](#license)
  [![PyPI](https://img.shields.io/pypi/v/dsrl?logo=pypi)](https://pypi.org/project/dsrl)
  <!-- [![GitHub Repo Stars](https://img.shields.io/github/stars/liuzuxin/dsrl?color=brightgreen&logo=github)](https://github.com/liuzuxin/dsrl/stargazers) -->
  <!-- [![Downloads](https://static.pepy.tech/personalized-badge/dsrl?period=total&left_color=grey&right_color=blue&left_text=downloads)](https://pepy.tech/project/dsrl) -->
  <!-- [![Documentation Status](https://img.shields.io/readthedocs/fsrl?logo=readthedocs)](https://fsrl.readthedocs.io) -->
  <!-- [![CodeCov](https://codecov.io/github/liuzuxin/fsrl/branch/main/graph/badge.svg?token=BU27LTW9F3)](https://codecov.io/github/liuzuxin/fsrl)
  [![Tests](https://github.com/liuzuxin/fsrl/actions/workflows/test.yml/badge.svg)](https://github.com/liuzuxin/fsrl/actions/workflows/test.yml) -->
  <!-- [![CodeCov](https://img.shields.io/codecov/c/github/liuzuxin/fsrl/main?logo=codecov)](https://app.codecov.io/gh/liuzuxin/fsrl) -->
  <!-- [![tests](https://img.shields.io/github/actions/workflow/status/liuzuxin/fsrl/test.yml?label=tests&logo=github)](https://github.com/liuzuxin/fsrl/tree/HEAD/tests) -->
  
</div>

---

EasyRunner is a lightweight tool for managing and executing multiple parallel experiments. It simplifies the process of running multiple experiments with different configurations or hyperparameters, while monitoring system resources.

## Features

- Run multiple experiments in parallel
- Monitor system resources (CPU and memory usage) during experiments
- Early termination of experiments by inputting the experiment number
- Colorized display of experiment status and resource usage
- Generate a list of instructions from a template and arguments

## Installation

To use EasyRunner, simply download or clone this repository and then:

```
pip install -e .
```

## Usage

1. Initialize an `EasyRunner` object with the required parameters.
2. Specificy a list of commandline instructions to run.
3. Use the `start` method to run experiments. You can specify a list of GPU IDs for running experiments (or `None` by default).
3. Optionally, use the `compose` method to generate a list of instructions from a template and arguments.

A simple example for running a list of instructions (2 parallel) on cuda 0, 1:

```python
from easy_runner import EasyRunner

# Initialize the EasyRunner
runner = EasyRunner(log_name="experiment_logs")

# Create a list of instructions
instructions = [
    "python script1.py --param1 0.1 --param2 100",
    "python script1.py --param1 0.2 --param2 200",
    "python script2.py --param1 0.3 --param2 300",
    "python script2.py --param1 0.4 --param2 400",
    "python script3.py --param1 0.5 --param2 500"
]

# Run experiments
runner.start(instructions, gpus=[0, 1], max_parallel=2)
```

Anoter example of how to use the `compose` feature to perform grid search:

```python
from easy_runner import EasyRunner

# Initialize the EasyRunner
runner = EasyRunner(log_name="experiment_logs")

# List of seeds, and tasks
seeds = [0, 10, 20]
tasks = ["TaskA-v0 --epoch 30", "TaskB-v0 --epoch 150", "TaskC-v0 --epoch 80"]

# Define the command template
template = "nohup python train_script.py --project my_project --seed {} --task {} "

# Generate a list of instructions using the compose method
instructions = runner.compose(template, [agents, seeds, tasks])

# Run the experiments
runner.start(instructions, max_parallel=4)
```

You can try the example scripts in the `examples` folder:
```bash
cd examples
python test_easy_runner.py
```

Demo video:
<div align="center">
  <img width="600px" height="auto" src="https://github.com/liuzuxin/easy-runner/raw/main/examples/demo.gif">
</div>

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

## Contributing

We welcome contributions to the Experiment Grid Tool. Please open an issue or submit a pull request on the GitHub repository.


Feel free to customize this template according to your specific requirements or add any additional information you think would be helpful for users.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/liuzuxin/easy-runner",
    "name": "easy-runner",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "reinforcement learning platform pytorch",
    "author": "Zuxin Liu",
    "author_email": "zuxin1997@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/3e/1d/25295f0638b98ace270476ee4ec6867ee24e205fc1aa4e1c75ef7a7d72ea/easy_runner-0.1.0.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <h1>EasyRunner</h1>\n</div>\n<div align=\"center\">\n\n  <a>![Python 3.8+](https://img.shields.io/badge/Python-3.6%2B-brightgreen.svg)</a>\n  [![License](https://img.shields.io/badge/License-MIT-blue.svg)](#license)\n  [![PyPI](https://img.shields.io/pypi/v/dsrl?logo=pypi)](https://pypi.org/project/dsrl)\n  <!-- [![GitHub Repo Stars](https://img.shields.io/github/stars/liuzuxin/dsrl?color=brightgreen&logo=github)](https://github.com/liuzuxin/dsrl/stargazers) -->\n  <!-- [![Downloads](https://static.pepy.tech/personalized-badge/dsrl?period=total&left_color=grey&right_color=blue&left_text=downloads)](https://pepy.tech/project/dsrl) -->\n  <!-- [![Documentation Status](https://img.shields.io/readthedocs/fsrl?logo=readthedocs)](https://fsrl.readthedocs.io) -->\n  <!-- [![CodeCov](https://codecov.io/github/liuzuxin/fsrl/branch/main/graph/badge.svg?token=BU27LTW9F3)](https://codecov.io/github/liuzuxin/fsrl)\n  [![Tests](https://github.com/liuzuxin/fsrl/actions/workflows/test.yml/badge.svg)](https://github.com/liuzuxin/fsrl/actions/workflows/test.yml) -->\n  <!-- [![CodeCov](https://img.shields.io/codecov/c/github/liuzuxin/fsrl/main?logo=codecov)](https://app.codecov.io/gh/liuzuxin/fsrl) -->\n  <!-- [![tests](https://img.shields.io/github/actions/workflow/status/liuzuxin/fsrl/test.yml?label=tests&logo=github)](https://github.com/liuzuxin/fsrl/tree/HEAD/tests) -->\n  \n</div>\n\n---\n\nEasyRunner is a lightweight tool for managing and executing multiple parallel experiments. It simplifies the process of running multiple experiments with different configurations or hyperparameters, while monitoring system resources.\n\n## Features\n\n- Run multiple experiments in parallel\n- Monitor system resources (CPU and memory usage) during experiments\n- Early termination of experiments by inputting the experiment number\n- Colorized display of experiment status and resource usage\n- Generate a list of instructions from a template and arguments\n\n## Installation\n\nTo use EasyRunner, simply download or clone this repository and then:\n\n```\npip install -e .\n```\n\n## Usage\n\n1. Initialize an `EasyRunner` object with the required parameters.\n2. Specificy a list of commandline instructions to run.\n3. Use the `start` method to run experiments. You can specify a list of GPU IDs for running experiments (or `None` by default).\n3. Optionally, use the `compose` method to generate a list of instructions from a template and arguments.\n\nA simple example for running a list of instructions (2 parallel) on cuda 0, 1:\n\n```python\nfrom easy_runner import EasyRunner\n\n# Initialize the EasyRunner\nrunner = EasyRunner(log_name=\"experiment_logs\")\n\n# Create a list of instructions\ninstructions = [\n    \"python script1.py --param1 0.1 --param2 100\",\n    \"python script1.py --param1 0.2 --param2 200\",\n    \"python script2.py --param1 0.3 --param2 300\",\n    \"python script2.py --param1 0.4 --param2 400\",\n    \"python script3.py --param1 0.5 --param2 500\"\n]\n\n# Run experiments\nrunner.start(instructions, gpus=[0, 1], max_parallel=2)\n```\n\nAnoter example of how to use the `compose` feature to perform grid search:\n\n```python\nfrom easy_runner import EasyRunner\n\n# Initialize the EasyRunner\nrunner = EasyRunner(log_name=\"experiment_logs\")\n\n# List of seeds, and tasks\nseeds = [0, 10, 20]\ntasks = [\"TaskA-v0 --epoch 30\", \"TaskB-v0 --epoch 150\", \"TaskC-v0 --epoch 80\"]\n\n# Define the command template\ntemplate = \"nohup python train_script.py --project my_project --seed {} --task {} \"\n\n# Generate a list of instructions using the compose method\ninstructions = runner.compose(template, [agents, seeds, tasks])\n\n# Run the experiments\nrunner.start(instructions, max_parallel=4)\n```\n\nYou can try the example scripts in the `examples` folder:\n```bash\ncd examples\npython test_easy_runner.py\n```\n\nDemo video:\n<div align=\"center\">\n  <img width=\"600px\" height=\"auto\" src=\"https://github.com/liuzuxin/easy-runner/raw/main/examples/demo.gif\">\n</div>\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nWe welcome contributions to the Experiment Grid Tool. Please open an issue or submit a pull request on the GitHub repository.\n\n\nFeel free to customize this template according to your specific requirements or add any additional information you think would be helpful for users.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A lightweight tool for managing and executing multiple parallel experiments.",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/liuzuxin/easy-runner"
    },
    "split_keywords": [
        "reinforcement",
        "learning",
        "platform",
        "pytorch"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9cb40e81d4018a61191699430c2b96e9fa817e8d18ef42c3b0513f95a58924b8",
                "md5": "2cda4e262101dc5ad708fc5a06d33374",
                "sha256": "894728989625b70eda227cefea144a76d8d06b30581fa7f95bdc9e08ddb1238c"
            },
            "downloads": -1,
            "filename": "easy_runner-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2cda4e262101dc5ad708fc5a06d33374",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 7948,
            "upload_time": "2023-06-14T06:28:54",
            "upload_time_iso_8601": "2023-06-14T06:28:54.478924Z",
            "url": "https://files.pythonhosted.org/packages/9c/b4/0e81d4018a61191699430c2b96e9fa817e8d18ef42c3b0513f95a58924b8/easy_runner-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3e1d25295f0638b98ace270476ee4ec6867ee24e205fc1aa4e1c75ef7a7d72ea",
                "md5": "94a361ed75f04b6ed2c796f79b1b4730",
                "sha256": "9938624a165807f75df44602dc434a4ee311b204c0aa1a6f85b72acd9a9a3ed3"
            },
            "downloads": -1,
            "filename": "easy_runner-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "94a361ed75f04b6ed2c796f79b1b4730",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 8279,
            "upload_time": "2023-06-14T06:28:56",
            "upload_time_iso_8601": "2023-06-14T06:28:56.308196Z",
            "url": "https://files.pythonhosted.org/packages/3e/1d/25295f0638b98ace270476ee4ec6867ee24e205fc1aa4e1c75ef7a7d72ea/easy_runner-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-14 06:28:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "liuzuxin",
    "github_project": "easy-runner",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "easy-runner"
}
        
Elapsed time: 0.08346s