-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[quant] Implement APoT_tensor class #79940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
[ghstack-poisoned]
🔗 Helpful links
✅ No Failures (0 Pending)As of commit ed16153 (more details on the Dr. CI page): Expand to see more💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
### Summary: This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and has a method to convert APoT tensor to int representation. ### Test Plan: Run unit tests with: `python pytorch/test/quantization/core/experimental/test_quantized_tensor.py` [ghstack-poisoned]
### Summary: This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and has a method to convert APoT tensor to int representation. ### Test Plan: Run unit tests with: `python pytorch/test/quantization/core/experimental/test_quantized_tensor.py` [ghstack-poisoned]
### Summary: This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and has a method to convert APoT tensor to int representation. ### Test Plan: Run unit tests with: `python pytorch/test/quantization/core/experimental/test_quantized_tensor.py` [ghstack-poisoned]
### Summary: This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and has a method to convert APoT tensor to int representation. ### Test Plan: Run unit tests with: `python pytorch/test/quantization/core/experimental/test_quantized_tensor.py` [ghstack-poisoned]
### Summary: This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and has a method to convert APoT tensor to int representation. ### Test Plan: Run unit tests with: `python pytorch/test/quantization/core/experimental/test_quantized_tensor.py` [ghstack-poisoned]
### Summary: This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and has a method to convert APoT tensor to int representation. ### Test Plan: Run unit tests with: `python pytorch/test/quantization/core/experimental/test_quantized_tensor.py` [ghstack-poisoned]
### Summary: This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and has a method to convert APoT tensor to int representation. ### Test Plan: Run unit tests with: `python pytorch/test/quantization/core/experimental/test_quantized_tensor.py` [ghstack-poisoned]
### Summary: This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and has a method to convert APoT tensor to int representation. ### Test Plan: Run unit tests with: `python pytorch/test/quantization/core/experimental/test_quantized_tensor.py` [ghstack-poisoned]
### Summary: This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and has a method to convert APoT tensor to int representation. ### Test Plan: Run unit tests with: `python pytorch/test/quantization/core/experimental/test_quantized_tensor.py` [ghstack-poisoned]
### Summary: This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and has a method to convert APoT tensor to int representation. ### Test Plan: Run unit tests with: `python pytorch/test/quantization/core/experimental/test_quantized_tensor.py` [ghstack-poisoned]
### Summary: This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and has a method to convert APoT tensor to int representation. ### Test Plan: Run unit tests with: `python pytorch/test/quantization/core/experimental/test_quantized_tensor.py` [ghstack-poisoned]
### Summary: This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and has a method to convert APoT tensor to int representation. ### Test Plan: Run unit tests with: `python pytorch/test/quantization/core/experimental/test_quantized_tensor.py` [ghstack-poisoned]
### Summary: This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and has a method to convert APoT tensor to int representation. ### Test Plan: Run unit tests with: `python pytorch/test/quantization/core/experimental/test_quantized_tensor.py` [ghstack-poisoned]
### Summary: This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and has a method to convert APoT tensor to int representation. ### Test Plan: Run unit tests with: `python pytorch/test/quantization/core/experimental/test_quantized_tensor.py` [ghstack-poisoned]
### Summary: This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and has a method to convert APoT tensor to int representation. ### Test Plan: Run unit tests with: `python pytorch/test/quantization/core/experimental/test_quantized_tensor.py` [ghstack-poisoned]
### Summary: This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and a method to return the int representation of an APoT tensor. ### Test Plan: Run unit tests with: `python pytorch/test/quantization/core/experimental/test_quantized_tensor.py` [ghstack-poisoned]
|
@pytorchbot merge -g |
|
@pytorchbot successfully started a merge job. Check the current status here |
|
|
||
| # class to store APoT quantized tensor | ||
| class TensorAPoT(torch.Tensor): | ||
| class TensorAPoT(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is TensorAPoT no longer inheriting from torch.Tensor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When TensorAPoT inherits from torch.Tensor I get an issue with my TensorAPoT init function since I am not passing in the expected args:
`TypeError: new() received an invalid combination of arguments - got (Tensor, int, int, bool), but expected one of:
- (*, torch.device device)
- (torch.Storage storage)
- (Tensor other)
- (tuple of ints size, *, torch.device device)
- (object data, *, torch.device device)`
I didn't think any of these made sense for my TensorAPoT object since I am passing in a quantizer object. Closest was the (Tensor other) option, but in that case I would need to create the quantizer in my init function and would need to pass in the args needed by quantizer init , which would also violate the expected args.
Is it okay if TensorAPoT doesn't inherit from torch.Tensor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this is fine for now, this might involve a bit more design about how do we allow people to extend quantized tensor in python, that's something we can explore in H2
|
@asl3 your PR has been successfully merged. |
Pull Request resolved: #79940 Approved by: https://github.com/dzdang
Summary: Pull Request resolved: #79940 Approved by: https://github.com/dzdang Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/82a1961129bc682da2da9863d88d39525f4301b6 Reviewed By: atalman Differential Revision: D37357398 Pulled By: asl3 fbshipit-source-id: 89d962cddd2f2b2feb96ace3d3b618a7a23a4fa0
Stack from ghstack (oldest at bottom):
Summary:
This PR implements functionality to store APoT tensors. The APoT tensor class contains a quantizer and a method to return the int representation of an APoT tensor.
Test Plan:
Run unit tests with:
python pytorch/test/quantization/core/experimental/test_quantized_tensor.py