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

faster chatting (WIP) #693

Merged
merged 3 commits into from Nov 13, 2018
Merged

faster chatting (WIP) #693

merged 3 commits into from Nov 13, 2018

Conversation

ddorian
Copy link
Contributor

@ddorian ddorian commented Nov 11, 2018

Description: Making chatting faster by removing small and big things.

Checklist:

  • My PR is ready for code review
  • I have added some tests, if applicable, and run the whole test suite, including linting tests
  • I have updated the documentation, if applicable

Some benchmarks on my workload: (100 runs, but some are "hi" and some are "find intent/slots".
No change::
image
Removing deepcopy:
image

As we can see, there are still things that take time just like my last pull request #648 like initial_string_from_tokens(), tokens = [c["token"] for c in cache], having the hot-path execute last in the functions, using some mutable data structures when they're never modified (and recreating them). This was using a small model, I'll check with big model to see if they take more % time.

What do you think ?

@adrienball
Copy link
Contributor

Hi @ddorian ,
Thanks for this PR.
We initially used these deepcopys in order to ensure the integrity of the cache and protect it from being mutated in the client code. That is indeed expensive.
Can you fix the small linting issue (unused deepcopy import)? Then I will merge this.
Cheers.

Copy link
Contributor

@adrienball adrienball left a comment

Choose a reason for hiding this comment

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

🎉

@adrienball adrienball merged commit fd66a8a into snipsco:develop Nov 13, 2018
@ddorian ddorian deleted the f/aster_chat branch November 13, 2018 10:26
@ddorian
Copy link
Contributor Author

ddorian commented Nov 13, 2018

Thank you.
What about my other suggestions ? initial_string_from_tokens and small stuff that add up ? Should I create a pull request for them ?

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