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

Optimize Pass Through nodes for unused inputs #2555

Open
RunDevelopment opened this issue Feb 7, 2024 · 0 comments
Open

Optimize Pass Through nodes for unused inputs #2555

RunDevelopment opened this issue Feb 7, 2024 · 0 comments
Labels
Backend Issue or PR for the backend server

Comments

@RunDevelopment
Copy link
Member

RunDevelopment commented Feb 7, 2024

Motivation
As I pointed out in #2549, with Pass Through supporting multiple inputs, dead nodes can no longer be effectively eliminated. The issue is that unused inputs cannot be detected by dead node elimination, leading to unnecessary computation.

Description
Add an optimization that removers unused inputs from Pass Through nodes.

Careful! This optimization has to be implemented in a way that does not destroy happens-before relationships. Since the upstream nodes of an unused input may have side effects, removing the unused input may change the order in which those side effects are executed.

Since we currently do not have side-effect nodes with outputs, please pretend that the Invert Color node has side effects in the following example:
image

In the above chain, Invert Color is guaranteed to be executed before Save Image. However, by removing the used input, the Invert Color and Save Image nodes have no relationship to each other anymore and chainner may execute them in any order.

See #2556.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend Issue or PR for the backend server
Projects
None yet
Development

No branches or pull requests

1 participant