Comments (6)
Hi @sam-h-bean,
Before quantizing a DeBERTaV2
model, you need to be able to export it to the ONNX format, which is not supported yet. To do so, you could implement a custom OnnxConfig in transformers and add "sequence-classification" feature(if it is the only one that you are looking for) with following steps.
Feel free to reach out if you have any other question!
from optimum.
@JingyaHuang I opened a PR here! Excited to get to the quantizing once this makes its way into main. Or is there a way I can begin that work using my local copy of transformers?
from optimum.
@sam-h-bean Sure, feel free to test ORTQuantizer
with your copy of transformers, I can also add the support of DeBERTa-V2 for ORTOptimizer
in case you want to do some graph optimizations.
from optimum.
Closed as completed.
P.S. As DeBERTa tokenizers output token_type_ids
by default and ORT doesn't take invalid inputs, token_type_ids
should be removed from inputs before inference.
tokenizer = {processor_class}.from_pretrained("{checkpoint}")
model = {model_class}.from_pretrained("{checkpoint}")
-inputs = tokenizer("Optimum is nice.", return_tensors="pt")
+inputs = tokenizer("Optimum is nice.", return_tensors="pt", return_token_type_ids=False)
outputs = model(**inputs)
And for pipeline API, we are working on taking these edge cases into consideration.
from optimum.
I am getting Exception: Incomplete symbolic shape inference
when optimizing DeBERTaV2 with fp16(AutoOptimizationConfig.O4(for_gpu=True)
). Do I need to disable specific fusion?
from optimum.
@ice-americano Hi, could you open a new issue to track down this problem? Thanks a lot!
from optimum.
Related Issues (20)
- Unable to Export Whisper-Large-V3 Model to ONNX Format in Optimum HOT 1
- Unable to Export Chatglm3 Model to ONNX Format in Optimum HOT 2
- Support Llava ONNX export HOT 1
- Issue Report: Unable to Export Gemma 7b Model to ONNX Format in Optimum HOT 1
- AttributeError: '_ORTModelForWhisper' object has no attribute '_retrieve_segment'
- Request for ONNX Export Support for Blip Model in Optimum
- Idefics2 Support in Optimum for ONNX export HOT 4
- Support Transformers >=4.40.0 HOT 2
- Phi3 support HOT 2
- The transformation of the model Blip2ForConditionalGeneration to BetterTransformer failed
- Llama 3 Support
- Pushing to the hub with a token
- Quantizing from cli using config file fails
- why does ORTModelForCausalLM assume new input length is 1 when past_key_values is passed
- Output names magic in recent optimum for onnx export HOT 2
- Support for speech to text models.
- Can't get ORTStableDiffusionPipeline to run on GPU on neither AWS nor GCP fresh instances HOT 1
- [Optimum export ONNX] Bug when export model TrOCR with dtype BF16
- Low performance of THUDM/chatglm3-6b onnx model
- Static Quantization for Seq2Seq models like T5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from optimum.