Skip to content

[quant][core][gpu][improvement] Removed conv_output and set output tensors as virtual in quantized cudnn conv2d op#76787

Closed
dzdang wants to merge 5 commits intogh/dzdang/104/basefrom
gh/dzdang/104/head
Closed

[quant][core][gpu][improvement] Removed conv_output and set output tensors as virtual in quantized cudnn conv2d op#76787
dzdang wants to merge 5 commits intogh/dzdang/104/basefrom
gh/dzdang/104/head

Conversation

@dzdang
Copy link
Contributor

@dzdang dzdang commented May 4, 2022

…nsors as virtual in quantized cudnn conv2d op

Summary:
With support for virtual tensors in cudnn, we no longer have to allocate
conv_output.

Test plan:
```
python test/test_quantization.py -k test_qconv2d_cudnn
```

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented May 4, 2022

🔗 Helpful links

✅ No Failures (0 Pending)

As of commit 2d2ffc3 (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.

@dzdang
Copy link
Contributor Author

dzdang commented May 4, 2022

@dzdang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@dzdang dzdang added release notes: quantization release notes category topic: improvements topic category labels May 4, 2022
@dzdang dzdang requested a review from jerryzh168 May 4, 2022 12:41
.setxDesc(cudnn_utils::getTensorDescriptor(input.sizes(), input.strides(), CUDNN_DATA_INT8, 'x', key.input_alignment))
.setyDesc(cudnn_utils::getTensorDescriptor(conv_output, 'y', key.output_alignment))
// for virtual tensors, the alignment is not used, so we can just put an arbitrary value here, e.g., key.output_alignment
.setyDesc(cudnn_utils::getTensorDescriptor(quantized_output.sizes(), quantized_output.strides(), CUDNN_DATA_FLOAT, 'y', key.output_alignment, true))
Copy link
Contributor

@jerryzh168 jerryzh168 May 10, 2022

Choose a reason for hiding this comment

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

should we use a constant here so that it is the same for all calls?

Copy link
Contributor

Choose a reason for hiding this comment

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

this setyDesc is not really used since the output is a virtual tensor, is that corrrect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jerryzh168 no. setyDesc is still used. we still need to provide the tensor size, stride, and dtype for cudNN (I don't think they have the support that allows them to determine the output shape and dtype based on the input and weight). the alignment and uid are not used.

…t output tensors as virtual in quantized cudnn conv2d op"

Summary:
With support for virtual tensors in cudnn, we no longer have to allocate
conv_output.

Test plan:
```
python test/test_quantization.py -k test_qconv2d_cudnn
```

Differential Revision: [D36121583](https://our.internmc.facebook.com/intern/diff/D36121583)

[ghstack-poisoned]
@dzdang
Copy link
Contributor Author

dzdang commented May 11, 2022

@dzdang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

…t output tensors as virtual in quantized cudnn conv2d op"

Summary:
With support for virtual tensors in cudnn, we no longer have to allocate
conv_output.

Test plan:
```
python test/test_quantization.py -k test_qconv2d_cudnn
```

Differential Revision: [D36121583](https://our.internmc.facebook.com/intern/diff/D36121583)

[ghstack-poisoned]
@dzdang
Copy link
Contributor Author

dzdang commented May 16, 2022

@dzdang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

dzdang added 2 commits May 24, 2022 16:32
…t output tensors as virtual in quantized cudnn conv2d op"

Summary:
With support for virtual tensors in cudnn, we no longer have to allocate
conv_output.

Test plan:
```
python test/test_quantization.py -k test_qconv2d_cudnn
```

Differential Revision: [D36121583](https://our.internmc.facebook.com/intern/diff/D36121583)

[ghstack-poisoned]
…t output tensors as virtual in quantized cudnn conv2d op"

Summary:
With support for virtual tensors in cudnn, we no longer have to allocate
conv_output.

Test plan:
```
python test/test_quantization.py -k test_qconv2d_cudnn
```

Differential Revision: [D36121583](https://our.internmc.facebook.com/intern/diff/D36121583)

[ghstack-poisoned]
@dzdang
Copy link
Contributor Author

dzdang commented May 24, 2022

@dzdang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@pytorchbot merge

(Initiating merge automatically since Phabricator Diff has merged)

facebook-github-bot pushed a commit that referenced this pull request May 25, 2022
…nsors as virtual in quantized cudnn conv2d op (#76787)

Summary:
Pull Request resolved: #76787

With support for virtual tensors in cudnn, we no longer have to allocate
conv_output.

Test Plan:
```
python test/test_quantization.py -k test_qconv2d_cudnn
```

```
python test/test_quantization.py -k test_qconv2d_cudnn
```

Differential Revision:
D36121583
D36121583

Reviewed By: jerryzh168

Pulled By: dzdang

fbshipit-source-id: 7269fd4eaaad5ae6faf711add99b58731efb717a
pytorchmergebot pushed a commit that referenced this pull request May 25, 2022
…tensors as virtual in quantized cudnn linear op

Summary:
See #76787. Same idea applied
here but for `linear_output`.

Test plan:
```
python test/test_quantization.py --k test_qlinear_cudnn
```

Pull Request resolved: #77518

Approved by: https://github.com/jerryzh168
facebook-github-bot pushed a commit that referenced this pull request May 25, 2022
…tensors as virtual in quantized cudnn linear op (#77518)

Summary:
Pull Request resolved: #77518

See #76787. Same idea applied
here but for `linear_output`.

Test Plan:
```
python test/test_quantization.py --k test_qlinear_cudnn
```

Reviewed By: jerryzh168

Differential Revision: D36403832

Pulled By: dzdang

fbshipit-source-id: 4ec3bab6a9d82a58fecd38bc943b2137a4f4157e
@facebook-github-bot facebook-github-bot deleted the gh/dzdang/104/head branch May 28, 2022 14:17
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.

4 participants