Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

What's the meaning on these senstence of "Part 5: Distributed batch inference with Ray Core API" #77

Closed
luxunxiansheng opened this issue Mar 20, 2023 · 1 comment
Assignees

Comments

@luxunxiansheng
Copy link

When using Ray, you can pass objects as arguments to remote functions. Ray will automatically store these objects in the local object store (on the worker node where the function is running) using the ray.put() function. This makes the objects available to all local tasks. However, if the objects are large, this can be inefficient as the objects will need to be copied every time they are passed to a remote function.

To improve performance, you can explicitly store both the model and feature extractor in the object store by using ray.put(). This avoids the need to create multiple copies of the objects.


I am confused on the words on : ray.put()

  1. "However, if the objects are large, this can be inefficient as the objects will need to be copied every time they are passed to a remote function "
  2. "To improve performance, you can explicitly store both the model and feature extractor in the object store by using ray.put(). This avoids the need to create multiple copies of the objects."

which sentence should I follow ?

@kamil-kaczmarek kamil-kaczmarek self-assigned this Mar 23, 2023
@kamil-kaczmarek
Copy link
Collaborator

kamil-kaczmarek commented Nov 22, 2023

@luxunxiansheng

If you call a remote function - that uses large object - multiple times it's best practice to store these objects in the object store. Then use reference in the function call. Have a look at the Ray core best practices: Anti-pattern: Passing the same large argument by value repeatedly harms performance - section at the bottom.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants