Skip to content

Conversation

@asl3
Copy link
Contributor

@asl3 asl3 commented Jun 21, 2022

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

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Jun 21, 2022

🔗 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.

Click here to manually regenerate this comment.

@asl3 asl3 requested review from HDCharles, dzdang and jerryzh168 June 21, 2022 16:31
asl3 added 3 commits June 21, 2022 10:50
### 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]
@asl3 asl3 marked this pull request as draft June 21, 2022 20:23
asl3 added 8 commits June 21, 2022 13:38
### 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]
@asl3 asl3 marked this pull request as ready for review June 21, 2022 22:29
### 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]
@asl3 asl3 requested a review from HDCharles June 22, 2022 02:59
asl3 added 3 commits June 22, 2022 04:38
### 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]
@asl3 asl3 added topic: not user facing topic category release notes: quantization release notes category labels Jun 22, 2022
### 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]
@pytorch pytorch deleted a comment from pytorchmergebot Jun 22, 2022
@asl3
Copy link
Contributor Author

asl3 commented Jun 22, 2022

@pytorchbot merge -g

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here


# class to store APoT quantized tensor
class TensorAPoT(torch.Tensor):
class TensorAPoT():
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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

@pytorchmergebot
Copy link
Collaborator

@asl3 your PR has been successfully merged.

aovladi pushed a commit that referenced this pull request Jun 22, 2022
facebook-github-bot pushed a commit that referenced this pull request Jun 23, 2022
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
@facebook-github-bot facebook-github-bot deleted the gh/asl3/30/head branch June 26, 2022 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants