Ok, so there is a lot of similar errors like this (I’ve also changed polish phrases):
[1624/2499] Building NVCC (Device) object caffe2/CMakeFile...en/src/ATen/native/cuda/caffe2_gpu_generated_Reduce.cu.obj
FAILED: caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/ATen/native/cuda/caffe2_gpu_generated_Reduce.cu.obj
cmd.exe /C "cd /D C:\Users\MarcinM\pytorch\build\caffe2\CMakeFiles\caffe2_gpu.dir\__\aten\src\ATen\native\cuda && C:\Users\MarcinM\AppData\Local\Programs\Python\Python36\Lib\site-packages\cmake\data\bin\cmake.exe -E make_directory C:/Users/MarcinM/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/ATen/native/cuda/. && C:\Users\MarcinM\AppData\Local\Programs\Python\Python36\Lib\site-packages\cmake\data\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=C:/Users/MarcinM/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/ATen/native/cuda/./caffe2_gpu_generated_Reduce.cu.obj -D generated_cubin_file:STRING=C:/Users/MarcinM/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/ATen/native/cuda/./caffe2_gpu_generated_Reduce.cu.obj.cubin.txt -P C:/Users/MarcinM/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/ATen/native/cuda/caffe2_gpu_generated_Reduce.cu.obj.Release.cmake"
Failed to run %VS140COMNTOOLS%../../VC/bin/amd64/cl.exe (No such file).
CMake Error at caffe2_gpu_generated_Reduce.cu.obj.Release.cmake:219 (message):
  Error generating
  C:/Users/MarcinM/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/ATen/native/cuda/./caffe2_gpu_generated_Reduce.cu.obj

and one last error is:
[1625/2499] Linking CXX shared module caffe2\python\caffe2_pybind11_state.cp36-win_amd64.pyd
   Creating library lib\caffe2_pybind11_state.lib and object lib\caffe2_pybind11_state.exp
pybind_state.cc.obj : warning LNK4217: locally defined symbol ?PybindAdditionRegistry@python@caffe2@@YAPEAV?$Registry@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$unique_ptr@UPybindAddition@python@caffe2@@U?$default_delete@UPybindAddition@python@caffe2@@@std@@@2@AEAVmodule@pybind11@@@c10@@XZ (class c10::Registry<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::unique_ptr<struct caffe2::python::PybindAddition,struct std::default_delete<struct caffe2::python::PybindAddition> >,class pybind11::module &> * __cdecl caffe2::python::PybindAdditionRegistry(void)) was imported in function "void __cdecl caffe2::python::pybind11_init_caffe2_pybind11_state(class pybind11::module &)" (?pybind11_init_caffe2_pybind11_state@python@caffe2@@YAXAEAVmodule@pybind11@@@Z)
pybind_state_nomni.cc.obj : warning LNK4049: locally defined symbol ?PybindAdditionRegistry@python@caffe2@@YAPEAV?$Registry@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$unique_ptr@UPybindAddition@python@caffe2@@U?$default_delete@UPybindAddition@python@caffe2@@@std@@@2@AEAVmodule@pybind11@@@c10@@XZ (class c10::Registry<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::unique_ptr<struct caffe2::python::PybindAddition,struct std::default_delete<struct caffe2::python::PybindAddition> >,class pybind11::module &> * __cdecl caffe2::python::PybindAdditionRegistry(void)) was imported
pybind_state_int8.cc.obj : warning LNK4217: locally defined symbol ?BlobFetcherRegistry@python@caffe2@@YAPEAV?$Registry@VTypeIdentifier@caffe2@@V?$unique_ptr@VBlobFetcherBase@python@caffe2@@U?$default_delete@VBlobFetcherBase@python@caffe2@@@std@@@std@@$$V@c10@@XZ (class c10::Registry<class caffe2::TypeIdentifier,class std::unique_ptr<class caffe2::python::BlobFetcherBase,struct std::default_delete<class caffe2::python::BlobFetcherBase> > > * __cdecl caffe2::python::BlobFetcherRegistry(void)) zostal zaimportowany w funkcji "void __cdecl caffe2::python::`dynamic initializer for 'g_BlobFetcherRegistry0''(void)" (??__Eg_BlobFetcherRegistry0@python@caffe2@@YAXXZ)
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "setup.py", line 710, in <module>
    build_deps()
  File "setup.py", line 282, in build_deps
    build_dir='build')
  File "C:\Users\MarcinM\pytorch\tools\build_pytorch_libs.py", line 261, in build_caffe2
    cwd=build_dir, env=my_env)
  File "C:\Users\MarcinM\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install', '--config', 'Release', '--', '-j', '11']' returned non-zero exit status 1.

About Failed to run %VS140COMNTOOLS%../../VC/bin/amd64/cl.exe (No such file)., indeed there is no such path as C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\bin.
Maybe the path should be C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\cl.exe as implied in caffe2 old repo discussion?
Edit: I’ve changed the path to but with no luck:
Failed to run %VS140COMNTOOLS%../../VC/Tools/MSVC/14.11.25503/bin/HostX64/x64/cl.exe (No such file).

Which is quite weird because the file cl.exe is definitely there.