coremltools icon indicating copy to clipboard operation
coremltools copied to clipboard

Cuda Out of memory with DKMPalettizer

Open coleridge72 opened this issue 11 months ago • 1 comments

❓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 avatar Mar 18 '24 18:03 coleridge72

@pulkital Any thoughts?

YifanShenSZ avatar Mar 18 '24 19:03 YifanShenSZ