quic / aimet

AIMET is a library that provides advanced quantization and compression techniques for trained neural network models.
https://quic.github.io/aimet-pages/index.html
Other
2.16k stars 384 forks source link

Add special handling for attribute descriptors of QuantizedTensorBase #3519

Closed quic-kyunggeu closed 5 days ago

quic-kyunggeu commented 5 days ago

Problem Statement

There is a minor quirk in PyTorch which makes tree_map(lambda x: x, torch.Size([10, 10])) return (10, 10), not torch.Size([10, 10]). This in turn makes qtensor.shape return a plain tuple, not a torch.Size object

Main Changes

Added special handling for attribute descriptors of QuantizedTensorBase. Now qtensor.shape will return torch.Size object, not a plain tuple.