# Troubles with features in .prepare()

**URL:** <https://discuss.huggingface.co/t/troubles-with-features-in-prepare/128467>\
**Category:** 🤗Accelerate\
**Created:** [November 29, 2024, 5:14pm UTC](https://discuss.huggingface.co/t/troubles-with-features-in-prepare/128467 "2024-11-29T17:14:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ozoloev](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ozoloev/32/35989_2.png) [@ozoloev](https://discuss.huggingface.co/u/ozoloev)\
**Post date:** [November 29, 2024, 5:14pm UTC](https://discuss.huggingface.co/t/troubles-with-features-in-prepare/128467/1 "2024-11-29T17:14:09Z")

</div>

I just have a torch dataloader and do multi gpu inference with accelerate. In loader I have a 3 fields: input\_ids, attention\_mask and user\_ids, so, after get\_inference\_dataset this features still in loader, but after .prepare, I don’t have user\_ids filed, only ids and mask.

inference\_loader = get\_inference\_dataset(config, tokenizer)  
print(next(iter(inference\_loader))[“user\_ids”])  
inference\_loader = accelerator.prepare\_data\_loader(inference\_loader)  
print(next(iter(inference\_loader))[“user\_ids”])

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [November 30, 2024, 1:52am UTC](https://discuss.huggingface.co/t/troubles-with-features-in-prepare/128467/2 "2024-11-30T01:52:54Z")

</div>

This seems to happen because of **drop\_last=True**. I don’t know if this is the case.

> <https://github.com/huggingface/accelerate/issues/2316>
>
> In \[tutorial\](https://huggingface.co/docs/accelerate/quicktour), it is mentioned… that \`Some data at the end of the dataset may be duplicated so the batch can be divided equally among all workers.\` So if my train dataset size cannot divided by the #gpus, dataloader after prepare() will include duplicated data during training? Won't this property affect model performance(loss etc.) since it includes more data in train dataset? If it will cause a large difference, is there any method to not include these duplicated data in calculating loss?
