Every value returned by a task and every value placed withDocumentation Index
Fetch the complete documentation index at: https://ray-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
ray.put lives in Ray’s distributed object store. Workers fetch objects on demand: zero-copy from shared memory on the same node, and over the network from remote nodes.
Place values into the object store
ray.put returns an ObjectRef. Pass it to tasks instead of re-serializing the underlying value.
Retrieve values
ray.get blocks until the object is ready and returns its value.
Wait for results
ray.wait returns the subset of refs that have already finished.
Pass refs through tasks
A task that takes anObjectRef argument receives the resolved value automatically — Ray fetches it onto the node where the task runs.
Object lifetimes
Objects are reference-counted. When no Python reference and no in-flight task holds a ref, the object is evicted. To keep an object alive longer than the variable, store the ref somewhere durable (a list, an actor field, a dictionary, etc.).Spilling
When the object store fills, Ray spills cold objects to local disk and (optionally) external storage like S3.Out-of-band serialization
The object store uses Ray’s serializer (built on cloudpickle and Arrow). For custom types, register a custom serializer withray.util.register_serializer.
Best practices
Next steps
Tasks
Use refs as arguments and return values.
Patterns
Object store patterns for ML pipelines.