Issue 1:
Issue description

The current Windows build fails, caused probably by some erroneous type, provided to a CUDA C++ class. I made a fresh build after removing all the content of the ./build directory

System Info

collect_env.py:

Collecting environment information...
PyTorch version: 1.5.0a0+e2f1288
Is debug build: No
CUDA used to build PyTorch: 10.2

OS: Microsoft Windows 10 Pro
GCC version: Could not collect # VS2019 16.4.5
CMake version: version 3.16.4

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 10.2.89
GPU models and configuration: GPU 0: Quadro M1200
Nvidia driver version: 441.66
cuDNN version: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\cudnn64_7.dll

Versions of relevant libraries:
[pip3] numpy==1.18.1+mkl
[pip3] torch==1.4.0
[pip3] torchvision==0.5.0
[conda] blas 1.0 mkl
[conda] libblas 3.8.0 15_mkl conda-forge
[conda] libcblas 3.8.0 15_mkl conda-forge
[conda] liblapack 3.8.0 15_mkl conda-forge
[conda] liblapacke 3.8.0 15_mkl conda-forge
[conda] mkl 2020.0 166
[conda] mkl-include 2019.5 281 conda-forge
[conda] torch 1.5.0a0+3b2f267 pypi_0 pypi
[conda] torchvision 0.5.0a0+61763fa pypi_0 pypi

Output

[1980/2511] Building NVCC (Device) object caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/torch_cuda_generated_THCTensorMathReduceChar.cu.obj
FAILED: caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/torch_cuda_generated_THCTensorMathReduceChar.cu.obj
cmd.exe /C "cd /D V:\src\pytorch\pytorch\build\caffe2\CMakeFiles\torch_cuda.dir\__\aten\src\THC\generated && G:\programming\bin\scripting\python\conda\envs\pytorch\Library\bin\cmake.exe -E make_directory V:/src/pytorch/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/. && G:\programming\bin\scripting\python\conda\envs\pytorch\Library\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=V:/src/pytorch/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/./torch_cuda_generated_THCTensorMathReduceChar.cu.obj -D generated_cubin_file:STRING=V:/src/pytorch/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/./torch_cuda_generated_THCTensorMathReduceChar.cu.obj.cubin.txt -P V:/src/pytorch/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/torch_cuda_generated_THCTensorMathReduceChar.cu.obj.Release.cmake"
THCTensorMathReduceChar.cu
THCTensorMathReduceChar.cu
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2993: 'Alloc': illegal type for non-type template parameter '__formal'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(72): note: see reference to class template instantiation 'thrust::detail::allocator_traits_detail::has_rebind<Alloc,U>' being compiled
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2065: 't': undeclared identifier
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2923: 'std::_Select<__formal>::_Apply': 't' is not a valid template type argument for parameter '<unnamed-symbol>'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2144: syntax error: 'unknown-type' should be preceded by ')'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2144: syntax error: 'unknown-type' should be preceded by ';'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2238: unexpected token(s) preceding ';'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2059: syntax error: ')'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2988: unrecognizable template declaration/definition
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2059: syntax error: '<end Parse>'
CMake Error at torch_cuda_generated_THCTensorMathReduceChar.cu.obj.Release.cmake:281 (message):
Error generating file
V:/src/pytorch/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/./torch_cuda_generated_THCTensorMathReduceChar.cu.obj

Issue 2:
Kind of similar to #25389

Sometimes our Eigen build fails this way:

C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C2993: 'Derived': illegal type for non-type template parameter '__formal'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C2065: 'RhsType': undeclared identifier
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C2923: 'std::_Select<__formal>::_Apply': 'RhsType' is not a valid template type argument for parameter '<unnamed-symbol>'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C2144: syntax error: 'unknown-type' should be preceded by ')'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C2144: syntax error: 'unknown-type' should be preceded by ';'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(367): error C2062: type 'bool' unexpected
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(369): error C2059: syntax error: ')'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(371): error C2143: syntax error: missing ';' before '{'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(371): error C2447: '{': missing function header (old-style formal list?)

It doesn't seem to reliably repro.

cc @ezyang @gchanan @zou3519 @seemethere @peterjc123