# Constrain device map to GPUs

**URL:** <https://discuss.huggingface.co/t/constrain-device-map-to-gpus/32444>\
**Category:** 🤗Accelerate\
**Created:** [February 24, 2023, 1:31pm UTC](https://discuss.huggingface.co/t/constrain-device-map-to-gpus/32444 "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](https://discuss.huggingface.co/u/MultiModal)\
**Post date:** [February 24, 2023, 1:31pm UTC](https://discuss.huggingface.co/t/constrain-device-map-to-gpus/32444/1 "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.
