# Uploading a space on paid GPU's

**URL:** <https://discuss.huggingface.co/t/uploading-a-space-on-paid-gpus/158076>\
**Category:** Spaces\
**Created:** [June 5, 2025, 6:10am UTC](https://discuss.huggingface.co/t/uploading-a-space-on-paid-gpus/158076 "2025-06-05T06:10:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kunaldigi](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kunaldigi](https://discuss.huggingface.co/u/kunaldigi)\
**Post date:** [June 5, 2025, 6:10am UTC](https://discuss.huggingface.co/t/uploading-a-space-on-paid-gpus/158076/1 "2025-06-05T06:10:28Z")

</div>

I tried to duplicate the space “ameerazam08/FLUX.1-dev-Inpainting-Model-Beta-GPU” on a paid gpu provided by hugging face every time i am getting the memory issue, when i do the same using the zerogpu it get’s done only with the paid gpu such issue arises. I tried on Nvidia T4 Small,Nvidia T4 Medium,Nvidia 1\*L4,Nvidia A10G Small, Nvidia A10G LArge.

---

<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:** [June 5, 2025, 9:05am UTC](https://discuss.huggingface.co/t/uploading-a-space-on-paid-gpus/158076/2 "2025-06-05T09:05:02Z")

</div>

That space uses FLUX without quantization, so it requires approximately 35+ GB of VRAM. In the Zero GPU Space, up to 40 GB of VRAM is available in the old version, and up to 70 GB in the new version. Therefore, to reproduce this in a metered GPU Space, at least an L40S is required.  
Alternatively, you could quantize the model to save VRAM, but it seems like the code was written specifically for Diffusers before quantization was supported.

> **[Using GPU Spaces](https://huggingface.co/docs/hub/spaces-gpus)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> **[@cbensimon on Hugging Face: "🚀 ZeroGPU \`medium\` size is now available as a...](https://huggingface.co/posts/cbensimon/356529804559377)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

---

<div class="post-metadata">

**Author:** ![kunaldigi](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kunaldigi](https://discuss.huggingface.co/u/kunaldigi)\
**Post date:** [June 5, 2025, 12:07pm UTC](https://discuss.huggingface.co/t/uploading-a-space-on-paid-gpus/158076/3 "2025-06-05T12:07:10Z")

</div>

Do you think i should apply quantization upon it before uploading it

---

<div class="post-metadata">

**Author:** ![kunaldigi](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kunaldigi](https://discuss.huggingface.co/u/kunaldigi)\
**Post date:** [June 5, 2025, 12:48pm UTC](https://discuss.huggingface.co/t/uploading-a-space-on-paid-gpus/158076/4 "2025-06-05T12:48:52Z")

</div>

Actually i tried till

### Nvidia 4xL40S

- 48 vCPU
- •
- 382 GB RAM
- •
- 192 GB VRAM

But always getting this error:-  
torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 36.00 MiB. GPU 0 has a total capacity of 44.40 GiB of which 24.31 MiB is free. Including non-PyTorch memory, this process has 44.37 GiB memory in use. Of the allocated memory 43.94 GiB is allocated by PyTorch, and 19.30 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH\_CUDA\_ALLOC\_CONF=expandable\_segments:True to avoid fragmentation. See documentation for Memory Management ([CUDA semantics — PyTorch 2.9 documentation](https://pytorch.org/docs/stable/notes/cuda.html#environment-variables))

---

<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:** [June 6, 2025, 4:02am UTC](https://discuss.huggingface.co/t/uploading-a-space-on-paid-gpus/158076/5 "2025-06-06T04:02:51Z")

</div>

That’s strange. PyTorch has allocated more than 43 GB of VRAM, but the program is trying to allocate even more VRAM. The program should only need about 38 GB of VRAM for the model alone…  
Of course, it may need a little more VRAM during inference.

I wonder where it’s consuming so much…

> Do you think i should apply quantization upon it before uploading it

No, you can save VRAM by quantizing on the fly within the code rather than during upload.

However, in the case of this program, there are several pieces of custom code outside of Diffusers, so quantization is not recommended due to the effort required to rewrite the code.
