A simple implementation of the ray framework for method agnostic task paralellization.
Project description
Get Started
pip install ezRay
Quick Start Guide
from ezRay import MultiCoreExecutionTool
import ray
# configure ezRay
instance_metadata:dict = {
'num_cpus': 4, # number of cpus to use
'num_gpus': 0, # number of gpus to use
'address': None, # remote cluster address. None for local.
}
# setup ezRay
MultiCore = MultiCoreExecutionTool(instance_metadata = instance_metadata)
# launch ray dashboard (optional)
MultiCore.launch_dashboard()
# define any task
def do_something(foo:int, bar:int) -> int:
return foo + bar
# or use a ray.remote object
@ray.remote
def do_something_remote(foo:int, bar:int) -> int:
return foo - bar
# prepare your data in a dictionary. They keys work as identifiers, while the values should be dictionaries matching the function signature.
data = {
1:{'foo' : 0, 'bar' : 1},
2:{'foo' : 1, 'bar' : 2},
3:{'foo' : 2, 'bar' : 3}
}
# pass the data to ezRay
MultiCore.update_data(data)
# run the task
MultiCore.run(do_something)
# get the results
results_first_task = MultiCore.get_results()
## prepare for the next run
# this will automaticall archive current results
# alternatively you can use MultiCore.archive_results()
MultiCore.next()
# run a second task
MultiCore.run(do_something_remote)
# get current results
results_second_task = MultiCore.get_results()
# get the archived results
archive = MultiCore.get_archive()
Documentation
Pending, sry. No time. However, check out the sandbox in the examples folder or the docstrings in the code.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ezray-1.1.10.tar.gz
(14.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
ezray-1.1.10-py3-none-any.whl
(16.4 kB
view details)
File details
Details for the file ezray-1.1.10.tar.gz.
File metadata
- Download URL: ezray-1.1.10.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.9.9 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e17387eea16285bf3e7033a776e98a24a466e42b64c5de37f73254f809f94df4
|
|
| MD5 |
4308725b7505f730279623bb735dccc5
|
|
| BLAKE2b-256 |
ece92de94735ae4c165e21f130ee5676d44362996064110317ba452e49aabcc9
|
File details
Details for the file ezray-1.1.10-py3-none-any.whl.
File metadata
- Download URL: ezray-1.1.10-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.9.9 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a63035193e4a7d0de0ea651f3ad3f758c5e5cbff586e753f428c8f4219c461eb
|
|
| MD5 |
6cc312c4235d4007f9a83f16838e1aae
|
|
| BLAKE2b-256 |
8cf0ebf3b22bab3db1e15dc09ee26f358d8395690b58ce8e91c68dfb3aefecd2
|