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(ai): improve AI selection algorithm #3030

Merged
merged 2 commits into from May 2, 2024

Conversation

rickstaa
Copy link
Contributor

@rickstaa rickstaa commented Apr 23, 2024

What does this pull request do? Explain your changes. (required)

This pull request modifies the selection algorithm to continue retrying for a duration of one second instead of stopping after four attempts. This change addresses issues encountered with the current algorithm's performance in environments with 15 nodes on the network, ensuring more robust and reliable operation until further optimizations can be implemented.

Specific updates (required)

  • The range based AI select logic was replaced by a timeout to ensure more Orchstrators get selected.

How did you test each of these updates (required)

I tested it offchain/onchain on my development Gateway.

Does this pull request close any open issues?

Checklist:

@github-actions github-actions bot added the AI Issues and PR related to the AI-video branch. label Apr 23, 2024
@rickstaa rickstaa force-pushed the ai-video_fix-selection-algo branch from 640fd85 to a69500c Compare April 23, 2024 12:19
This commit modifies the selection algorithm to continue retrying for a
duration of one second instead of stopping after four attempts. This
change addresses issues encountered with the current algorithm's
performance in environments with 15 nodes on the network, ensuring more
robust and reliable operation until further optimizations can be
implemented.
@rickstaa rickstaa force-pushed the ai-video_fix-selection-algo branch from a69500c to 5a08c6d Compare April 24, 2024 12:29
This commit replaces the time-based for-loop in the selection
algorithm's retry logic with a more context-aware approach.
@rickstaa rickstaa force-pushed the ai-video_fix-selection-algo branch from 87d8213 to a3007cf Compare April 24, 2024 20:10
@rickstaa rickstaa marked this pull request as draft April 24, 2024 20:11
@rickstaa rickstaa marked this pull request as ready for review April 29, 2024 19:14
@rickstaa
Copy link
Contributor Author

rickstaa commented Apr 29, 2024

Here's @yondonfu; this straightforward solution might help ease the situation. I have several other PRs lined up to fix the double selection, but this one is ready for merging if there are no objections. I also am finishing a tech spec explaining all the improvements that can be made. The only downside I see is the increased cost because we pay orch's for returning an insufficient capacity error. To address this, I've created a new pull request, which you can review here: PR #3035.

Copy link
Contributor

@eliteprox eliteprox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me. This will make the selection process much more efficient

@rickstaa rickstaa merged commit bbda633 into ai-video May 2, 2024
8 of 9 checks passed
@rickstaa rickstaa deleted the ai-video_fix-selection-algo branch May 2, 2024 20:39
server/ai_process.go Show resolved Hide resolved
server/ai_process.go Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI Issues and PR related to the AI-video branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants