-
Notifications
You must be signed in to change notification settings - Fork 3.4k
model: support ModernBERT embedding model #11256
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
base: main
Are you sure you want to change the base?
model: support ModernBERT embedding model #11256
Conversation
Summary of ChangesHello @0xtoward, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly expands the system's capabilities by integrating the ModernBERT embedding model. This allows the platform to process and generate embeddings using this specific architecture, broadening the range of supported models for various natural language processing tasks. The changes involve adding the model's core implementation, updating system configurations to recognize it, and incorporating it into the testing framework. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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 adds support for the ModernBERT embedding model. The implementation is well-structured and follows the existing patterns in the codebase. I have identified a potential precision issue related to float32 handling in the rotary embeddings, which could impact model accuracy, and have provided a high-severity comment with a suggested fix. Additionally, I've included a few medium-severity comments to improve code clarity and maintainability by removing redundant code and simplifying conditional logic.
b5bb912 to
4227554
Compare
|
/gemini review |
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 adds support for the ModernBERT embedding model. The implementation is well-structured and follows the existing patterns in the codebase. I've identified two high-severity issues in the new modernbert.py file that should be addressed. One is related to missing weight mappings for the MLP layers, which will prevent the model from loading correctly. The other is a potential out-of-bounds access in the rotary embedding calculation due to missing position clamping. The rest of the changes, including the test additions, look good.
|
/gemini review |
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
Thank you for your contribution! This pull request adds support for the ModernBERT embedding model, which is a great addition. The implementation looks solid and follows the existing patterns in the codebase. I've added a few suggestions to improve code clarity and maintainability in the new modernbert.py file.
e29d4eb to
1f0f837
Compare
|
Hi @hnyls2002 , can you check this pr and add run-ci label |
aaf8ab0 to
d6eddb5
Compare
d6eddb5 to
86a9ded
Compare
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
f7aa60d to
1210adf
Compare
1210adf to
7e7da99
Compare
|
Hi @mickqian I saw unit-test-backend-1-gpu-amd (linux-mi300-gpu-1, 10) failed, which is sensitive because I edited triton_backend by 2 lines for encoder-only. |
Motivation
#7429 Support ModernBert
Modifications
create modernbert.py and its unit test
Accuracy Tests
similarity diff tensor(1.1921e-07)
similarity diff tensor(5.9605e-08)
...
PASSED
Benchmarking and Profiling
for
torch_nativebackend : sgl_time/st_time 0.306for
tritonbackend : sgl_time/st_time 0.184both on my local rtx4070
Checklist