Skip to content

Support SVDQuant#2032

Open
changwangss wants to merge 3 commits into
intel:mainfrom
changwangss:wangchang/svdquant
Open

Support SVDQuant#2032
changwangss wants to merge 3 commits into
intel:mainfrom
changwangss:wangchang/svdquant

Conversation

@changwangss

@changwangss changwangss commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

Add SVDQuant as a pre-quantization transform that works with the existing AutoRound pipeline.

Keeps the residual branch as a normal Linear, so existing RTN / SignRound quantizers can process it with scheme="MXFP4".

API usage:

from auto_round import AutoRound

ar = AutoRound(
    "black-forest-labs/FLUX.1-dev",
    model_type="diffusion",
    scheme="MXFP4",
    algorithm="rtn",
    enable_svdquant=True,
    svdquant_rank=32,
    svdquant_smooth_alpha=0.5,
    disable_opt_rtn=True
)

ar.quantize_and_save("./flux-svdquant-mxfp4-rtn", format="fake")

CLI usage:

auto-round \
  --model black-forest-labs/FLUX.1-dev \
  --model_type diffusion \
  --scheme MXFP4 \
  --algorithm rtn \
  --disable_opt_rtn \
  --enable_svdquant \
  --svdquant-rank 32 \
  --svdquant-smooth-alpha 0.5 \
  --format fake \
  --output_dir ./flux-svdquant-mxfp4-rtn

Type of Change

feature.

Related Issues

Fixes or relates to #

Checklist Before Submitting

  • My code has been tested locally.
  • Documentation has been updated as needed.
  • New or updated tests are included where applicable.
  • The CUDA CI has passed. You can trigger it by commenting /azp run Unit-Test-CUDA-AutoRound.

changwangss and others added 2 commits July 9, 2026 14:25
Signed-off-by: changwangss <chang1.wang@intel.com>
Signed-off-by: changwangss <chang1.wang@intel.com>
def __init__(
self,
residual_linear: torch.nn.Linear,
lora_down: torch.nn.Linear,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's linear, it will be quantized by AutoRound, I guess. Two solutions
1 add "lora" to predefined ignore layers for all models
or 2 change to F.linear

Comment thread auto_round/cli/parser.py
)
rt.add_argument("--svdquant-rank", dest="svdquant_rank", default=32, type=int, help="SVDQuant low-rank size.")
rt.add_argument(
"--svdquant-smooth-alpha",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend using the awq+lora to generate svdquant, and share the common args with awq

import torch


class SVDQuantLinear(torch.nn.Module):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to implement this as a LoRABranch and decouple it from AWQ. That would make it easier to combine with other quantization algorithms in the future.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can refer gptqmodel about how to implement it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants