8000 [core] The remote function has been exported 100 times.. · Issue #14730 · ray-project/ray · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[core] The remote function has been exported 100 times.. #14730
Open
@yywangvr

Description

@yywangvr

What is the problem?

WARNING import_thread.py:132 -- The remote function 'filaA.parafor' has been exported 100 times. It's possible that this warning is accidental, but this may indicate that the same remote function is being defined repeatedly from within many tasks and exported to all of the workers. This can be a performance issue and can be resolved by defining the remote function on the driver instead. See https://github.com/ray-project/ray/issues/6240 for more discussion.

I read the issues#6240. As I am a new user of Ray, I still don't have any idea to avoid the current warning.

Ray version and other system information (Python version, TensorFlow version, OS):

Ray version:1.2.0
python version: 3.7.10
OS: Ubuntu 20

Reproduction (REQUIRED)

In fileA.py

class A:
    def __init__(self):
        pass
    def dataReader(self):
        sub_vector_id=[parafor.remote(self) for sub_vector in np.array_split(raw_vector, num_cpus)]


@ray.remote
def parafor(obj):
    pass

In fileB.py

from fileA import A
import ray

for _ in range(1000):
    ray.init(address='auto', log_to_driver=False)
    c=A()
    c.dataReader()
    ray.shutdown()
    ...
    optimizeFunction(c)
    ...

Then I start to run fileB.py, after many iterations, I got the above-mentioned error. I would appreciate if you have a solution. Thank you in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issue, but not time-criticalbugSomething that is supposed to be working; but isn'tpending-cleanupThis issue is pending cleanup. It will be removed in 2 weeks after being assigned.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0