NVIDIA / NVIDIA/Model-Optimizer

Quant Flux-dev OOM on L20

Open
#72 6 comments 0 reactions 1 assignee View on GitHub

@jingyu-ml is already working on this.

Since Oct 23, 2024.

bug investigating model support torch.quantization
Dominant language
Python
Stars
3.8k
Forks
604
Avg merge
2d 6h
Merged PRs (30d)
138

Description

How many GPU memory will be used to quant flux-dev ?
Can be offload to cpu when not enough GPU memory ?

The following part of your input was truncated because CLIP can only handle sequences up to 77 tokens: ['station']
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:19<00:00, 1.01it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:19<00:00, 1.01it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:19<00:00, 1.01it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:19<00:00, 1.01it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:19<00:00, 1.01it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:19<00:00, 1.01it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:19<00:00, 1.01it/s]
Traceback (most recent call last):
File "/cv/TensorRT-Model-Optimizer/diffusers/quantization/quantize.py", line 239, in
main()
File "/cv/TensorRT-Model-Optimizer/diffusers/quantization/quantize.py", line 234, in main
backbone.to("cuda")
File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1174, in to
return self._apply(convert)
File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 780, in _apply
module._apply(fn)
File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 780, in _apply
module._apply(fn)
File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 780, in _apply
module._apply(fn)
File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 805, in _apply
param_applied = fn(param)
File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1160, in convert
return t.to(
torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 90.00 MiB. GPU 0 has a total capacity of 44.32 GiB of which 65.25 MiB is free. Including non-PyTorch memory, this process has 0 bytes memory in use. Of the allocated memory 43.87 GiB is allocated by PyTorch, and 41.57 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 (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)
/usr/lib/python3.10/tempfile.py:999: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/tmp0_xw28ay'>
_warnings.warn(warn_message, ResourceWarning)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.