pytorch / ao

Native PyTorch library for quantization and sparsity
https://pytorch.org/ao
BSD 3-Clause "New" or "Revised" License
310 stars 49 forks source link

Add to function and decorator for `AffineQuantizedTensor` #251

Closed jerryzh168 closed 3 weeks ago

jerryzh168 commented 4 weeks ago

Summary: att Next: we can move AffineQuantizedTensor to dtypes and make nf4tensor to use the same implements decorator

Test Plan: python test/quantization/test_quant_api.py

Reviewers:

Subscribers:

Tasks:

Tags:

pytorch-bot[bot] commented 4 weeks ago

:link: Helpful Links

:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/251

Note: Links to docs will display an error until the docs builds have been completed.

:white_check_mark: No Failures

As of commit 7eed84a70b9caa085cb35157ec820281d1798047 with merge base 9b25eccd29cb5d9b57aca8f817c290015d2abfd6 (image): :green_heart: Looks good so far! There are no failures yet. :green_heart:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

jerryzh168 commented 3 weeks ago

looks good, nice cleanup, the only concern I have (potentially unfounded) is the potential for circular imports. Since every subclass will need to share the global op table they will all need to import from this file. Not sure if there is that much benefit to have a global op registry dict

oh we'll not put the general stuff in this file, current code is still temporary state, we'll move to dtypes folder

global op registry dict is more for convenience, it's not required, we can refactor as well if that becomes an issue