mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Back out "[pytorch][PR] [Re-landing] Fix caffe2 windows CI for new Windows AMI" (#21670)
Summary: Original commit changeset: e65c1d6bfcc9 Pull Request resolved: https://github.com/pytorch/pytorch/pull/21670 Differential Revision: D15776087 Pulled By: yf225 fbshipit-source-id: cbb55cbbcb133cae1aeb2fe75cc52e7350cc6c88
This commit is contained in:
parent
cbcb2b5ad7
commit
8cc8e15473
|
|
@ -163,13 +163,13 @@ test_libtorch() {
|
||||||
python test/cpp/jit/tests_setup.py setup
|
python test/cpp/jit/tests_setup.py setup
|
||||||
CPP_BUILD="$PWD/../cpp-build"
|
CPP_BUILD="$PWD/../cpp-build"
|
||||||
if [[ "$BUILD_ENVIRONMENT" == *cuda* ]]; then
|
if [[ "$BUILD_ENVIRONMENT" == *cuda* ]]; then
|
||||||
"$CPP_BUILD"/caffe2/build/bin/test_jit
|
"$CPP_BUILD"/caffe2/bin/test_jit
|
||||||
else
|
else
|
||||||
"$CPP_BUILD"/caffe2/build/bin/test_jit "[cpu]"
|
"$CPP_BUILD"/caffe2/bin/test_jit "[cpu]"
|
||||||
fi
|
fi
|
||||||
python test/cpp/jit/tests_setup.py shutdown
|
python test/cpp/jit/tests_setup.py shutdown
|
||||||
python tools/download_mnist.py --quiet -d test/cpp/api/mnist
|
python tools/download_mnist.py --quiet -d test/cpp/api/mnist
|
||||||
OMP_NUM_THREADS=2 TORCH_CPP_TEST_MNIST_PATH="test/cpp/api/mnist" "$CPP_BUILD"/caffe2/build/bin/test_api
|
OMP_NUM_THREADS=2 TORCH_CPP_TEST_MNIST_PATH="test/cpp/api/mnist" "$CPP_BUILD"/caffe2/bin/test_api
|
||||||
assert_git_not_dirty
|
assert_git_not_dirty
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,7 @@ if not "%USE_CUDA%"=="0" (
|
||||||
if "%BUILD_ENVIRONMENT%"=="" (
|
if "%BUILD_ENVIRONMENT%"=="" (
|
||||||
echo NOTE: To run `import torch`, please make sure to activate the conda environment by running `call %CONDA_PARENT_DIR%\Miniconda3\Scripts\activate.bat %CONDA_PARENT_DIR%\Miniconda3` in Command Prompt before running Git Bash.
|
echo NOTE: To run `import torch`, please make sure to activate the conda environment by running `call %CONDA_PARENT_DIR%\Miniconda3\Scripts\activate.bat %CONDA_PARENT_DIR%\Miniconda3` in Command Prompt before running Git Bash.
|
||||||
) else (
|
) else (
|
||||||
|
mv %CD%\build\bin\test_api.exe %CONDA_PARENT_DIR%\Miniconda3\Lib\site-packages\torch\lib
|
||||||
7z a %TMP_DIR_WIN%\%IMAGE_COMMIT_TAG%.7z %CONDA_PARENT_DIR%\Miniconda3\Lib\site-packages\torch %CONDA_PARENT_DIR%\Miniconda3\Lib\site-packages\caffe2 && python %SCRIPT_HELPERS_DIR%\upload_image.py %TMP_DIR_WIN%\%IMAGE_COMMIT_TAG%.7z
|
7z a %TMP_DIR_WIN%\%IMAGE_COMMIT_TAG%.7z %CONDA_PARENT_DIR%\Miniconda3\Lib\site-packages\torch %CONDA_PARENT_DIR%\Miniconda3\Lib\site-packages\caffe2 && python %SCRIPT_HELPERS_DIR%\upload_image.py %TMP_DIR_WIN%\%IMAGE_COMMIT_TAG%.7z
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
call %SCRIPT_HELPERS_DIR%\setup_pytorch_env.bat
|
call %SCRIPT_HELPERS_DIR%\setup_pytorch_env.bat
|
||||||
|
|
||||||
cd %TMP_DIR_WIN%\build\torch\bin
|
dir
|
||||||
|
dir %TMP_DIR_WIN%\build
|
||||||
|
dir %TMP_DIR_WIN%\build\torch
|
||||||
|
dir %TMP_DIR_WIN%\build\torch\lib
|
||||||
|
cd %TMP_DIR_WIN%\build\torch\lib
|
||||||
set PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt\bin\x64;%TMP_DIR_WIN%\build\torch\lib;%PATH%
|
set PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt\bin\x64;%TMP_DIR_WIN%\build\torch\lib;%PATH%
|
||||||
test_api.exe --gtest_filter="-IntegrationTest.MNIST*"
|
test_api.exe --gtest_filter="-IntegrationTest.MNIST*"
|
||||||
|
|
||||||
if errorlevel 1 exit /b 1
|
|
||||||
|
|
|
||||||
|
|
@ -47,14 +47,6 @@ if(CUDA_FOUND)
|
||||||
# compiling with, e.g., if a ccache nvcc is fed to us by CUDA_NVCC_EXECUTABLE
|
# compiling with, e.g., if a ccache nvcc is fed to us by CUDA_NVCC_EXECUTABLE
|
||||||
# but the PATH is not consistent with CUDA_HOME. It's better safe
|
# but the PATH is not consistent with CUDA_HOME. It's better safe
|
||||||
# than sorry: make sure everything is consistent.
|
# than sorry: make sure everything is consistent.
|
||||||
if(MSVC AND CMAKE_GENERATOR MATCHES "Visual Studio")
|
|
||||||
# When using Visual Studio, it attempts to lock the whole binary dir when
|
|
||||||
# `try_run` is called, which will cause the build to fail.
|
|
||||||
string(RANDOM BUILD_SUFFIX)
|
|
||||||
set(PROJECT_RANDOM_BINARY_DIR "${PROJECT_BINARY_DIR}/${BUILD_SUFFIX}")
|
|
||||||
else()
|
|
||||||
set(PROJECT_RANDOM_BINARY_DIR "${PROJECT_BINARY_DIR}")
|
|
||||||
endif()
|
|
||||||
set(file "${PROJECT_BINARY_DIR}/detect_cuda_version.cc")
|
set(file "${PROJECT_BINARY_DIR}/detect_cuda_version.cc")
|
||||||
file(WRITE ${file} ""
|
file(WRITE ${file} ""
|
||||||
"#include <cuda.h>\n"
|
"#include <cuda.h>\n"
|
||||||
|
|
@ -64,7 +56,7 @@ if(CUDA_FOUND)
|
||||||
" return 0;\n"
|
" return 0;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
)
|
)
|
||||||
try_run(run_result compile_result ${PROJECT_RANDOM_BINARY_DIR} ${file}
|
try_run(run_result compile_result ${PROJECT_BINARY_DIR} ${file}
|
||||||
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CUDA_INCLUDE_DIRS}"
|
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CUDA_INCLUDE_DIRS}"
|
||||||
LINK_LIBRARIES ${CUDA_LIBRARIES}
|
LINK_LIBRARIES ${CUDA_LIBRARIES}
|
||||||
RUN_OUTPUT_VARIABLE cuda_version_from_header
|
RUN_OUTPUT_VARIABLE cuda_version_from_header
|
||||||
|
|
|
||||||
|
|
@ -59,11 +59,3 @@ if (NOT MSVC)
|
||||||
-Wno-unused-but-set-parameter)
|
-Wno-unused-but-set-parameter)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (INSTALL_TEST)
|
|
||||||
install(TARGETS test_api DESTINATION bin)
|
|
||||||
# Install PDB files for MSVC builds
|
|
||||||
if (MSVC AND BUILD_SHARED_LIBS)
|
|
||||||
install(FILES $<TARGET_PDB_FILE:test_api> DESTINATION bin OPTIONAL)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,3 @@ if (USE_CUDA)
|
||||||
|
|
||||||
target_compile_definitions(test_jit PRIVATE USE_CUDA)
|
target_compile_definitions(test_jit PRIVATE USE_CUDA)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (INSTALL_TEST)
|
|
||||||
install(TARGETS test_jit DESTINATION bin)
|
|
||||||
# Install PDB files for MSVC builds
|
|
||||||
if (MSVC AND BUILD_SHARED_LIBS)
|
|
||||||
install(FILES $<TARGET_PDB_FILE:test_jit> DESTINATION bin OPTIONAL)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
|
||||||
|
|
@ -19,4 +19,4 @@ if __name__ == '__main__':
|
||||||
options = parser.parse_args()
|
options = parser.parse_args()
|
||||||
|
|
||||||
build_caffe2(version=None, cmake_python_library=None, build_python=False,
|
build_caffe2(version=None, cmake_python_library=None, build_python=False,
|
||||||
rerun_cmake=True, cmake_only=False, build_dir='build')
|
rerun_cmake=True, cmake_only=False, build_dir='.')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user