Port llama3 support from vLLM
Ports llama3 support from vLLM. I used the offline inference script to test llama2, llama3,3.1,3.2 (only text variants, not multi-modal) and other models too for backwards compatibility.
BEFORE SUBMITTING, PLEASE READ THE CHECKLIST BELOW AND FILL IN THE DESCRIPTION ABOVE
PR Checklist (Click to Expand)
Thank you for your contribution to Vidur! Before submitting the pull request, please ensure the PR meets the following criteria. This helps Vidur maintain the code quality and improve the efficiency of the review process.
PR Title and Classification
Only specific types of PRs will be reviewed. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:
[Bugfix]for bug fixes.[CI/Build]for build or continuous integration improvements.[Doc]for documentation fixes and improvements.[Model]for adding a new model or improving an existing model. Model name should appear in the title.[Profiling]For changes on the profiling module.[Core]for changes in the core simulator logic[Misc]for PRs that do not fit the above categories. Please use this sparingly.
Note: If the PR spans more than one category, please include all relevant prefixes.
Code Quality
The PR need to meet the following code quality standards:
- Pass all linter checks. Please use
make formatto format your code. - The code need to be well-documented to ensure future contributors can easily understand the code.
- Please add documentation to
docs/source/if the PR modifies the user-facing behaviors of Vidur. It helps user understand and utilize the new features or changes.
Notes for Large Changes
Please keep the changes as concise as possible. For major architectural changes (>500 LOC), we would expect a GitHub issue (RFC) discussing the technical design and justification. Otherwise, we will tag it with rfc-required and might not go through the PR.
Thank You
Finally, thank you for taking the time to read these guidelines and for your interest in contributing to Vidur. Your contributions make Vidur a great tool for everyone!
@kasohrab which all models did you test?
@kasohrab which all models did you test?
I tested at least one model variant from each family in the description (llama2, llama3,3.1,3.2) plus one mixtral model so far.
I meant like in llama 3.2, does 10b, 90b etc work with these set of changes?
I meant like in llama 3.2, does 10b, 90b etc work with these set of changes?
in llama 3.2, just 1B and 3B work with this pr. I believe 10b and 90b would require further work porting mllama arch: https://github.com/vllm-project/vllm/blob/main/vllm/model_executor/models/mllama.py.
let me know if that should be part of this pr @AgrawalAmey
@kasohrab it would be fantastic if we could port just the language model part to support 10 and 90b models. it would also be good since it would allow us to run 1-10B pair. but we can also take this up later if you expect this to take a lot of effort.
@kasohrab it would be fantastic if we could port just the language model part to support 10 and 90b models. it would also be good since it would allow us to run 1-10B pair. but we can also take this up later if you expect this to take a lot of effort.
This turns out to be a lot since it looks like the cross attention parts are important and not so simple to add without lots of changes @AgrawalAmey .
But today I pushed some bug fixes I noticed were needed for 3.2 1b/3b correctness and how they share lm head and embed token weights. So otherwise this pr is ready for review again.