Skip to content

[chore] log quant config to the user_agent#13850

Open
sayakpaul wants to merge 1 commit into
mainfrom
user-agent-quant-config
Open

[chore] log quant config to the user_agent#13850
sayakpaul wants to merge 1 commit into
mainfrom
user-agent-quant-config

Conversation

@sayakpaul
Copy link
Copy Markdown
Member

What does this PR do?

To get finegrained understanding of which quant configs are most used, allow quant configs to also go in user_agent.

Example value:

user_agent['quant_config']='{"modules_to_not_convert": null, "quant_method": "torchao", "quant_type": {"default": {"_data": {"granularity": {"_data": {"dim": -1}, "_type": "PerRow", "_version": 1}, "group_size": null, "set_inductor_config": true}, "_type": "Int8WeightOnlyConfig", "_version": 2}}}'

For:

from diffusers import AutoModel, TorchAoConfig
import torch 
from torchao.quantization import Int8WeightOnlyConfig

model = AutoModel.from_pretrained(
    "black-forest-labs/FLUX.1-dev",
    subfolder="transformer",
    torch_dtype=torch.bfloat16,
    quantization_config=TorchAoConfig(Int8WeightOnlyConfig(group_size=None, version=2))
)

Additionally, also pass the model class to user_agent to better understand which quantization classes are usually used for a particular class of models.

@github-actions github-actions Bot added size/S PR with diff < 50 LOC models labels Jun 1, 2026
@sayakpaul sayakpaul requested a review from SunMarc June 1, 2026 05:09
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

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

Labels

models size/S PR with diff < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants