# What is the recommend serialization format when considering the upcoming pt2?

**URL:** <https://discuss.pytorch.org/t/what-is-the-recommend-serialization-format-when-considering-the-upcoming-pt2/173655>\
**Category:** deployment\
**Created:** [February 28, 2023, 6:11am UTC](https://discuss.pytorch.org/t/what-is-the-recommend-serialization-format-when-considering-the-upcoming-pt2/173655 "2023-02-28T06:11:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yushu.gao](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/yushu.gao/32/50534_2.png) [@yushu.gao](https://discuss.pytorch.org/u/yushu.gao)\
**Post date:** [February 28, 2023, 6:11am UTC](https://discuss.pytorch.org/t/what-is-the-recommend-serialization-format-when-considering-the-upcoming-pt2/173655/1 "2023-02-28T06:11:01Z")

</div>

There are two serialization format: torchscript and onnx.

torchscript seems will be deprecated in the long term: [The nuances of PyTorch Graph Capture - #9 by penguinwu - compiler - PyTorch Dev Discussions](https://dev-discuss.pytorch.org/t/the-nuances-of-pytorch-graph-capture/501/9?u=shuokay), and after using torchscript for a period of time, we found that torchscript is not easy to use.

ONNX has a relatively larger number of users, but onnx can’t be loaded and run by torch directly, which lead to potential numeric issues.

My question is: is there a new serialization format in pt2? If not, which format you guys recommend for model serialization?

---

<div class="post-metadata">

**Author:** ![marksaroufim](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/marksaroufim/32/36747_2.png) [@marksaroufim](https://discuss.pytorch.org/u/marksaroufim)\
**Post date:** [March 9, 2023, 8:19pm UTC](https://discuss.pytorch.org/t/what-is-the-recommend-serialization-format-when-considering-the-upcoming-pt2/173655/2 "2023-03-09T20:19:34Z")

</div>

We’re still working on this but I’ll reach out again in a few months to provide an update if possible
