Open guotuofeng opened 8 months ago
Thank you, related to https://github.com/huggingface/optimum/issues/1044 & https://github.com/microsoft/Olive/blob/697948c2a1f7fe938609e1c97060d17f255c322e/olive/passes/onnx/optimum_merging.py#L44-L49
This is a bug in ModelProto.ByteSize() on Windows only.
As a workaround, can you try: python -m optimum.exporters.onnx -m microsoft/phi-2 --library-name transformers . --no-post-process
It would be great if you can open an issue at https://github.com/onnx/onnx sharing the onnx model there, and with a small reproduction like
import onnx
model = onnx.load(model_path)
print(model.ByteSizes())
Thanks for the info. Just create the issue in ONNX repo.
How do you use ByteSize()? Maybe we can implement a function which returns the result you build with it. I don't think protobuf will update its API since it is not meant to support models bigger than 2Gb.
The other option is to export the model with external weights enabled. A new API https://onnx.ai/onnx/api/model_container.html was introduced to make it easier to build such model with external weights without serialization of the weights. That would be the direction I would recommend.
System Info
Who can help?
No response
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction (minimal, reproducible, runnable)
run the following command:
The following errors will be raised.![image](https://github.com/huggingface/optimum/assets/817030/2cc28d5a-1f65-4b11-bb6a-72339d9d6575)
I made one line print in graph_transformations.py.![image](https://github.com/huggingface/optimum/assets/817030/e3266b8c-f6b0-4473-980d-d84dcac64f2b)
Expected behavior
We might need add the following checks?![image](https://github.com/huggingface/optimum/assets/817030/64f82851-fc3d-4c82-b689-6d5d414f0381)
Just not sure why the model.ByteSizes() return -1765569341