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(ai): enhance orchestrator selection by incorporating latency #3043

Merged
merged 1 commit into from May 6, 2024

Conversation

rickstaa
Copy link
Contributor

@rickstaa rickstaa commented May 4, 2024

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

This pull request, done in collaboration with @ad-astra-video, introduces latency consideration into the orchestrator selection process, addressing two key issues. Firstly, it resolves a minor bug where the algorithm consistently selected known orchestrators due to a condition that never evaluated to true (see this condition). Secondly, this change ensures that, once all orchestrators have been evaluated, the one with the fastest response time for a specific job is chosen. While the current method for calculating latency is somewhat basic, it sets the foundation for more sophisticated enhancements in the future.

Specific updates (required)

  • Add logic to track latency.
  • Ensures that first all unknown sessions get selected to get their latency before sticking to a certain low latency orchestrator.

How did you test each of these updates (required)

Does this pull request close any open issues?

https://linear.app/livepeer-ai-spe/issue/LIV-302/selection-algorithm-sticks-to-known-sessions-after-one-has-been-found

Remarks

The latency calculation formula is a bit naive but it seems to work for the current piplines it howver might be needed to improved when schedulers or other pipeline tools are added.

Important

It's crucial to highlight that this action effectively suspends the stake-based selection formula once latencies for all nodes have been identified. To enhance the process, we could consider modifying the MinLSSelector to prioritize the fastest 30% and implement a weight-based selection algorithm accordingly.

Checklist:

@github-actions github-actions bot added the AI Issues and PR related to the AI-video branch. label May 4, 2024
@rickstaa rickstaa changed the title feat(ai): Enhance orchestrator selection by incorporating latency feat(ai): enhance orchestrator selection by incorporating latency May 4, 2024
This commit introduces latency consideration into the orchestrator
selection process, addressing two key issues. Firstly, it resolves a
minor bug where the algorithm consistently selected known orchestrators
due to a condition that never evaluated to true (see [this
condition](https://github.com/livepeer/go-livepeer/blob/1239b4e56133003fe6a98a863cce6bdd6b5f2532/server/selection.go#L110)).
Secondly, this change ensures that, once all orchestrators have been
evaluated, the one with the fastest response time for a specific job is
chosen. While the current method for calculating latency is somewhat
basic, it sets the foundation for more sophisticated enhancements in the
future.

Co-authored-by: Brad P <0xb79orch@gmail.com>
@rickstaa rickstaa merged commit dfb4320 into ai-video May 6, 2024
7 of 9 checks passed
@rickstaa rickstaa deleted the add_latency_to_selection branch May 6, 2024 13:56
@rickstaa
Copy link
Contributor Author

rickstaa commented May 6, 2024

@yondonfu, I've tested this pull request and found that it significantly improves the situation. However, please feel free to provide feedback if this doesn't align with your expectations.

// The "good enough" latency score is set to 0.0 so the selector will always select unknown sessions first

The current implementation isn't yet perfect, as it suspends the stake-based selection formula once latencies for all orchestrators are known. To address this, we might enhance the process by modifying the MinLSSelector to prioritize the fastest 30% and implement a weight-based selection algorithm accordingly. For more details, refer to the discussion at: update-minlsselector-to-select-known-os-based-on-regular-selection.

ad-astra-video added a commit to ad-astra-video/go-livepeer that referenced this pull request May 7, 2024
…vepeer#3043)

This commit introduces latency consideration into the orchestrator
selection process, addressing two key issues. Firstly, it resolves a
minor bug where the algorithm consistently selected known orchestrators
due to a condition that never evaluated to true (see [this
condition](https://github.com/livepeer/go-livepeer/blob/1239b4e56133003fe6a98a863cce6bdd6b5f2532/server/selection.go#L110)).
Secondly, this change ensures that, once all orchestrators have been
evaluated, the one with the fastest response time for a specific job is
chosen. While the current method for calculating latency is somewhat
basic, it sets the foundation for more sophisticated enhancements in the
future.

Co-authored-by: Brad P <0xb79orch@gmail.com>
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

1 participant