build pytorch_quantization(2.2.1) error
Description
when I try to build pytorch_quantization from source following readme.md, building error happens in tensor_quant_gpu.cu. and I think maybe some version problem
Environment
TensorRT Version:
NVIDIA GPU:
NVIDIA Driver Version:
CUDA Version:
CUDNN Version: release 10.5
Operating System: linux
Python Version (if applicable): 3.8.19
Tensorflow Version (if applicable):
PyTorch Version (if applicable): 1.12.1+cu113
In file included from /home/wxb/.conda/envs/quant_env/lib/python3.8/site-packages/torch/include/ATen/ATen.h:13,
from /home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu:18:
/home/wxb/.conda/envs/quant_env/lib/python3.8/site-packages/torch/include/ATen/Dispatch.h:262: note: this is the location of the previous definition
262 | #define AT_DISPATCH_FLOATING_TYPES(TYPE, NAME, ...)
|
/home/wxb/.conda/envs/quant_env/lib/python3.8/site-packages/torch/include/c10/core/SymInt.h(84): warning: integer conversion resulted in a change of sign
/home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu(78): error: identifier "scalar_t" is undefined
/home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu(78): error: no instance of function template "fake_tensor_quant_kernel" matches the argument list
argument types are: (
/home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu(78): error: identifier "AT_DISPATCH_CASE" is undefined
/home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu(78): error: expected a ")"
/home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu(78): error: identifier "AT_DISPATCH_SWITCH" is undefined
/home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu(90): error: identifier "scalar_t" is undefined
/home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu(90): error: no instance of function template "fake_tensor_quant_kernel" matches the argument list
argument types are: (
/home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu(90): error: identifier "AT_DISPATCH_CASE" is undefined
/home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu(90): error: expected a ")"
/home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu(90): error: identifier "AT_DISPATCH_SWITCH" is undefined
/home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu(130): error: identifier "scalar_t" is undefined
/home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu(130): error: no instance of function template "fake_tensor_quant_with_axis_cuda_kernel" matches the argument list
argument types are: (
/home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu(130): error: identifier "AT_DISPATCH_CASE" is undefined
/home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu(130): error: expected a ")"
/home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu(130): error: identifier "AT_DISPATCH_SWITCH" is undefined
15 errors detected in the compilation of "/home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu".
I successfully build it on release/v8.6, and pytorch_quantization==2.1.3,and I think you need to update the readme.md about pytorch_quantization and tell the dependencies of pytorch_quantization
In file included from /home/wxb/.conda/envs/quant_env/lib/python3.8/site-packages/torch/include/ATen/ATen.h:13, from /home/wxb/workspace/TensorRT/tools/pytorch-quantization/src/tensor_quant_gpu.cu:18: /home/wxb/.conda/envs/quant_env/lib/python3.8/site-packages/torch/include/ATen/Dispatch.h:262: note: this is the location of the previous definition 262 | #define AT_DISPATCH_FLOATING_TYPES(TYPE, NAME, ...)
AT_DISPATCH_FLOATING_TYPES is duplicate definition. trt10.5 tools/pytorch-quantization/src/tensor_quant_gpu.cu maybe need add #undef AT_DISPATCH_FLOATING_TYPES #undef AT_DISPATCH_FLOATING_TYPES before #define
Duplicate of this issue: https://github.com/NVIDIA/TensorRT/issues/4197