-
- Notifications
You must be signed in to change notification settings - Fork 11.2k
[New Model]mBART model #22883
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
[New Model]mBART model #22883
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces support for the MBart model, which is a prerequisite for the Dolphin model. The changes include adding the MBart model implementation, updating the model registry, and refactoring the encoder-decoder example script to support both BART and MBart. The implementation correctly captures the architectural differences between BART and MBart, specifically the pre-norm layer normalization.
My review focuses on the new MBartForConditionalGeneration implementation. I found a critical issue in the weight loading logic that could lead to incorrect model loading due to its reliance on the order of weights in the checkpoint. I've provided a suggestion to make it more robust.
| 👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run 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 either: Add 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please Add this model to tests/models/registry.py
Signed-off-by: 汪志鹏 <wangzhipeng628@gmail.com>
noooop left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| cc @Isotr0py Can you help me review it, thank you. 😊 |
Isotr0py left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial comments, will take a deeper look later tonight.
| @Isotr0py @DarkLight1337 hi, can you help review it, thank you. |
| @DarkLight1337 Can you review it again? thank you. |
DarkLight1337 left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, can you add a test to check the correctness against HF?
| Please refer to https://github.com/vllm-project/vllm/blob/main/tests/models/language/generation/test_bart.py The purpose of this test is to prevent someone from accidentally breaking mBART. |
| Yeah, make sure the test is run in CI |
Signed-off-by: 汪志鹏 <wangzhipeng628@gmail.com>
| @DarkLight1337 @noooop I have add CI of mbart based on test_bart.py, please review it, thank you. |
DarkLight1337 left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM!
| @DarkLight1337 The failed checks seem to be unrelated to my code. |
Signed-off-by: 汪志鹏 <wangzhipeng628@gmail.com> Signed-off-by: Yiwen Chen <yiwen66@berkeley.edu>
Signed-off-by: 汪志鹏 <wangzhipeng628@gmail.com>
Signed-off-by: 汪志鹏 <wangzhipeng628@gmail.com> Signed-off-by: Duncan Moss <djm.moss@gmail.com>
Signed-off-by: 汪志鹏 <wangzhipeng628@gmail.com>
Signed-off-by: 汪志鹏 <wangzhipeng628@gmail.com> Signed-off-by: Xiao Yu <xiao.yu@amd.com>
Signed-off-by: 汪志鹏 <wangzhipeng628@gmail.com>


Purpose
This PR introduces support for the mBART model. This is a necessary prerequisite for the implementation of the Dolphin model, which is tracked in issue #18850, as Dolphin requires mBART for its decoder.
The main difference from the existing BART model is that mBART adjusts the position of the
LayerNormlayer within its architecture. Theencoder_decoder.pyexample has also been updated to handle both BART and the new mBART model, ensuring backward compatibility.Test Plan
The implementation was verified using the offline inference example for both the new mBART model and the existing BART model.
Test Result
Both test commands executed successfully and produced the expected outputs, confirming that the mBART implementation is correct and that backward compatibility with BART is maintained.
mBART Test Result:
BART Test Result: