Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The VAE model of SDXL, after being compiled with TensorRT, shows that VAE requires 12GB of GPU memory when loaded #3749

Open
lqfool opened this issue Mar 28, 2024 · 1 comment
Labels
triaged Issue has been triaged by maintainers

Comments

@lqfool
Copy link

lqfool commented Mar 28, 2024

Description

I saw that in the official demo of SDXL, VAE was not compiled. However, when I converted VAE to plan format, the size was 98.22MB. But after loading VAE and using device_memory_size to check the VRAM usage, it showed 12079599616 bytes, which means I don't have enough VRAM to load the entire model.

Environment

TensorRT Version:9.2/9.3

NVIDIA GPU:RTX 4080

NVIDIA Driver Version:535.161.07

CUDA Version:12.2

CUDNN Version:

Operating System:Ubuntu 22.04.3 LTS

Python Version (if applicable):3.10

Tensorflow Version (if applicable):

PyTorch Version (if applicable):2.1.0

Baremetal or Container (if so, version):

Relevant Files

Model link:https://huggingface.co/stabilityai/stable-diffusion-xl-1.0-tensorrt

Steps To Reproduce

Commands or scripts:

Have you tried the latest release?:Yes

Can this model run on other frameworks? For example run ONNX model with ONNXRuntime (polygraphy run <model.onnx> --onnxrt):

@lix19937
Copy link

lix19937 commented Apr 2, 2024

An engine, on deserialization, allocates device memory to store the model weights. Since the serialized engine is almost all weights, its size is a good approximation to the amount of device memory the weights require. You can calc you VAE model weights memory.

@zerollzeng zerollzeng added the triaged Issue has been triaged by maintainers label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Issue has been triaged by maintainers
Projects
None yet
Development

No branches or pull requests

3 participants