# Training time not change linearly when changing sample/batch size

**URL:** <https://discuss.ray.io/t/training-time-not-change-linearly-when-changing-sample-batch-size/13653>\
**Category:** Ray Train\
**Created:** [February 6, 2024, 6:14pm UTC](https://discuss.ray.io/t/training-time-not-change-linearly-when-changing-sample-batch-size/13653 "2024-02-06T18:14:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ziqi\_Jiang](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ziqi_jiang/32/4835_2.png) [@Ziqi\_Jiang](https://discuss.ray.io/u/Ziqi_Jiang)\
**Post date:** [February 6, 2024, 6:14pm UTC](https://discuss.ray.io/t/training-time-not-change-linearly-when-changing-sample-batch-size/13653/1 "2024-02-06T18:14:20Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- None: Just asking a question out of curiosity
- Low: It annoys or frustrates me for a moment.
- Medium: It contributes to significant difficulty to complete my task, but I can work around it.
- High: It blocks me to complete my task.

I use ray.data.read\_parquet to load training data (mostly tabular data, a couple of list features, E.g. x1 for 1 sample is [1,2,3,4,5]), and TorchTrainer for training on 1 worker with 1 GPU + 8 CPUs. Serveral observation I have is that:

1. when I double my batch size from 4096 to 8192, the training time doesn’t change while I expected it to be roughly halved.
2. when I use ray.data.read\_parquet(filenames).random\_sample(0.1), the training time doesn’t change while I expected it to be roughly 1/10.  
Is there example or guidance I can look into to understand why and how to improve?
