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

Cuda Out of memory with DKMPalettizer #2172

Open
coleridge72 opened this issue Mar 18, 2024 · 1 comment
Open

Cuda Out of memory with DKMPalettizer #2172

coleridge72 opened this issue Mar 18, 2024 · 1 comment
Labels
ct.optimize Question/issue related to the coremltool's optimization package question Response providing clarification needed. Will not be assigned to a release. (type)

Comments

@coleridge72
Copy link

❓Question

I'm trying to run training-time palletization with n_bits=4.
I always get an out-of-memory error on the first step (despite reducing batch size down to one.)

A few details:

  • I'm quantising the stable diffusion v1.5 model.
  • I have 24GB of GPU RAM.

Are there any tips to avoid this?

    config = DKMPalettizerConfig(global_config=ModuleDKMPalettizerConfig(n_bits=4))
    palettizer = DKMPalettizer(unet, config)
    unet = palettizer.prepare(inplace=True)
    unet, optimizer, lr_scheduler = accelerator.prepare(unet, optimizer, lr_scheduler)
@coleridge72 coleridge72 added the question Response providing clarification needed. Will not be assigned to a release. (type) label Mar 18, 2024
@YifanShenSZ YifanShenSZ added the ct.optimize Question/issue related to the coremltool's optimization package label Mar 18, 2024
@YifanShenSZ
Copy link
Collaborator

@pulkital Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ct.optimize Question/issue related to the coremltool's optimization package question Response providing clarification needed. Will not be assigned to a release. (type)
Projects
None yet
Development

No branches or pull requests

2 participants