Commit Graph

7 Commits

Author SHA1 Message Date
Igor Sugak
f1e89fbe53 [pytorch] add missing host-device attribute to fix clang build (#37358)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/37358

Test Plan:
```lang=bash
buck build mode/opt -c fbcode.cuda_use_clang=true //vision/fair/detectron2/tools:benchmark
```

Reviewed By: ngimel

Differential Revision: D21262235

fbshipit-source-id: 00633352d87da0881b2cc90759265fa0d0bd96be
2020-04-27 18:24:20 -07:00
Jerry Zhang
385165ec67 [reland][quant] QuantizedCUDA implementation (#36936) (#37081)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/37081

Closes https://github.com/pytorch/pytorch/issues/30813

Relanding of https://github.com/pytorch/pytorch/pull/35463

1. Tensor quantization logic(quantize_*) is moved to the aten/native/quantized. Previously all logic for tensor quantization lived in the aten/quantized/Quantizer.cpp file, and started to become complicated and hard to read. This problem should be addressed in refactoring PR. Still, I reworked this partially because I had to add tensor quantization logic for CUDA, and it was native to move everything to the aten/native/quantized.
2. Requirements to run CUDA_tensor_apply* was eased to process any tenser that lives on the CUDA device(QuantizedCUDA included).
3. All quantized data types now have a default constructor. NVCC refuses to compile any gpu_kernel or CUDA_tensor_apply* without them.
4. Minor changes in many files to register QuantizedCUDA backend.
5. test_quantized_tensor is extended to process QuantizedCUDA backend where possible.

Test Plan: Imported from OSS

Differential Revision: D21206694

Pulled By: jerryzh168

fbshipit-source-id: c7433aad9c095a34c57e6dddd128b5c5d9292373
2020-04-24 10:21:59 -07:00
Mike Ruberry
4bbc49f53a Revert D21143025: [reland][quant] QuantizedCUDA implementation
Test Plan: revert-hammer

Differential Revision:
D21143025

Original commit changeset: 11405e2e8f87

fbshipit-source-id: ce471ec95c1fc6abff6d1bbdba11bef02f3a0d62
2020-04-21 20:36:12 -07:00
Jerry Zhang
97d3a8495d [reland][quant] QuantizedCUDA implementation (#36936)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/36936

Closes https://github.com/pytorch/pytorch/issues/30813

Relanding of https://github.com/pytorch/pytorch/pull/35463

1. Tensor quantization logic(quantize_*) is moved to the aten/native/quantized. Previously all logic for tensor quantization lived in the aten/quantized/Quantizer.cpp file, and started to become complicated and hard to read. This problem should be addressed in refactoring PR. Still, I reworked this partially because I had to add tensor quantization logic for CUDA, and it was native to move everything to the aten/native/quantized.
2. Requirements to run CUDA_tensor_apply* was eased to process any tenser that lives on the CUDA device(QuantizedCUDA included).
3. All quantized data types now have a default constructor. NVCC refuses to compile any gpu_kernel or CUDA_tensor_apply* without them.
4. Minor changes in many files to register QuantizedCUDA backend.
5. test_quantized_tensor is extended to process QuantizedCUDA backend where possible.

Test Plan: Imported from OSS

Differential Revision: D21143025

Pulled By: jerryzh168

fbshipit-source-id: 11405e2e8f87e48fadc0a084c51db15f85ccb500
2020-04-21 13:18:52 -07:00
Alban Desmaison
49b10c58a3 Revert D20896697: [pytorch][PR] QuantizedCUDA implementation
Test Plan: revert-hammer

Differential Revision:
D20896697

Original commit changeset: 163554efa23d

fbshipit-source-id: e3e370ef7c8be68ea34368dfcc7a7efc9d1f8761
2020-04-19 12:41:51 -07:00
Aleksandr Fedorov
f6daa6220e QuantizedCUDA implementation (#35463)
Summary:
Closes https://github.com/pytorch/pytorch/issues/30813

1. Tensor quantization logic(quantize_*) is moved to the aten/native/quantized. Previously all logic for tensor quantization lived in the aten/quantized/Quantizer.cpp file, and started to become complicated and hard to read. This problem should be addressed in refactoring PR. Still, I reworked this partially because I had to add tensor quantization logic for CUDA, and it was native to move everything to the aten/native/quantized.
2. Requirements to run CUDA_tensor_apply* was eased to process any tenser that lives on the CUDA device(QuantizedCUDA included).
3. All quantized data types now have a default constructor. NVCC refuses to compile any gpu_kernel or CUDA_tensor_apply* without them.
4. Minor changes in many files to register QuantizedCUDA backend.
5. test_quantized_tensor is extended to process QuantizedCUDA backend where possible.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/35463

Differential Revision: D20896697

Pulled By: jerryzh168

fbshipit-source-id: 163554efa23d11a2b10bbc2492439db4798eb26b
2020-04-19 08:33:16 -07:00
Jerry Zhang
abb3698976 Add QInt32 ScalarType and qint32 data type (#19816)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19816

We need this for quantization for bias
add third argument of ScalarType to `quantize_linear`

Differential Revision: D15094174

fbshipit-source-id: f19ec8f4716cf5fe0aa21b38d45af6d27c9ab377
2019-05-15 18:50:18 -07:00