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

Improve llama models performance #587

Merged
merged 11 commits into from
May 3, 2024
Merged

Improve llama models performance #587

merged 11 commits into from
May 3, 2024

Conversation

dacorvo
Copy link
Collaborator

@dacorvo dacorvo commented May 3, 2024

What does this PR do?

This modifies the default Neuron configuration when exporting Llama models for inference, setting the attention layout to "BSH" instead of "HSB".

This configuration has almost no impact on the token generation time (a.k.a decode), and significantly reduces the context encoding time (a.k.a prefill) for Llama2-7b and Llama3-8B.

Benchmarks updates:

  • Llama 2 benchmarks now only use 8 cores instead of 24. This has a significant impact on Llama 2 13B results.
  • new Llama 3 benchmarks,
  • updated Mistral benchmarks since they had not been rerun with the switch to pytorch 2.1.

In the process, the TGI router version is bumped to 2.0.2.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@dacorvo dacorvo marked this pull request as ready for review May 3, 2024 12:06
@dacorvo
Copy link
Collaborator Author

dacorvo commented May 3, 2024

The TGI tests are failing because I need to remove the test llama neuron model under the optimum org. But if I do that before the pr is merged, it will break the CI for all other pull-requests.

Copy link
Member

@michaelbenayoun michaelbenayoun left a comment

Choose a reason for hiding this comment

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

LGTM
That looks awesome @dacorvo !

docs/source/_toctree.yml Outdated Show resolved Hide resolved
Co-authored-by: Michael Benayoun <mickbenayoun@gmail.com>
@dacorvo dacorvo merged commit 707fff4 into main May 3, 2024
9 of 13 checks passed
@dacorvo dacorvo deleted the improve_llama_perf branch May 3, 2024 15:29
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.

3 participants