optimum icon indicating copy to clipboard operation
optimum copied to clipboard

Adding Support For Phi Models

Open dawnik17 opened this issue 1 year ago • 4 comments

Feature request

Adding support for phi models

Motivation

Currently phi models are not supported in bettertransformer. When trying to load a phi model, it raises NotImplemented error with a list of all the other implemented models here.

Your contribution


dawnik17 avatar Jul 07 '24 15:07 dawnik17

Yeah, it would be great if Microsoft Phi3 model can be supported using bettertransformer

Dev4011 avatar Jul 10 '24 07:07 Dev4011

Hi @dawnik17 @Dev4011 Transformers natively support scaled dot product attention operator from pytorch which was previously integrated through bettertransformer: https://github.com/huggingface/transformers/blob/e0dfd7bcaf7ff0723085f23244a755cc2ed92466/src/transformers/models/phi3/modeling_phi3.py#L614

What is not available in Transformers is the support of NestedTensor (or ragged tensor with a single dimension for both batch size/sequence length).

fxmarty avatar Jul 16 '24 13:07 fxmarty

I tried to use the "main_export()" to export a model, it shows the following error:


ValueError: Trying to export a custom model, but could not find as many custom ONNX configs as the number of submodels to export. Please specifiy the fn_get_submodels argument, that should return a dictionary of submodules with as many items as the p


What can be done to resolve this issue?

miaoqiz avatar Jul 18 '24 23:07 miaoqiz

@fxmarty so what is the tentative timeline you are considering for supporting Phi3 models via betterTransformers?

Dev4011 avatar Jul 22 '24 13:07 Dev4011

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.

github-actions[bot] avatar Dec 06 '24 02:12 github-actions[bot]