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][aDAG] Non-dag output cannot be an input of other dag #47723

Open
rkooo567 opened this issue Sep 17, 2024 · 3 comments
Open

[core][aDAG] Non-dag output cannot be an input of other dag #47723

rkooo567 opened this issue Sep 17, 2024 · 3 comments
Labels
bug Something that is supposed to be working; but isn't compiled-graph core Issues that should be addressed in Ray Core P1 Issue that should be fixed within a few weeks

Comments

@rkooo567
Copy link
Contributor

What happened + What you expected to happen

not sure if it is intended. But we cannot pass non-dag-value to be an input of other dag.

Versions / Dependencies

master

Reproduction script

import ray
ray.init()

from ray.dag import InputNode

@ray.remote
class A:
    def g(self, i):
        return 1
    
    def f(self, *a):
        print(a)


a = A.remote()
actors = [A.remote() for _ in range(4)]


with InputNode() as inp:
    activations = []
    for i, actor in enumerate(actors):
        activations.append((actor.g.bind(inp), i))
    dag = a.f.bind(*activations)
adag = dag.experimental_compile()
print(ray.get(adag.execute(1)))

Issue Severity

None

@rkooo567 rkooo567 added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Sep 17, 2024
@anyscalesam anyscalesam added core Issues that should be addressed in Ray Core compiled-graph labels Sep 24, 2024
@stephanie-wang
Copy link
Contributor

@rkooo567 can you elaborate? I'm not sure from the example what you mean. Which line in the example shows the issue?

@rkooo567
Copy link
Contributor Author

@stephanie-wang it looks like if we pass a tuple as an argument everything other than dag ref is ignored (in this case i, activations.append((actor.g.bind(inp), i)))

@rkooo567 rkooo567 added P1 Issue that should be fixed within a few weeks and removed triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Oct 24, 2024
@stephanie-wang
Copy link
Contributor

Oh got it, thanks! Hmm should we just disallow passing DAG ref inside other data structures for now? Otherwise I guess the other option is to serialize with placeholders for the DAG refs and then deserialize for each DAG invocation.

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 compiled-graph core Issues that should be addressed in Ray Core P1 Issue that should be fixed within a few weeks
Projects
None yet
Development

No branches or pull requests

3 participants