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

fix: Remove cycle handling #8679

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Willenbrink
Copy link

@Willenbrink Willenbrink commented Jan 2, 2025

Related Issues

Proposed Changes:

Remove the cycle check completely in pipeline. By ensuring that find_next_runnable_node only returns nodes that can actually be run, we don't need the check: Everything in the run_queue will be run and once its empty, we are done.

Instead of previously splitting the graph up into acyclic subgraphs, we maintain a run_queue which only contains nodes that can be run as is. Once we execute a node from the run_queue, we remove it and add all its runnable successors. That way, cycles don't need any special handling. If a backedge supplies all necessary inputs to a node at the top of a loop, it will also be added. This restarts the loop.

How did you test it?

Unit tests and manual verification in my project.

Notes for the reviewer

Note that similar concerns about non-determinism from #8677 apply. For example, nodes with only default input may run in any order. #8680 addresses that specific issue. Nodes within the run_queue are still run in a non-deterministic order but they should be independent anyway.

I might also have found an error in a test: Instead of returning a document_builder (which expects but doesn't get any inputs), we now expect the document_joiner (which is variadic and thus okay with not getting any inputs).

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added unit tests and updated the docstrings
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

@Willenbrink Willenbrink requested a review from a team as a code owner January 2, 2025 13:20
@Willenbrink Willenbrink requested review from anakin87 and removed request for a team January 2, 2025 13:20
@CLAassistant
Copy link

CLAassistant commented Jan 2, 2025

CLA assistant check
All committers have signed the CLA.

@Willenbrink Willenbrink force-pushed the remove-cycle-handling branch from a033217 to a6b5a82 Compare January 2, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cycle detection removes same edge multiple times
2 participants