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

[Core] zero-copy doesn't seem to give arrays that share memory space #48961

Open
Joshuaalbert opened this issue Nov 27, 2024 · 0 comments
Open
Labels
bug Something that is supposed to be working; but isn't core Issues that should be addressed in Ray Core triage Needs triage (eg: priority, bug/not-bug, and owning component)

Comments

@Joshuaalbert
Copy link

What happened + What you expected to happen

The simplest way to see if zero copy has been performed is to check if the memory space is shared by the original and materialised object. This is false for a simple test case. Is my test incorrect? If so, how can I verify?

Versions / Dependencies

ray 2.39

Reproduction script

import ray
import numpy as np

if __name__ == '__main__':

    ray.init(address='local')

    original_array = np.random.rand(10, 10)

    ray_ref = ray.put(original_array)

    retrieved_array = ray.get(ray_ref)

    # Verify zero-copy
    if np.shares_memory(original_array, retrieved_array):
        print("Zero-copy confirmed!")
    else:
        print("Data was copied!")

Issue Severity

High: It blocks me from completing my task.

@Joshuaalbert Joshuaalbert added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Nov 27, 2024
@jcotant1 jcotant1 added the core Issues that should be addressed in Ray Core label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't core Issues that should be addressed in Ray Core triage Needs triage (eg: priority, bug/not-bug, and owning component)
Projects
None yet
Development

No branches or pull requests

2 participants