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

Ray Core Hangs After Seconds of Parallel Execution #46396

Open
muazhari opened this issue Jul 2, 2024 · 0 comments
Open

Ray Core Hangs After Seconds of Parallel Execution #46396

muazhari opened this issue Jul 2, 2024 · 0 comments
Labels
bug Something that is supposed to be working; but isn't core Issues that should be addressed in Ray Core QS Quantsight triage label triage Needs triage (eg: priority, bug/not-bug, and owning component) windows

Comments

@muazhari
Copy link

muazhari commented Jul 2, 2024

What happened + What you expected to happen

Ray Core hangs after seconds of execution. When using plain Windows, it hangs. When using Windows docker wsl2, it gets an error.

It just does not continue executing and CPU utilization drops.
image

Expect to not have any errors and is correct.

Versions / Dependencies

ray==2.31.0
pymoo==0.6.1.1

Windows 11
WSL 2.2.4.0
Docker Desktop 4.31.1 (153621)

Reproduction script

The real code is more complex and private. Approximated to:

from pymoo.core.problem import LoopedElementwiseEvaluation, RayParallelization
from pymoo.algorithms.moo.nsga2 import RankAndCrowding
from pymoo.core.mixed import MixedVariableGA
from pymoo.optimize import minimize

from pymoo.core.problem import ElementwiseProblem

import ray

ray.shutdown()
ray.init(dashboard_host="0.0.0.0")
res = ray.available_resources()
print(res)

class MultiObjectiveMixedVariableProblem(ElementwiseProblem):

    def __init__(self, **kwargs):
        vars = {
            "b": Binary(),
            "x": Choice(options=["nothing", "multiply"]),
            "y": Integer(bounds=(-2 * 10 ** 5, 2 * 10 ** 5)),
            "z": Real(bounds=(-5 * 10 ** 3, 5 * 10 ** 3)),
        }
        super().__init__(vars=vars, n_obj=6, n_ieq_constr=0, **kwargs)

    def _evaluate(self, X, out, *args, **kwargs):
        b, x, z, y = X["b"], X["x"], X["z"], X["y"]
        f1 = z ** 2 + y ** 2
        f2 = (z + 2) ** 2 + (y - 1) ** 2
        f3 = (z ** 2) / 2 + (y + 1)
        f4 = -z ** 2
        f5 = z ** 2
        f6 = z / 2 - y - y / z
        
        if b:
            f2 = 100 * f2
         
        if x == "multiply":
            f2 = 10 * f2

        out["F"] = [f1, f2, f3, f4, f5, f6]


runner = RayParallelization(
    job_resources={
        "num_gpus": int(res["GPU"]),
        "num_cpus": int(res["CPU"]),
    }
)


problem = MultiObjectiveMixedVariableProblem(elementwise_runner=runner)

algorithm = MixedVariableGA(
    survival=RankAndCrowding()
)

res = minimize(
    problem,
    algorithm,
    verbose=True,
    seed=1
)

Issue Severity

High: It blocks me from completing my task.

@muazhari muazhari added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Jul 2, 2024
@anyscalesam anyscalesam added the core Issues that should be addressed in Ray Core label Jul 8, 2024
@jjyao jjyao added windows QS Quantsight triage label labels Jul 8, 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 QS Quantsight triage label triage Needs triage (eg: priority, bug/not-bug, and owning component) windows
Projects
None yet
Development

No branches or pull requests

3 participants