Skip to content

[quant][core][gpu][improvement] Removed linear_output and set output tensors as virtual in quantized cudnn linear op#77518

Closed
dzdang wants to merge 1 commit intogh/dzdang/116/basefrom
gh/dzdang/116/head
Closed

[quant][core][gpu][improvement] Removed linear_output and set output tensors as virtual in quantized cudnn linear op#77518
dzdang wants to merge 1 commit intogh/dzdang/116/basefrom
gh/dzdang/116/head

Conversation

@dzdang
Copy link
Contributor

@dzdang dzdang commented May 16, 2022

Stack from ghstack (oldest at bottom):

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

Test plan:

python test/test_quantization.py --k test_qlinear_cudnn

Differential Revision: D36403832

…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
```

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

facebook-github-bot commented May 16, 2022

🔗 Helpful links

❌ 1 New Failures

As of commit 55166af (more details on the Dr. CI page):

Expand to see more
  • 1/1 failures introduced in this PR

🕵️ 1 new failure recognized by patterns

The following CI failures do not appear to be due to upstream breakages

See GitHub Actions build pull / linux-xenial-py3.7-gcc5.4 / test (distributed, 1, 1, linux.2xlarge) (1/1)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

2022-05-16T03:24:53.1905101Z AssertionError: 1 unit test(s) failed:
2022-05-16T03:24:52.9820578Z 
2022-05-16T03:24:52.9820641Z OK
2022-05-16T03:24:52.9820732Z 
2022-05-16T03:24:52.9820836Z Generating XML reports...
2022-05-16T03:24:52.9853470Z Generated XML report: test-reports/python-unittest/distributed.rpc.test_tensorpipe_agent/TEST-TensorPipeThreeWorkersRemoteModuleTest-20220516032451.xml
2022-05-16T03:24:53.1901895Z Traceback (most recent call last):
2022-05-16T03:24:53.1902443Z   File "distributed/rpc/test_tensorpipe_agent.py", line 38, in <module>
2022-05-16T03:24:53.1902880Z     run_tests()
2022-05-16T03:24:53.1903588Z   File "/opt/conda/lib/python3.7/site-packages/torch/testing/_internal/common_utils.py", line 635, in run_tests
2022-05-16T03:24:53.1904713Z     len(failed_tests), '\n\t'.join(failed_tests))
2022-05-16T03:24:53.1905101Z AssertionError: 1 unit test(s) failed:
2022-05-16T03:24:53.1905544Z 	TensorPipeDistAutogradTest.test_backward_unused_tensors
2022-05-16T03:24:53.3201300Z Traceback (most recent call last):
2022-05-16T03:24:53.3201583Z   File "test/run_test.py", line 1072, in <module>
2022-05-16T03:24:53.3204286Z     main()
2022-05-16T03:24:53.3204581Z   File "test/run_test.py", line 1050, in main
2022-05-16T03:24:53.3207657Z     raise RuntimeError(err_message)
2022-05-16T03:24:53.3207948Z RuntimeError: distributed/rpc/test_tensorpipe_agent failed!
2022-05-16T03:24:53.5597223Z + cleanup
2022-05-16T03:24:53.5597597Z + retcode=1
2022-05-16T03:24:53.5597915Z + set +x

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 16, 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 16, 2022
@dzdang dzdang requested a review from jerryzh168 May 24, 2022 18:34
.setxDesc(tensor2requant_ptr)
.setyDesc(cudnn_utils::getTensorDescriptor(linear_output, 'f', key.output_alignment, true))
.setpwDesc(cudnn_utils::getPointWiseReluDescriptor(at::native::getCudnnDataType(linear_output)))
// for virtual tensors, the alignment is not used, so we can just put an arbitrary value here, e.g., key.output_alignment
Copy link
Contributor

Choose a reason for hiding this comment

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

should we just use -1 or something to indicate that it is not used?

.setbMatDesc(cudnn_utils::getTensorDescriptor(weight_transposed.sizes(), weight_transposed.strides(), CUDNN_DATA_INT8, 'w', key.weight_alignment))
.setcMatDesc(cudnn_utils::getTensorDescriptor(linear_output, 'y', key.output_alignment, true))
// for virtual tensors, the alignment is not used, so we can just put an arbitrary value here, e.g., key.output_alignment
.setcMatDesc(cudnn_utils::getTensorDescriptor(quantized_output.sizes(), quantized_output.strides(), CUDNN_DATA_FLOAT, 'y', key.output_alignment, true))
Copy link
Contributor

Choose a reason for hiding this comment

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

similar for the output_alignment here, should we just use -1 to indicate that it is not used?

@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
…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/116/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