Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep objects in cache between tasks #29

Merged
merged 2 commits into from
Nov 7, 2016
Merged

Keep objects in cache between tasks #29

merged 2 commits into from
Nov 7, 2016

Conversation

pcmoritz
Copy link
Contributor

@pcmoritz pcmoritz commented Nov 6, 2016

This PR changes the behavior so that if we get an object and let the object go out of scope, it will not unmap the object's memory immediately, only after a delay (i.e. after more objects went out of scope).
This is an important optimization, because unmap flushes the cpu cache. If tasks reuse the same objects, the objects sho ld stay in the cpu cache between task boundaries. This optimization is especially important for iterative workloads.

This illustrates the performance difference (it is ~2x slower without this PR).

A = np.random.rand(5000, 5000)
v = np.random.rand(5000)
A_id = ray.put(A)
v_id = ray.put(v)
a = time.time()
for i in range(100):
  A.dot(v)
b = time.time() - a
c = time.time()
for i in range(100):
  ray.get(A_id).dot(ray.get(v_id))
d = time.time() - c

@pcmoritz pcmoritz force-pushed the cache branch 4 times, most recently from 147fdb0 to 1cea62e Compare November 6, 2016 06:14
@pcmoritz pcmoritz force-pushed the cache branch 8 times, most recently from 0d1d6d8 to 4ab378d Compare November 7, 2016 00:32
@robertnishihara robertnishihara merged commit 1147c4d into master Nov 7, 2016
@robertnishihara robertnishihara deleted the cache branch November 7, 2016 01:31
rkooo567 added a commit that referenced this pull request Nov 2, 2022
#29196)

This reverts the PR and fixes the test failures

This also fixes a bug around _monitor_jobs API. the monitor job can be called on the same job twice now, which will break the event (because at the end of monitor job, we record the event that job is completed). The same completed event can be reported twice without the fix
minerharry pushed a commit to minerharry/ray that referenced this pull request Dec 6, 2022
…9164)" (ray-project#29… (ray-project#29196)

This reverts the PR and fixes the test failures

This also fixes a bug around _monitor_jobs API. the monitor job can be called on the same job twice now, which will break the event (because at the end of monitor job, we record the event that job is completed). The same completed event can be reported twice without the fix

upgrade gtest to 1.12.1 (ray-project#29902)

While working on ray-project#28209 I hit issue google/googletest#3514, which causes a couple gtest-dependent tests to be unable to build

Signed-off-by: Pablo E <pabloem@apache.org>
WeichenXu123 pushed a commit to WeichenXu123/ray that referenced this pull request Dec 19, 2022
…9164)" (ray-project#29… (ray-project#29196)

This reverts the PR and fixes the test failures

This also fixes a bug around _monitor_jobs API. the monitor job can be called on the same job twice now, which will break the event (because at the end of monitor job, we record the event that job is completed). The same completed event can be reported twice without the fix

Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants