Distributask
A simple way to distribute rendering tasks across multiple machines.
Description
Distributask is a package that automatically queues, executes, and uploads the result of any task you want using Vast.ai, a decentralized network of GPUs. It works by first creating a Celery queue of the tasks, which contain the code that you want to be ran on a GPU. The tasks are then passed to the Vast.ai GPU workers using Redis as a message broker. Once a worker has completed a task, the result is uploaded to Hugging Face.
Installation
pip install distributask
Development
Setup
Clone the repository and navigate to the project directory:
git clone https://github.com/DeepAI-Research/Distributask.git
cd Distributask
Install the required packages:
pip install -r requirements.txt
Or install Distributask as a package:
pip install distributask
Configuration
Create a .env file in the root directory of your project or set environment variables to create your desired setup:
REDIS_HOST="name of your redis server"
REDIS_PORT="port of your redis server
REDIS_USER="username to login to redis server"
REDIS_PASSWORD="password to login to redis server"
VAST_API_KEY="your Vast.ai API key"
HF_TOKEN="your Hugging Face token"
HF_REPO_ID="name of your Hugging Face repository"
BROKER_POOL_LIMIT="your broker pool limit setting"
Getting Started
Running an Example Task
To run an example task and see Distributask in action, you can execute the example script provided in the project:
# Run the example task locally using either a Docker container or a Celery worker:
python -m distributask.example.local
# Run the example task on Vast.ai ("kitchen sink" example):
python -m distributask.example.distributed
This script configures the environment, registers a sample function, creates a queue of tasks, and monitors its execution on some workers.
Command Options
--max_priceis the max price (in $/hour) a node can be be rented for.--max_nodesis the max number of vast.ai nodes that can be rented.--docker_imageis the name of the docker image to load to the vast.ai node.--module_nameis the name of the Celery worker.--number_of_tasksis the number of example tasks that will be added to the queue and done by the workers.
Documentation
For more info checkout our in-depth documentation!
Contributing
Contributions are welcome! For any changes you would like to see, please open an issue to discuss what you would like to see changed or to change yourself.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Citation
@misc{Distributask,
author = {DeepAIResearch},
title = {Distributask: a simple way to distribute rendering tasks across mulitiple machines},
year = {2024},
publisher = {GitHub},
howpublished = {\url{https://github.com/DeepAI-Research/Distributask}}
}
Contributors
Metadata
Release files for distributask 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| distributask-0.1.2.tar.gz | 18.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| distributask-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.0 kB
Release files / distributask-0.1.2.tar.gz
| Download URL | distributask-0.1.2.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8969230232e33f893f849887204c6e502bcae5ad14f4d3fbd7f34bcefac575d6
|
|
BLAKE2b-256 checksum How to use checksums |
5334be2c65eba060ebb3d256b2c6ef51f987e23bae29787c587952b1591b071c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|
Release files / distributask-0.1.2-py3-none-any.whl
| Download URL | distributask-0.1.2-py3-none-any.whl |
|---|---|
| Size | 19.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e4f67e56b6a071273de7b5dbedbcc40e13204a493656a5b49257fd849e63d6f0
|
|
BLAKE2b-256 checksum How to use checksums |
e1cf1d05ed3b1e6792c7bec5a59d0652d00f6a4c3619580b1e4530ac0873ee93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|