# Accelerate device\_map for 🧨.from\_pretrained

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Faccelerate-device-map-for-from-pretrained%2F24402%3E%5C
**Category:** 🧨 Diffusers\
**Created:** [October 13, 2022, 9:51pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Faccelerate-device-map-for-from-pretrained%2F24402 "2022-10-13T21:51:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![keturn](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/keturn/32/18215_2.png) [@keturn](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fketurn)%5C
**Post date:** [October 13, 2022, 9:51pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Faccelerate-device-map-for-from-pretrained%2F24402%2F1 "2022-10-13T21:51:39Z")

</div>

I see [Diffusers#772](https://github.com/huggingface/diffusers/pull/772 "[Low CPU memory] + device map") was included with today’s diffusers release, which means I should be able to pass some kind of `device_map` when I construct the pipeline and direct which device each submodel is loaded on, right?

But I’ve got `device_map=dict(unet='cuda')` and am running in to errors that indicate it’s trying to run the unet on CPU.

It may be that `unet` is not the right key? I’ve seen some indication that the text encoder might be `text_model`, and not `text_encoder` as I expected from the way the submodels are named in model\_index.json.

How do I see what names it knows things by?
