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: improve triple generation speed by spinning up as a tokio::task #801

Closed
wants to merge 2 commits into from

Conversation

ChaoticTempest
Copy link
Member

We've been manually managing triple protocols via configs like max_concurrent_generation in our main runtime thread which is not quite efficient. By spawning them as tokio tasks, we should see a good speedup. We also no longer need to manage the amount of work we need ourselves, since the Tokio runtime has features like spinning up more threads to further accommodate the workload that we push to it, with work stealing such that no task takes too long.

From what I've seen our average elapsed=35s of triple completion went down to 15-25s averages with this change.

This is however a potential instability to add while we are releasing mainnet, so should only be merged if we have high confidence in this so please test this for yourself before pushing this in

@ChaoticTempest ChaoticTempest changed the title feat: improve triple generation speed by making be spunned up as a tokio::task feat: improve triple generation speed by spinning up as a tokio::task Aug 3, 2024
@ChaoticTempest ChaoticTempest requested a review from ailisp August 3, 2024 05:04
Copy link
Member

@ailisp ailisp left a comment

Choose a reason for hiding this comment

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

Great optimization! I think it looks safe, but it would be nice to move the tokio message sending code to our impl cait_sith::Protocol to replace cait-sith's impl<'a, T> Protocol for ProtocolExecutor<'a, T> {. If so we can keep our protocol mostly unchanged with the speed up implemented in this PR

@ChaoticTempest
Copy link
Member Author

I'll be closing this one for now as some more testing for this needs to be done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants