# Troubles with features in .prepare()

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftroubles-with-features-in-prepare%2F128467%3E%5C
**Category:** 🤗Accelerate\
**Created:** [November 29, 2024, 5:14pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftroubles-with-features-in-prepare%2F128467 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fozoloev)%5C
**Post date:** [November 29, 2024, 5:14pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftroubles-with-features-in-prepare%2F128467%2F1 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [November 30, 2024, 1:52am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftroubles-with-features-in-prepare%2F128467%2F2 "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?
