# Constrain device map to GPUs

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fconstrain-device-map-to-gpus%2F32444%3E%5C
**Category:** 🤗Accelerate\
**Created:** [February 24, 2023, 1:31pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fconstrain-device-map-to-gpus%2F32444 "2023-02-24T13:31:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MultiModal](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@MultiModal](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FMultiModal)%5C
**Post date:** [February 24, 2023, 1:31pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fconstrain-device-map-to-gpus%2F32444%2F1 "2023-02-24T13:31:57Z")

</div>

When I load a huge model like T5 xxl pretrained using device\_map set to auto, and torch\_dtype set to float16, it always insists on including my CPU when I have enough GPU ram (48 GB) how do I constrain accelerate to use only my GPUs? I tried setting the device\_map manually with the layers spread over the GPUs but it gave an error.
