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.9.tar.gz
(14.7 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.9-py3-none-any.whl
(16.3 kB
view details)
File details
Details for the file ezray-1.1.9.tar.gz.
File metadata
- Download URL: ezray-1.1.9.tar.gz
- Upload date:
- Size: 14.7 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 |
2b1b794d96ed0f703facd5707d90323ee316b2365ca65f72283d9e5f362f3898
|
|
| MD5 |
d78d7dc0b00bc4ea3ee5edd407a4316c
|
|
| BLAKE2b-256 |
1f640d6812ae06372ed9e11161892095190314a65cfb33d6ec2b13be6b5771c4
|
File details
Details for the file ezray-1.1.9-py3-none-any.whl.
File metadata
- Download URL: ezray-1.1.9-py3-none-any.whl
- Upload date:
- Size: 16.3 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 |
d46f3a127610b0a6abebf63040d9920a4bdc81e1600efeff9dca356700a58c39
|
|
| MD5 |
86045c12ed9298c582da82871b3e58e5
|
|
| BLAKE2b-256 |
ec49e661d632e16e1fbc5686d5f56b942b9c73b4f42c6557c3a725d44a6d4912
|