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.11.tar.gz
(15.0 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.11-py3-none-any.whl
(16.7 kB
view details)
File details
Details for the file ezray-1.1.11.tar.gz.
File metadata
- Download URL: ezray-1.1.11.tar.gz
- Upload date:
- Size: 15.0 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 |
87d84ec58e1785c414466bc52fc228d282de016be8387ea059cbf4dddf658679
|
|
| MD5 |
a677f1aa8e50881cd55dcc74a3654e49
|
|
| BLAKE2b-256 |
2792fb223ae0c7b9791dcd8eb711cb0a06f636fbb86547bd631ac82a1d29d0de
|
File details
Details for the file ezray-1.1.11-py3-none-any.whl.
File metadata
- Download URL: ezray-1.1.11-py3-none-any.whl
- Upload date:
- Size: 16.7 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 |
1c654996cf5f2cc53b406942a56792776595189e07cdaae2aa1203cbcd70f9d9
|
|
| MD5 |
284a59b073cb86dd8bab1c7e2ea8f414
|
|
| BLAKE2b-256 |
1593e712f33f5cb3d12c4cc24c845165d314f98f6a4d9711c48bfd6a920f8c36
|