ray icon indicating copy to clipboard operation
ray copied to clipboard

[Core] Incompatibility with the Rtree library.

Open decadance-dance opened this issue 1 year ago • 1 comments

What happened + What you expected to happen

It dosen't work with rtree index structure from python Rtree library. When I create the index in one remote func and pass it as input to another func I won't get the same index. I expect that the index object to be stable (not changed) between remote funcs.

Versions / Dependencies

Rtree==1.2.0 ray==2.20.0

Python 3.10

Reproduction script

import ray
from rtree import index as rindex


def make_rtree_index():
    ridx = rindex.Index()
    ridx.insert(0, [0, 10, 20, 30])
    return ridx


def show_rtree(rtree):
    print(rtree.bounds)


if __name__ == "__main__":

    # Run wo/ ray
    rtree = make_rtree_index()
    show_rtree(rtree)


    # Run w/ ray
    ray.init(local_mode=True)

    make_rtree_index = ray.remote(make_rtree_index)
    show_rtree = ray.remote(show_rtree)

    rtree = make_rtree_index.remote()
    show_rtree.remote(rtree)

Issue Severity

Medium: It is a significant difficulty but I can work around it.

decadance-dance avatar May 15 '24 19:05 decadance-dance

I can't reproduce this problem in the current mainline, maybe you can try the latest source code installation, or version 2.22.0

982945902 avatar May 20 '24 07:05 982945902

Can you retry with ray 2.22.0 and print the result differences? Thanks

rynewang avatar May 20 '24 22:05 rynewang