[CI]Install older cmath during Windows build (#54431)

Summary:
Based on peterjc123 analysis, `cmath` after 26bbe2ad50 (diff-3fa97ceb95d524432661f01d4b34509c6d261a2f7f45ddcf26f79f55b3eec88a) renders a lot of CUDA fail to compile with:
```
error: calling a __host__ function("__copysignf") from a __host__ __device__ function("c10::guts::detail::apply_impl< ::at::native::AUnaryFunctor< ::>  &,     ::std::tuple<float >  &, (unsigned long long)0ull > ") is not allowed
```
Workaround for https://github.com/pytorch/pytorch/issues/54382

Pull Request resolved: https://github.com/pytorch/pytorch/pull/54431

Reviewed By: anjali411

Differential Revision: D27234299

Pulled By: malfet

fbshipit-source-id: b3f1fef941341222cc10cb27346fcf4a1d522a0c
This commit is contained in:
Nikita Shulga
2021-03-22 12:18:10 -07:00
committed by Facebook GitHub Bot
parent 6e7a3c1fdd
commit 8bb07c7e21
3 changed files with 15 additions and 0 deletions

View File

@ -697,6 +697,11 @@ jobs:
executor: <<parameters.executor>>
steps:
- checkout
- run:
name: _HACK_ Install CUDA compatible cmath
no_output_timeout: 1m
command: |
powershell .circleci/scripts/vs_install_cmath.ps1
- run:
name: Install Cuda
no_output_timeout: 30m

View File

@ -0,0 +1,5 @@
$CMATH_DOWNLOAD_LINK = "https://raw.githubusercontent.com/microsoft/STL/12c684bba78f9b032050526abdebf14f58ca26a3/stl/inc/cmath"
$VC14_28_INSTALL_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include"
curl.exe --retry 3 -kL $CMATH_DOWNLOAD_LINK --output "$home\cmath"
Move-Item -Path "$home\cmath" -Destination "$VC14_28_INSTALL_PATH" -Force

View File

@ -259,6 +259,11 @@ jobs:
executor: <<parameters.executor>>
steps:
- checkout
- run:
name: _HACK_ Install CUDA compatible cmath
no_output_timeout: 1m
command: |
powershell .circleci/scripts/vs_install_cmath.ps1
- run:
name: Install Cuda
no_output_timeout: 30m