Open guotuofeng opened 10 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.
I made one line print in graph_transformations.py.
Expected behavior
We might need add the following checks?
Just not sure why the model.ByteSizes() return -1765569341