# File size vs. batch size for TensorRT serialized engine files

**URL:** <https://forums.developer.nvidia.com/t/file-size-vs-batch-size-for-tensorrt-serialized-engine-files/155860>\
**Category:** TensorRT\
**Tags:** tensorrt\
**Created:** [September 29, 2020, 10:41am UTC](https://forums.developer.nvidia.com/t/file-size-vs-batch-size-for-tensorrt-serialized-engine-files/155860 "2020-09-29T10:41:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![weissrael](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@weissrael](https://forums.developer.nvidia.com/u/weissrael)\
**Post date:** [September 29, 2020, 10:41am UTC](https://forums.developer.nvidia.com/t/file-size-vs-batch-size-for-tensorrt-serialized-engine-files/155860/1 "2020-09-29T10:41:33Z")

</div>

## Description

I converted a model from onnx to a serialized TensorRT engine file, each time with a different explicit batch size. I expected that the bigger the batch size, the bigger the engine file will be- but it turns out to contradict my expectation.  
All exported model files have the same precision (float32) and same “DLA support mode”.  
For example, the file sizes according to batch size:  
Batch size 1 → 280 MB  
Batch size 10 → 247 MB  
Batch size 20 → 182 MB

When I benchmark these engine files using trtexec, the inference times make sense according to the batch size, so it seems it was indeed exported with the wanted batch size.

The main question: What causes the file sizes to be smaller when the batch size became bigger? Is this an “expected behavior”?

## Environment

**TensorRT Version** : 7.1  
**Environment for converting the onnx—\>trt engine:** Jetson Xavier

## Relevant Files

I can’t share the engine models.

---

<div class="post-metadata">

**Author:** ![SunilJB](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/suniljb/32/14043_2.png) [@SunilJB](https://forums.developer.nvidia.com/u/SunilJB)\
**Post date:** [September 30, 2020, 8:19am UTC](https://forums.developer.nvidia.com/t/file-size-vs-batch-size-for-tensorrt-serialized-engine-files/155860/2 "2020-09-30T08:19:50Z")

</div>

DLA support is currently limited to networks running in either FP16 or INT8 mode.  
It is not supported in network with float 32 precision.  
Could you provide logs with `--verbose` enabled in trtexec?

Thanks
