[quant][core][gpu][improvement] Removed conv_output and set output tensors as virtual in quantized cudnn conv2d op#76787
[quant][core][gpu][improvement] Removed conv_output and set output tensors as virtual in quantized cudnn conv2d op#76787dzdang wants to merge 5 commits intogh/dzdang/104/basefrom
Conversation
…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]
🔗 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. |
|
@dzdang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
| .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)) |
There was a problem hiding this comment.
should we use a constant here so that it is the same for all calls?
There was a problem hiding this comment.
this setyDesc is not really used since the output is a virtual tensor, is that corrrect?
There was a problem hiding this comment.
@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 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 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]
…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 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
|
@pytorchbot merge (Initiating merge automatically since Phabricator Diff has merged) |
…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
…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
…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
Stack from ghstack:
Summary:
With support for virtual tensors in cudnn, we no longer have to allocate
conv_output.
Test plan:
Differential Revision: D36121583