Skip to content

[IR] Graph composition #2311

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

Closed
justinchuby opened this issue May 18, 2025 · 3 comments
Closed

[IR] Graph composition #2311

justinchuby opened this issue May 18, 2025 · 3 comments
Labels
module: IR Intermediate representation

Comments

@justinchuby
Copy link
Collaborator

Make graph callable

Graph()(value, ...) -> value... creates a copy of Graph and connects the new values and initializers to the value's graph.

Or: Create a composition tool

I think option (1) is more intuitive.

@justinchuby justinchuby added the module: IR Intermediate representation label May 18, 2025
@leshabirukov
Copy link
Contributor

leshabirukov commented May 26, 2025

I understand it as Graph()(graph1, graph2, ...) -> composed_graph..., is it right?

connects the new values

is it about node inputs\outputs or graph inputs\outputs?

What if two initializers share name but not value?
Will it sort the result graph?
What it will do if cycle appeared?

@justinchuby
Copy link
Collaborator Author

justinchuby commented May 26, 2025

It's more like

input = ir.Value()
output1 = some_graph(input)
output2 = some_other_graph(output1)
new_graph = ir.Graph([input], [output2])

@leshabirukov
Copy link
Contributor

Aha, and usual name conflict resolution is used? ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: IR Intermediate representation
Projects
None yet
Development

No branches or pull requests

2 participants