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

feat: Iteration node support parallel mode #9493

Merged
merged 22 commits into from
Nov 5, 2024

Conversation

Nov1c444
Copy link
Contributor

@Nov1c444 Nov1c444 commented Oct 18, 2024

Checklist:

Important

Please review the checklist below before submitting your pull request.

  • Please open an issue before creating a PR or link to an existing issue
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Description

Iteration Node supports parallel mode. And add three error handle mode.

Fixes #8226 #9121

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update, included: Dify Document
  • Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
  • Dependency upgrade

Testing Instructions

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

@Nov1c444 Nov1c444 requested review from zxhlyh and laipz8200 October 18, 2024 09:12
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. 🌊 feat:workflow Workflow related stuff. 💪 enhancement New feature or request labels Oct 18, 2024
@Nov1c444 Nov1c444 force-pushed the feat/iteration-node-parallel branch from 2a51009 to 6e92375 Compare October 22, 2024 02:09
@Nov1c444 Nov1c444 force-pushed the feat/iteration-node-parallel branch from 6e92375 to 6c13caa Compare October 22, 2024 02:11
@zxhlyh zxhlyh requested a review from iamjoel October 29, 2024 02:59
iamjoel
iamjoel previously approved these changes Oct 29, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 29, 2024
@laipz8200 laipz8200 self-assigned this Oct 30, 2024
api/core/workflow/nodes/iteration/iteration_node.py Outdated Show resolved Hide resolved
api/core/workflow/nodes/iteration/iteration_node.py Outdated Show resolved Hide resolved
api/core/workflow/nodes/iteration/iteration_node.py Outdated Show resolved Hide resolved
api/core/workflow/nodes/iteration/iteration_node.py Outdated Show resolved Hide resolved
api/core/workflow/nodes/iteration/iteration_node.py Outdated Show resolved Hide resolved
api/core/workflow/nodes/iteration/iteration_node.py Outdated Show resolved Hide resolved
api/core/workflow/nodes/iteration/entities.py Outdated Show resolved Hide resolved
api/core/workflow/nodes/iteration/entities.py Outdated Show resolved Hide resolved
api/core/workflow/nodes/iteration/entities.py Outdated Show resolved Hide resolved
@dosubot dosubot bot removed the lgtm This PR has been approved by a maintainer label Oct 30, 2024
- Extended event parameter to include QueueNodeInIterationFailedEvent.
laipz8200
laipz8200 previously approved these changes Nov 4, 2024
api/core/workflow/nodes/iteration/entities.py Outdated Show resolved Hide resolved
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 4, 2024
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Nov 5, 2024
@Nov1c444 Nov1c444 force-pushed the feat/iteration-node-parallel branch from e666004 to cbf6c77 Compare November 5, 2024 02:14
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Nov 5, 2024
@laipz8200 laipz8200 merged commit d1505b1 into main Nov 5, 2024
10 checks passed
@laipz8200 laipz8200 deleted the feat/iteration-node-parallel branch November 5, 2024 02:32
@Nov1c444 Nov1c444 mentioned this pull request Nov 5, 2024
12 tasks
Scorpion1221 added a commit to yybht155/dify that referenced this pull request Nov 5, 2024
* commit '7f583ec1ac6e7fb5269ed696f40a96a8b6b6f5fc': (176 commits)
  chore: update version to 0.11.0 across all relevant files (langgenius#10278)
  fix: iteration none output error (langgenius#10295)
  fix(http_request): improve parameter initialization and reorganize tests (langgenius#10297)
  fix typo: writeOpner to writeOpener (langgenius#10290)
  fix: handle KeyError when accessing rules in CleanProcessor.clean (langgenius#10258)
  fix: borken faq url in CONTRIBUTING.md (langgenius#10275)
  feat: add xAI model provider (langgenius#10272)
  feat(model_runtime): add new model 'claude-3-5-haiku-20241022' (langgenius#10285)
  fix(model_runtime): fix wrong max_tokens for Claude 3.5 Haiku on Amazon Bedrock (langgenius#10286)
  feat(model): add validation for custom disclaimer length (langgenius#10287)
  fix(node): correct file property name in function switch (langgenius#10284)
  refactor the logic of refreshing access_token (langgenius#10068)
  chore: translate i18n files (langgenius#10273)
  Updates: Add mplfonts library for customizing matplotlib fonts and Va… (langgenius#9903)
  feat: Iteration node support parallel mode (langgenius#9493)
  fix(workflow):  handle else condition branch addition error in if-else node (langgenius#10257)
  feat(document_extractor): support tool file in document extractor (langgenius#10217)
  feat: support Claude 3.5 Haiku on Amazon Bedrock (langgenius#10265)
  refactor(parameter_extractor): implement custom error classes (langgenius#10260)
  fix: buitin tool aippt (langgenius#10234)
  ...

# Conflicts:
#	.github/workflows/build-push.yml
#	api/Dockerfile
#	api/core/workflow/nodes/code/code_node.py
AlwaysBluer pushed a commit to AlwaysBluer/dify that referenced this pull request Nov 14, 2024
idonotknow pushed a commit to AceDataCloud/Dify that referenced this pull request Nov 16, 2024
@detongz
Copy link

detongz commented Dec 12, 2024

Iteration node parallel mode is great, but I find that it wont work when i have parallel llm nodes running within it:
image
image

After iteration node parallel mode the entire loop blocks at its first node and stucked.
image

@Nov1c444
Copy link
Contributor Author

Nov1c444 commented Dec 12, 2024

Iteration node parallel mode is great, but I find that it wont work when i have parallel llm nodes running within it: image image

After iteration node parallel mode the entire loop blocks at its first node and stucked. image

Sorry, I tried to build a similar workflow, but couldn't reproduce your issue. Could you please create an issue and provide us with more information?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request 🌊 feat:workflow Workflow related stuff. lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Parallel and Loop Module Functionality to Iteration Block + Support Donation Feature
4 participants