Giter Club home page Giter Club logo

Comments (6)

JingyaHuang avatar JingyaHuang commented on May 13, 2024 3

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.

sam-h-bean avatar sam-h-bean commented on May 13, 2024

@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.

JingyaHuang avatar JingyaHuang commented on May 13, 2024

@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.

JingyaHuang avatar JingyaHuang commented on May 13, 2024

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.

caffeinetoomuch avatar caffeinetoomuch commented on May 13, 2024

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.

fxmarty avatar fxmarty commented on May 13, 2024

@ice-americano Hi, could you open a new issue to track down this problem? Thanks a lot!

from optimum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.