Skip to content

Remove references to torchao's AffineQuantizedTensor#13405

Open
andrewor14 wants to merge 1 commit intohuggingface:mainfrom
andrewor14:remove-aqt
Open

Remove references to torchao's AffineQuantizedTensor#13405
andrewor14 wants to merge 1 commit intohuggingface:mainfrom
andrewor14:remove-aqt

Conversation

@andrewor14
Copy link
Copy Markdown

Summary: TorchAO recently deprecated AffineQuantizedTensor and related classes (pytorch/ao#2752). These will be removed in the next release. We should remove references of these classes in diffusers before then.

Test Plan:
python -m pytest -s -v tests/quantization/torchao/test_torchao.py

**Summary:** TorchAO recently deprecated AffineQuantizedTensor
and related classes (pytorch/ao#2752).
These will be removed in the next release. We should remove
references of these classes in diffusers before then.

**Test Plan:**
python -m pytest -s -v tests/quantization/torchao/test_torchao.py
@andrewor14
Copy link
Copy Markdown
Author

Hi @sayakpaul can you help review this?

Comment on lines 136 to 142
def _linear_extra_repr(self):
weight = _quantization_type(self.weight)
from torchao.utils import TorchAOBaseTensor

weight = self.weight.__class__.__name__ if isinstance(self.weight, TorchAOBaseTensor) else None
if weight is None:
return f"in_features={self.weight.shape[1]}, out_features={self.weight.shape[0]}, weight=None"
else:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this sufficient?

Copy link
Copy Markdown
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Thanks!

@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants