# Huge overhead when using torch.jit.trace

**URL:** <https://discuss.pytorch.org/t/huge-overhead-when-using-torch-jit-trace/49493>\
**Category:** Uncategorized\
**Created:** [July 2, 2019, 2:15pm UTC](https://discuss.pytorch.org/t/huge-overhead-when-using-torch-jit-trace/49493 "2019-07-02T14:15:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![coderinuse](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/c/a5b964/32.png) [@coderinuse](https://discuss.pytorch.org/u/coderinuse)\
**Post date:** [July 2, 2019, 2:15pm UTC](https://discuss.pytorch.org/t/huge-overhead-when-using-torch-jit-trace/49493/1 "2019-07-02T14:15:34Z")

</div>

Hi, I’m trying to serialize my model using `TorchScript`. Since there is no control flow in the module, I have decided to just `trace` the module. But when I profile the script I see the weird picture (Profiling is done in sync mode `CUDA_LAUNCH_BLOCKING=1`):

 ![image](https://discuss.pytorch.org/uploads/default/original/2X/e/e98be0c025e6030c000e9f3530b0fb5b7f826fe1.png)

Overall running time has been increased and there is a huge overhead when calling the ` __call__ ` method. What is the cause of the issue? In my big model I have only traced one module and there are subsequent modules following it.

The module that I’m trying to serialize is the Pose ResNet.
