Commit 96615bd9 authored by muyangli's avatar muyangli
Browse files

[minor] update README

parent 22165459
# Nunchaku
<div align="center" id="nunchaku_logo">
<img src="assets/nunchaku.svg" alt="logo" width="220"></img>
</div>
<h4 align="center">
<a href="http://arxiv.org/abs/2411.05007"><b>Paper</b></a> | <a href="https://hanlab.mit.edu/projects/svdquant"><b>Website</b></a> | <a href="https://hanlab.mit.edu/blog/svdquant"><b>Blog</b></a> | <a href="https://svdquant.mit.edu"><b>Demo</b></a> | <a href="https://huggingface.co/collections/mit-han-lab/svdquant-67493c2c2e62a1fc6e93f45c"><b>HuggingFace</b></a> | <a href="https://modelscope.cn/collections/svdquant-468e8f780c2641"><b>ModelScope</b></a>
</h4>
Nunchaku is an inference engine designed for 4-bit diffusion models, as demonstrated in our paper [SVDQuant](http://arxiv.org/abs/2411.05007). Please check [DeepCompressor](https://github.com/mit-han-lab/deepcompressor) for the quantization library.
**Nunchaku** is an efficient inference engine designed for 4-bit diffusion models, as demonstrated in our paper [SVDQuant](http://arxiv.org/abs/2411.05007). Please check [DeepCompressor](https://github.com/mit-han-lab/deepcompressor) for the quantization library.
Check [here](https://github.com/mit-han-lab/nunchaku/issues/149) to join our user groups on [**Slack**](https://join.slack.com/t/nunchaku/shared_invite/zt-3170agzoz-NgZzWaTrEj~n2KEV3Hpl5Q) and [**WeChat**](./assets/wechat.jpg) for discussions! If you have any questions, encounter issues, or are interested in contributing to the codebase, feel free to share your thoughts there!
### [Paper](http://arxiv.org/abs/2411.05007) | [Project](https://hanlab.mit.edu/projects/svdquant) | [Blog](https://hanlab.mit.edu/blog/svdquant) | [Demo](https://svdquant.mit.edu) | [HuggingFace](https://huggingface.co/collections/mit-han-lab/svdquant-67493c2c2e62a1fc6e93f45c) | [ModelScope](https://modelscope.cn/collections/svdquant-468e8f780c2641)
## News
- **[2025-03-11]** **🚀 Release [4-bit Shuttle-Jaguar](https://huggingface.co/mit-han-lab/svdq-int4-shuttle-jaguar)!** Check the INT4 models in our [HuggingFace](https://huggingface.co/collections/mit-han-lab/svdquant-67493c2c2e62a1fc6e93f45c) or [ModelScope](https://modelscope.cn/collections/svdquant-468e8f780c2641) collections! FP4 models are coming soon!
- **[2025-03-07]** 🚀 **Nunchaku v0.1.4 Released!** We've supported [4-bit text encoder and per-layer CPU offloading](#Low-Memory-Inference), reducing FLUX's minimum memory requirement to just **4 GiB** while maintaining a **2–3× speedup**. This update also fixes various issues related to resolution, LoRA, pin memory, and runtime stability. Check out the release notes for full details!
......@@ -19,6 +24,8 @@ Check [here](https://github.com/mit-han-lab/nunchaku/issues/149) to join our use
- **[2024-12-08]** Support [ComfyUI](https://github.com/comfyanonymous/ComfyUI). Please check [comfyui/README.md](comfyui/README.md) for the usage.
- **[2024-11-07]** 🔥 Our latest **W4A4** Diffusion model quantization work [**SVDQuant**](https://hanlab.mit.edu/projects/svdquant) is publicly released! Check [**DeepCompressor**](https://github.com/mit-han-lab/deepcompressor) for the quantization library.
## Overview
![teaser](./assets/teaser.jpg)
SVDQuant is a post-training quantization technique for 4-bit weights and activations that well maintains visual fidelity. On 12B FLUX.1-dev, it achieves 3.6× memory reduction compared to the BF16 model. By eliminating CPU offloading, it offers 8.7× speedup over the 16-bit model when on a 16GB laptop 4090 GPU, 3× faster than the NF4 W4A16 baseline. On PixArt-∑, it demonstrates significantly superior visual quality over other W4A4 or even W4A8 baselines. "E2E" means the end-to-end latency including the text encoder and VAE decoder.
......
<?xml version="1.0" encoding="UTF-8"?>
<svg id="_图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 615.33 400.63">
<defs>
<style>
.cls-1 {
fill: none;
stroke: #000;
stroke-miterlimit: 10;
stroke-width: 3px;
}
</style>
</defs>
<path d="M301.98,224.05v6.99c0,.08-.07.15-.15.15-.02,0-.05-.01-.07-.02-4.77-2.33-8.7-2.55-11.8-.66-2.03,1.24-2.95,3.14-2.75,5.69.35,4.62,4.51,6.37,8.62,5.94,2.41-.25,4.77-.94,7.1-2.06.03-.02.07,0,.09.04.01.01.01.02.01.04l-1.06,7.32c-.01.11-.09.2-.19.24-6.76,2.69-15.5,2.22-20.62-3.08-2.7-2.8-3.88-6.14-3.54-10.02,1.02-11.97,15.05-14.64,24.16-10.88.12.06.2.18.2.31Z"/>
<path d="M179.4,238.18c-.53-.62-1.01-1.17-1.43-1.63-.05-.06-.14-.07-.2-.02-.04.03-.05.07-.05.12v11.66c0,.22-.18.39-.39.39h-7.82c-.27,0-.49-.22-.49-.49h0v-25.14c0-.18.15-.33.33-.33h6.72c.25,0,.49.1.65.29,3.56,4.13,6.49,7.54,8.79,10.23.53.62,1.01,1.17,1.43,1.63.06.05.14.06.2.01.03-.02.04-.06.04-.09v-11.66c0-.22.18-.39.39-.39h7.82c.27,0,.49.22.49.49h0v25.14c0,.18-.15.33-.33.33h-6.72c-.25,0-.49-.11-.65-.3-3.55-4.13-6.48-7.54-8.78-10.24Z"/>
<path d="M219.09,249.35c-4.85,0-9.51-1.26-11.85-5.78-.82-1.57-1.21-4.27-1.17-8.08.04-4.81.05-8.9.02-12.27,0-.26.21-.48.47-.48h8.66c.18,0,.33.15.33.33h0v15.01c0,2.72.45,4.85,3.54,4.85s3.54-2.13,3.54-4.85v-15c0-.18.15-.33.33-.33h8.65c.26,0,.48.21.48.48h0c-.02,3.38-.02,7.47.02,12.28.03,3.81-.36,6.5-1.17,8.08-2.34,4.5-7.01,5.76-11.85,5.76Z"/>
<path d="M252.65,238.18c-.53-.62-1.01-1.17-1.43-1.63-.05-.06-.14-.07-.2-.02-.03.03-.05.07-.05.11v11.66c.01.22-.17.39-.38.39h-7.82c-.27,0-.49-.22-.49-.49h0v-25.13c-.01-.18.14-.33.32-.33h6.72c.25,0,.49.11.65.3,3.56,4.13,6.5,7.53,8.8,10.22.53.62,1,1.17,1.43,1.63.06.05.14.06.2.01.03-.02.04-.06.04-.09v-11.66c0-.22.18-.39.39-.39h7.81c.27,0,.49.22.49.49h0v25.13c.01.18-.14.33-.32.33h-6.71c-.25,0-.49-.11-.65-.3-3.57-4.14-6.5-7.55-8.8-10.23Z"/>
<path d="M324.85,232.25c1.89,0,2.99-.01,3.29-.04.27-.02.48-.25.48-.52v-8.53c0-.23.19-.42.42-.42h8.33c.25,0,.46.21.46.46v25.04c0,.25-.2.45-.45.45h-8.37c-.21,0-.39-.17-.39-.39h0v-9.16c0-.28-.22-.5-.49-.5h-6.54c-.27,0-.49.23-.49.5v9.16c0,.21-.17.39-.39.39h-8.37c-.25,0-.45-.2-.45-.45v-25.04c0-.25.21-.46.46-.46h8.32c.23,0,.42.19.42.42v8.53c0,.27.21.5.48.52.3.02,1.39.04,3.28.04Z"/>
<path d="M356.45,222.74h7.12c.11,0,.2.06.24.16l11.48,25.41c.06.13,0,.29-.13.35-.04.02-.07.02-.11.02h-9c-.11,0-.2-.06-.24-.16l-1.88-4.16c-.04-.1-.14-.16-.24-.16h-7.99c-.11,0-.2.06-.24.16l-1.94,4.16c-.04.1-.14.16-.24.16h-8.67c-.15,0-.27-.12-.27-.27,0-.04.01-.08.02-.11l11.86-25.4c.03-.1.13-.16.23-.16ZM362.51,236.66c.01-1.34-1.17-2.44-2.64-2.45h0c-1.47-.01-2.67,1.06-2.68,2.4h0c-.01,1.34,1.17,2.44,2.64,2.45h0c1.47.02,2.67-1.06,2.68-2.4h0Z"/>
<path d="M398.57,248.59l-7.1-9.93c-.08-.1-.22-.12-.32-.05-.06.04-.09.11-.09.18v9.66c0,.13-.1.23-.23.23h-8.65c-.13,0-.23-.1-.23-.23v-25.48c0-.13.1-.23.23-.23h8.66c.13,0,.23.1.23.23h0v8.64c0,.13.1.23.23.24.08,0,.15-.03.19-.09l6.91-8.92c.04-.06.11-.09.18-.09h10.63c.13,0,.23.11.23.24,0,.05-.02.1-.05.14l-10.3,11.74c-.07.09-.07.21,0,.3l10.85,13.14c.08.1.07.24-.03.32-.04.04-.1.05-.15.05h-11.01c-.07.01-.14-.03-.18-.09Z"/>
<path d="M429.81,242.92c3.09,0,3.54-2.12,3.54-4.85v-15c0-.18.15-.33.33-.33h8.65c.26,0,.48.21.48.48h0c-.02,3.38-.02,7.47.02,12.28.03,3.81-.36,6.5-1.17,8.08-2.34,4.53-7,5.78-11.85,5.78s-9.51-1.25-11.85-5.78c-.82-1.57-1.21-4.27-1.17-8.08.04-4.81.05-8.9.02-12.27,0-.26.21-.48.47-.48h8.66c.18,0,.33.15.33.33v15c0,2.72.45,4.84,3.54,4.84Z"/>
<g>
<g>
<path d="M589.16,308.22l-57.65,27.85c-46.82-98.7-120.32-252.7-122.46-256.81-1.6-3.04-6.3-15.58-6.3-15.58l48.17-23.06c.27-.25.69-.25.94.02.04.06.08.11.11.17,13.28,26.25,108.65,210.5,109.59,212.41,2.86,5.62,14.76,29.4,27.6,55Z"/>
<path d="M595,319.87l-57.9,28c-1.07-2.2-2.12-4.47-3.21-6.76l57.78-27.89c1.12,2.22,2.23,4.45,3.33,6.65Z"/>
<path d="M600.83,331.52l-58.17,28.1c-1.05-2.2-2.12-4.43-3.21-6.72l58.05-28.04c1.13,2.23,2.24,4.45,3.33,6.66Z"/>
<path d="M606.66,343.17l-58.45,28.25c-1.03-2.2-2.1-4.45-3.19-6.76l58.3-28.16c1.14,2.26,2.25,4.48,3.34,6.67Z"/>
<path d="M597.98,396.58l-.82.44c-16.18,8.37-36.08,1.66-43.84-14.82-.88-1.87-1.78-3.78-2.73-5.75l58.57-28.29c.94,1.89,1.87,3.74,2.77,5.52,7.87,15.72,1.64,34.82-13.95,42.9Z"/>
</g>
<path d="M449.99,37.08l-48.95,23.67c-.9-1.86-1.79-3.78-2.71-5.71l48.85-23.58c.95,1.87,1.89,3.75,2.81,5.62Z"/>
<path d="M445.91,28.87l-48.95,23.67c-.9-1.86-1.79-3.78-2.71-5.71l48.85-23.58c.95,1.88,1.89,3.76,2.81,5.62Z"/>
<path d="M442.18,21.07l-48.95,23.67c-.9-1.86-1.79-3.78-2.71-5.71l48.85-23.58c.94,1.87,1.88,3.75,2.81,5.62Z"/>
<rect x="404.11" y="18.43" width="19.12" height="13.96" transform="translate(27.81 176.68) rotate(-24.92)"/>
</g>
<g>
<g>
<path d="M26.18,308.22l57.65,27.85c46.82-98.7,120.32-252.7,122.46-256.81,1.6-3.04,6.3-15.58,6.3-15.58l-48.17-23.06c-.27-.25-.69-.25-.94.02-.04.06-.08.11-.11.17-13.29,26.26-108.65,210.5-109.59,212.41-2.86,5.62-14.76,29.4-27.6,55Z"/>
<path d="M20.34,319.87l57.9,28c1.07-2.2,2.12-4.47,3.21-6.76l-57.78-27.89c-1.12,2.22-2.23,4.45-3.33,6.65Z"/>
<path d="M14.51,331.52l58.17,28.1c1.05-2.2,2.12-4.43,3.21-6.72l-58.05-28.04c-1.13,2.23-2.24,4.45-3.33,6.66Z"/>
<path d="M8.68,343.17l58.45,28.25c1.03-2.2,2.1-4.45,3.19-6.76l-58.3-28.16c-1.14,2.26-2.25,4.48-3.34,6.67Z"/>
<path d="M17.36,396.58l.82.44c16.18,8.37,36.08,1.66,43.84-14.82.88-1.87,1.78-3.78,2.73-5.75l-58.57-28.29c-.94,1.89-1.87,3.74-2.77,5.52-7.87,15.72-1.64,34.82,13.95,42.9Z"/>
</g>
<path d="M165.35,37.08l48.95,23.67c.9-1.86,1.79-3.78,2.71-5.71l-48.85-23.58c-.95,1.87-1.89,3.75-2.81,5.62Z"/>
<path d="M169.43,28.87l48.95,23.67c.9-1.86,1.79-3.78,2.71-5.71l-48.85-23.58c-.95,1.88-1.89,3.76-2.81,5.62Z"/>
<path d="M173.16,21.07l48.95,23.67c.9-1.86,1.79-3.78,2.71-5.71l-48.85-23.58c-.94,1.87-1.88,3.75-2.81,5.62Z"/>
<rect x="194.69" y="15.84" width="13.96" height="19.12" transform="translate(93.65 197.59) rotate(-65.08)"/>
</g>
<path d="M418.39,22.56c-.9-2.12-3.08-3.99-2.86-6.3.6-6.24-1.96-9.26-5.87-10.8-5.59-2.76-10.79-2.48-15.59.89-5.16,3.63-6.9,8.92-5.88,15.06-3.44,1.79-6.77,3.46-10.03,5.27-1.04.58-1.67.45-2.57-.24-4.36-3.31-9.77-3.35-14.45-.38-2.92,1.85-5.92,3.61-8.99,5.2-4.67,2.41-8.51,5.37-9.23,11.06-.06.44-.81,1.01-1.34,1.15-2.64.72-5.32,1.29-7.97,1.98-1.09.28-1.8-.03-2.5-.87-3.33-4.01-7.59-5.28-12.62-4.14-3.55.8-7.1,1.63-10.65,2.41-4.53.99-8.9,2.23-11.5,6.61-.14.23-.76.32-1.12.26-3.14-.54-6.26-1.14-9.44-1.73-.4-4.66-2.91-7.77-6.66-10.13-3.81-2.39-7.54-4.92-11.29-7.41-2.5-1.65-5.47-2.9-8.14-1.91-3.92,1.46-5.66-.68-7.62-3.11-.53-.65-1.1-1.28-1.71-1.87-.91-.89-1.15-1.7-.63-3.04,2.56-6.58-1.25-14.13-8-16.06-4.78-1.36-9.57-2.67-14.37-3.94-6.58-1.74-12.14.91-14.99,7.05-.24.51-.79,1.18-1.25,1.23-1.63.18-3.26.33-4.89.46.01.52.01,1.04.01,1.56,4.44-1,8.77-1.17,13.19-.6-1.82,1.27-8.29,2.27-13.22,2.36-.04,1.47-.13,2.95-.23,4.43,4.6-.4,9.19-.79,13.79-1.19.01.08.02.15.03.23-2.2.7-4.39,1.39-6.62,2.09,1.3,2.68,3.69,4.83,6.67,5.69,5.33,1.55,10.69,3.06,16.09,4.37,1.72.42,3.61.13,5.84.18-1.34-2.39-2.39-4.26-3.44-6.13l.3-.23c5.72,6.3,11.43,12.61,17.15,18.91-.06.07-.12.13-.18.2-2.04-1.41-4.09-2.82-6.2-4.27-1.71,5.48.04,10.66,4.66,13.84,4.3,2.96,8.67,5.81,13.05,8.64,5.02,3.25,12.27,1.96,15.19-2.14-2.16-.92-4.3-1.83-6.44-2.74.05-.15.11-.3.16-.45,6.02,1.12,12.04,2.21,18.04,3.4.43.09.91.85,1.05,1.39,1.65,6.24,7.78,10.23,14.06,8.93,4.97-1.03,9.89-2.3,14.84-3.41,4.98-1.12,8.06-4.16,9.57-9.25-2.61.09-5,.18-7.4.27l-.02-.24,27-6.51c.05.15.09.31.14.46l-6.85,3.18c3.69,3.77,9.13,4.98,13.57,2.64,5.32-2.8,10.5-5.87,15.62-9.01,2.83-1.74,5.21-6.46,4.49-8.99-2.38.52-4.76,1.04-7.15,1.57-.01-.08-.03-.16-.04-.24l24.55-13.02.16.19c-1.43,1.36-2.86,2.72-4.35,4.14,4.09,3.31,8.57,4.15,13.26,2.79,5.85-1.7,9.32-5.87,10.62-12.29.39.9.81,1.74,1.2,2.55ZM240.66,6.17c2.19-1.05,6.89,2.57,6.7,5.28-2.92-.11-5.18-1.48-7-3.61-.24-.3-.01-1.52.3-1.67ZM236.31,14.54c-1.54,1.54-1.21,3.32.9,6.16-5.49-1.54-10.72-3-15.95-4.46.03-.17.07-.35.1-.52,2.43-.24,5.06-.28,5.67-3.36.39-1.94-.51-3.39-2.17-4.55,2.51.68,5.01,1.35,7.52,2.03,2.26.62,4.57,1.13,6.77,1.94,1.26.46,2.34,1.39,3.48,1.83-1.1-.18-2.23-.61-3.28-.46-1.08.15-2.29.64-3.04,1.39ZM243.02,19.76c3.02.35,11.2,8.77,12.25,12.7-4.84-3.4-8.69-7.74-12.25-12.7ZM271.35,48.21c-.99,2.02-.01,3.61,1.22,5.22-5.37-3.34-10.84-6.47-15.54-10.72.94.54,1.85,1.43,2.84,1.53,1.04.11,2.39-.23,3.21-.87,1.98-1.55,1.71-3.13-.61-7.24,4.91,3.25,9.83,6.5,14.74,9.76-2.44-.05-4.65-.17-5.86,2.32ZM267.38,32.23c4.46,2.84,9.48,4.89,13.41,9.32-2.49.4-12.99-7.11-13.41-9.32ZM284.99,50.83c3.61-1.39,15.07.42,17.7,2.77-5.94.19-11.65-.91-17.7-2.77ZM322.43,48.01c-2.55,1.22-3.64,2.83-3.16,4.68.58,2.26,2.21,3.21,5.16,3.2-6.25,1.93-12.54,3.69-19.16,4.1,2.4-.49,4.56-1.22,4.65-4.09.1-2.89-1.86-4.04-4.44-4.56,5.59-1.28,11.18-2.56,16.76-3.83.06.16.13.33.19.5ZM315.23,43.15c2.4-2.34,6.44-2.95,8.44-1.33-1.16,2.42-6.21,3.29-8.44,1.33ZM333.09,48.29c5.19-3.09,10.81-4.61,16.85-4.57-5.26,2.89-10.96,4.09-16.85,4.57ZM371.58,39.47l-15.81,9.08c-.12-.12-.24-.24-.36-.36,2.07-1.36,3.17-3.17,2.04-5.48-1.15-2.36-3.34-2.39-5.68-1.99,5.35-3.33,10.55-6.82,16.39-9.16-1.98,1.91-2.68,3.81-1.86,5.56.82,1.73,2.46,2.39,5.28,2.35ZM370.85,27.31c-2,.5-4.03.9-6.07,1.18-.43.06-1.37-.52-1.35-.76.03-.55.45-1.12.83-1.59.23-.28.67-.38,1.02-.57v-.42c1.79,0,3.58-.04,5.36.07.42.02.8.55,1.2.84-.33.43-.58,1.15-.99,1.25ZM378.71,29.44c4.29-4.26,9.38-7.12,15.26-8.59-4.37,4.11-9.65,6.64-15.26,8.59ZM391.92,14.77c-.33.39-1.13.37-1.71.54-.13-.58-.44-1.19-.34-1.73.4-2.33,2.42-4.9,4.89-6.03.17,0,.77.02,1.38.03-.03.62.17,1.4-.12,1.83-1.28,1.85-2.65,3.64-4.1,5.36ZM407.84,23.73c-1.86,1.82-5.89,3.26-8.87,1.19.94-1.27,2.06-2.44,2.73-3.83.31-.64-.06-1.82-.47-2.57-1.06-1.94-3.17-2.19-6.12-.83.01-3.35,2.27-5.98,5.73-6.88,3.25-.84,6.83.81,8.56,3.94,1.53,2.76.85,6.6-1.56,8.98Z"/>
<circle class="cls-1" cx="206.14" cy="15.03" r="8.22"/>
</svg>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment