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

[Model] Support for fairseq2 Llama #11442

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

MartinGleize
Copy link

@MartinGleize MartinGleize commented Dec 24, 2024

This PR adds support for all Llama models produced with fairseq2. Its checkpoint format is mostly the same as the original Llama checkpoint format, up to layer renaming.
The PR provides a model with custom weight loading, and adds Fairseq2LlamaForCausalLM to the model registry.

Copy link

👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can do one of these:

  • Add ready label to the PR
  • Enable auto-merge.

🚀

@MartinGleize MartinGleize changed the title [Model] Add support for fairseq2 Llama [Model] Support for fairseq2 Llama Dec 24, 2024
Signed-off-by: Martin Gleize <[email protected]>
Signed-off-by: Martin Gleize <[email protected]>
@MartinGleize MartinGleize marked this pull request as ready for review December 31, 2024 13:43
@robertgshaw2-neuralmagic
Copy link
Collaborator

Could you add a simple example to the weight loader tests so we can confirm this wont break in the future?

@MartinGleize
Copy link
Author

Could you add a simple example to the weight loader tests so we can confirm this wont break in the future?

Thank you for the advice, much appreciated. Just so that I'm clear, best way to do what you said is to add a HF model here: https://github.com/vllm-project/vllm/blob/main/tests/weight_loading/models.txt ?

Copy link
Member

@ywang96 ywang96 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! As @robertgshaw2-neuralmagic mentioned it would be great if you can add an example huggingface model repo in https://github.com/vllm-project/vllm/blob/main/tests/weight_loading/models.txt.

I'm also curious if it's worth adding Fairseq2LlamaForCausalLM to https://github.com/vllm-project/vllm/blob/main/docs/source/models/supported_models.md#list-of-text-only-language-models, but I'll leave it to your judgement!

Comment on lines 29 to 30
def _init_model(self, vllm_config: VllmConfig, prefix: str = ""):
return LlamaModel(vllm_config=vllm_config, prefix=prefix)
Copy link
Member

@ywang96 ywang96 Dec 31, 2024

Choose a reason for hiding this comment

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

Is there a reason why you needed to redefine this?

def _init_model(self, vllm_config: VllmConfig, prefix: str = ""):
return LlamaModel(vllm_config=vllm_config, prefix=prefix)

Copy link
Author

Choose a reason for hiding this comment

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

Good point, I had used this as a debugging point but forgot to remove it.

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