Skip to main content

MeinSweeper

Minesweeper image taken from https://www.pngwing.com/en/free-png-vxhwi

MeinSweeper is a lightweight framework for running experiments on arbitrary compute nodes, with built-in support for GPU management and job distribution.

- This is still in alpha, and was written for research
- I.e. expect bugs and smelly code!

Installation

Use the package manager pip to install MeinSweeper:

pip install meinsweeper

Features

  • Asynchronous job execution
  • Support for multiple node types (SSH and Local)
  • Automatic GPU management and allocation
  • Retry mechanism for failed jobs and unavailable nodes
  • Configurable via environment variables

Usage

Basic Usage

import meinsweeper

targets = {
    'local_gpu': {'type': 'local_async', 'params': {'gpus': ['0', '1']}},
    'remote_server': {'type': 'ssh', 'params': {'address': 'example.com', 'username': 'user', 'key_path': '/path/to/key'}}
}

commands = [
    ("python script1.py", "job1"), 
    ("python script2.py", "job2"),
    # ... more commands
]

meinsweeper.run_sweep(commands, targets)

Node Types

  1. Local Async Node: Executes jobs on the local machine, managing GPU allocation.
  2. SSH Node: Connects to remote machines via SSH, manages GPU allocation, and executes jobs.

Both node types handle GPU checking, allocation, and release automatically.

Configuration

MeinSweeper can be configured using environment variables:

  • MINIMUM_VRAM: Minimum free VRAM required for a GPU to be considered available (in GB, default: 8)
  • USAGE_CRITERION: Maximum GPU utilization for a GPU to be considered available (0-1, default: 0.8)
  • MAX_PROCESSES: Maximum number of concurrent processes (-1 for no limit, default: -1)
  • RUN_TIMEOUT: Timeout for each job execution (in seconds, default: 1200)
  • MAX_RETRIES: Maximum number of retries for failed jobs (default: 3)
  • MEINSWEEPER_RETRY_INTERVAL: Interval between retrying unavailable nodes (in seconds, default: 450)
  • MEINSWEEPER_DEBUG: Enable debug logging (set to 'True' for verbose output)

Example:

export MINIMUM_VRAM=10
export USAGE_CRITERION=0.5
export MEINSWEEPER_RETRY_INTERVAL=300
python your_script.py

Advanced Usage

Custom Node Types

You can create custom node types by subclassing the ComputeNode abstract base class:

from meinsweeper.modules.nodes.abstract import ComputeNode

class MyCustomNode(ComputeNode):
    async def open_connection(self):
        # Implementation
    
    async def run(self, command, label):
        # Implementation

# Usage
targets = {
    'custom_node': {'type': 'my_custom_node', 'params': {...}}
}

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Metadata

Release files for meinsweeper 0.3.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for meinsweeper 0.3.8
File Size Uploaded Provenance Actions
meinsweeper-0.3.8.tar.gz 48.0 kB Without provenance Details for meinsweeper-0.3.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for meinsweeper 0.3.8
File Interpreter ABI Platform Actions
meinsweeper-0.3.8-py3-none-any.whl Python 3 none any Details for meinsweeper-0.3.8-py3-none-any.whl

Total release size: 103.2 kB

Release files / meinsweeper-0.3.8.tar.gz

Download URL meinsweeper-0.3.8.tar.gz
Size 48.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f7d67e67756d0dd01f303f7cf7fa949156f5f1169bc9d6976ee0a4ec84ef9b2f
BLAKE2b-256 checksum
How to use checksums
b91904a7c9dbf59a4f946b24f0c10a428d41da446f3179e8a27ce499cc1c7f2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.14

Release files / meinsweeper-0.3.8-py3-none-any.whl

Download URL meinsweeper-0.3.8-py3-none-any.whl
Size 55.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4147cb8ccf6f60add30630b246325f741d1148f148a7c6c4a054dfb4b0b9a093
BLAKE2b-256 checksum
How to use checksums
9803c4e488cd037a11ca8ff3d03c20d0f01b6da2a0be142e1fb34ef39d749c4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.14

Security for meinsweeper 0.3.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page