No description
Find a file
Robert Nishihara 87bb7a8f67 [WIP] Large changes to make the tests pass. (#376)
* Revert "Make tests more informative (#372)"

This reverts commit fd353250c8.

* fix bugs, in particular deactivate worker service on driver and remove condition variables

* changes to minimize the changes in this PR

* switch from faulty mutex synchronization to using atomics

* Increase the default size of the message queues, to accommodate exporting large numbers of remote functions. This is a temporary fix, but not a long term solution.

* Reorganize the scheduler export code to queue up exports. This does not solve the underlying problem yet, but sets up a solution.

* Start a separate thread on driver to print error messages by constantly querying the scheduler. This is a temporary solution because the solution based on starting a worker service for the driver which the scheduler can push error messages to is buggy.

* Fix segfault in taskcapsule destructor.

* Move tests for catching errors into a separate test file.

* Revert "roll back grpc (#368)"

This reverts commit c01ef95d04.
2016-08-15 11:02:54 -07:00
cmake/Modules help cmake find right python interpreter on mac (#251) 2016-07-11 12:16:10 -07:00
data load imagenet 2016-06-10 17:25:55 -07:00
doc remove protobuf version from pip install and add instructions for adding Ray to path (#362) 2016-08-09 12:09:06 -07:00
docker remove protobuf version from pip install and add instructions for adding Ray to path (#362) 2016-08-09 12:09:06 -07:00
examples enable running example apps in cluster mode (#357) 2016-08-08 16:01:13 -07:00
include/ray Make tests more informative (#372) 2016-08-11 12:40:55 -07:00
lib/python [WIP] Large changes to make the tests pass. (#376) 2016-08-15 11:02:54 -07:00
protos Changing hard coded ports for objstore and workers to choose unused ports (#365) 2016-08-10 19:08:38 -07:00
scripts enable running example apps in cluster mode (#357) 2016-08-08 16:01:13 -07:00
src [WIP] Large changes to make the tests pass. (#376) 2016-08-15 11:02:54 -07:00
test [WIP] Large changes to make the tests pass. (#376) 2016-08-15 11:02:54 -07:00
thirdparty [WIP] Large changes to make the tests pass. (#376) 2016-08-15 11:02:54 -07:00
vsprojects Update Windows support (#317) 2016-07-28 13:11:13 -07:00
.editorconfig Update Windows support (#317) 2016-07-28 13:11:13 -07:00
.gitignore ignoring build output and example datasets (#360) 2016-08-09 11:30:33 -07:00
.gitmodules Ignore dirty external submodules (#312) 2016-07-27 21:53:07 -07:00
.travis.yml [WIP] Large changes to make the tests pass. (#376) 2016-08-15 11:02:54 -07:00
build-docker.sh Ray with Docker (#324) 2016-08-01 16:44:11 -07:00
build.sh Write computation graph to file 2016-06-27 12:20:30 -07:00
CMakeLists.txt cleanup serialization code (#291) 2016-07-25 15:47:10 -07:00
install-dependencies.sh remove protobuf version from pip install and add instructions for adding Ray to path (#362) 2016-08-09 12:09:06 -07:00
LICENSE switching to BSD (#90) 2016-06-06 12:07:36 -07:00
pylintrc adding pylint (#233) 2016-07-08 12:39:11 -07:00
Ray.sln Update Windows support (#317) 2016-07-28 13:11:13 -07:00
README.md add Pong example to README (#337) 2016-08-01 18:29:04 -07:00
setup-env.sh remove protobuf version from pip install and add instructions for adding Ray to path (#362) 2016-08-09 12:09:06 -07:00
setup.sh remove installation of dependencies from setup script (#239) 2016-07-08 20:03:21 -07:00

Ray

Build Status

Ray is an experimental distributed extension of Python. It is under development and not ready for general use.

The goal of Ray is to make it easy to write machine learning applications that run on a cluster while providing the development and debugging experience of working on a single machine.

Before jumping into the details, here's a simple Python example for doing a Monte Carlo estimation of pi (using multiple cores or potentially multiple machines).

import ray
import numpy as np

# Start a scheduler, an object store, and some workers.
ray.init(start_ray_local=True, num_workers=10)

# Define a remote function for estimating pi.
@ray.remote([int], [float])
def estimate_pi(n):
  x = np.random.uniform(size=n)
  y = np.random.uniform(size=n)
  return 4 * np.mean(x ** 2 + y ** 2 < 1)

# Launch 10 tasks, each of which estimates pi.
result_ids = []
for _ in range(10):
  result_ids.append(estimate_pi.remote(100))

# Fetch the results of the tasks and print their average.
estimate = np.mean([ray.get(result_id) for result_id in result_ids])
print "Pi is approximately {}.".format(estimate)

Within the for loop, each call to estimate_pi.remote(100) sends a message to the scheduler asking it to schedule the task of running estimate_pi with the argument 100. This call returns right away without waiting for the actual estimation of pi to take place. Instead of returning a float, it returns an object ID, which represents the eventual output of the computation (this is a similar to a Future).

The call to ray.get(result_id) takes an object ID and returns the actual estimate of pi (waiting until the computation has finished if necessary).

Next Steps

Example Applications