[ONNX] Support constant, buffer, parameters in ExportedProgram serialization to ONNX tensor #126473
Labels
module: onnx
Related to torch.onnx
onnx-triaged
triaged by ONNX team
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
torch.onnx.dynamo_export currently supports
ExportedProgram
with the help of input adapter to prepend the lifted constant, buffer, and parameters:pytorch/torch/onnx/_internal/io_adapter.py
Line 583 in 796dff7
So the inputs need to be adapted before the onnx model is executed:
pytorch/torch/onnx/_internal/exporter.py
Lines 743 to 750 in 796dff7
However, this temporary workaround should be fixed with actual serialization of the weights and buffers. A potential fix can be serializing the weights and buffers when we save the model to ONNX:
pytorch/torch/onnx/_internal/exporter.py
Lines 1009 to 1032 in 796dff7
Related #126071
Related #126479
The text was updated successfully, but these errors were encountered: