Skip to content

Conversation

mengniwang95
Copy link
Contributor

@mengniwang95 mengniwang95 commented Oct 13, 2025

User description

Type of Change

example

Description

detail description

Expected Behavior & Potential Risk

the expected behavior that triggered by this PR

How has this PR been tested?

how to reproduce the test (including hardware information)

Dependency Change?

any library dependency introduced or removed


PR Type

Enhancement


Description

  • Added parameters for diffusion control in quantization

  • Updated initialization and conversion methods to include new parameters

  • Modified autoround quantize entry to handle new parameters


Diagram Walkthrough

flowchart LR
  init["Add diffusion parameters"] -- "Update initialization" --> convert["Modify conversion method"]
  convert -- "Handle new parameters" --> entry["Update autoround entry"]
Loading

File Walkthrough

Relevant files
Enhancement
autoround.py
Add diffusion parameters to autoround                                       

neural_compressor/torch/algorithms/weight_only/autoround.py

  • Added guidance_scale, num_inference_steps, generator_seed to __init__
  • Updated convert method to accept pipeline and use new parameters
+18/-1   
algorithm_entry.py
Update autoround entry for diffusion                                         

neural_compressor/torch/quantization/algorithm_entry.py

  • Added dataset, guidance_scale, num_inference_steps, generator_seed to
    autoround_quantize_entry
  • Updated get_quantizer call to include new parameters
+8/-0     
quantize.py
Allow additional keyword arguments in convert                       

neural_compressor/torch/quantization/quantize.py

  • Added **kwargs to convert method
+2/-0     

Signed-off-by: Mengni Wang <mengni.wang@intel.com>
@PRAgent4INC
Copy link
Collaborator

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Issue

The generator_seed parameter is set to None by default, which might lead to non-reproducible results if not explicitly set by the user.

generator_seed: int = None,
Code Clarity

The addition of the pipeline parameter in the convert method could benefit from additional comments or documentation to clarify its purpose and usage.

pipe = kwargs.pop("pipeline", None)
Default Dataset

Setting the default dataset to "NeelNanda/pile-10k" might not be suitable for all use cases. Consider making this configurable or providing a more generic default.

dataset = quant_config.to_dict().get("dataset", "NeelNanda/pile-10k")

@PRAgent4INC
Copy link
Collaborator

PR Code Suggestions ✨

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants