-
Notifications
You must be signed in to change notification settings - Fork 537
Add ONNX export optimization support for ModernBERT #2177
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
Comments
Great! Please open a PR :) |
This issue has been marked as stale because it has been open for 30 days with no activity. This thread will be automatically closed in 5 days if no further activity occurs. |
Pending PR review -- commenting to keep this open |
This issue has been marked as stale because it has been open for 30 days with no activity. This thread will be automatically closed in 5 days if no further activity occurs. |
Commenting to keep open -- awaiting PR review after updates. |
Feature request
Release v1.24.0 successfully supports exporting a ModernBERT model to ONNX; however, this support does not extend to enabling optimizations via the
--optimize
flag inoptimum-cli
.I'm not sure how much needs to go into enabling this in a more formal capacity, but a very brief attempt by me locally at simply adding
modernbert
in:optimum/optimum/onnxruntime/utils.py
Lines 101 to 149 in afff2fa
and
optimum/optimum/utils/normalized_config.py
Lines 233 to 294 in afff2fa
with the former mapping to
"bert"
and the latter mapping toNormalizedTextConfig
seemed to allow me to export the model with optimizations. In my brief testing after that I didn't notice any glaring issues with the output and observed some expected speedups.Motivation
I would like to export an optimized ONNX version of my ModernBERT model.
Your contribution
I'd be happy to submit a PR if given more information on how this support is typically added.
The text was updated successfully, but these errors were encountered: