Skip to content

Commit

Permalink
Revert "[Caffe2] Enabling AMD GPU Backend for Caffe2" (pytorch#7802)
Browse files Browse the repository at this point in the history
* Revert "[auto] Update onnx to 4898c9e - Added TensorDenotation and metadata_props for images (onnx/onnx#879) onnx/onnx@4898c9e"

This reverts commit 9c679da.

* Revert "Add BiasCHW fallback for GPU (pytorch#7738)"

This reverts commit 14ad2e7.

* Revert "[Caffe2] Enabling AMD GPU Backend for Caffe2 (pytorch#7566)"

This reverts commit 2ebcf4b.
  • Loading branch information
bddppq authored and weiyangfb committed Jun 11, 2018
1 parent 4b41612 commit df52ef6
Show file tree
Hide file tree
Showing 29 changed files with 15 additions and 2,897 deletions.
4 changes: 0 additions & 4 deletions .jenkins/caffe2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ case "${BUILD_ENVIRONMENT}" in
# Ensure the ccache symlink can still find the real nvcc binary.
export PATH="/usr/local/cuda/bin:$PATH"
;;
*-rocm*)
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
export HCC_AMDGPU_TARGET=gfx900
esac
# Try to include Redis support for Linux builds
Expand Down
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ cmake_dependent_option(
USE_GLOO "Use Gloo" ON
"BUILD_CAFFE2" OFF)
option(USE_GLOO_IBVERBS "Use Gloo IB verbs for distributed support" OFF) # New option
option(USE_HIP "Use HIP" ON)
cmake_dependent_option(
USE_LEVELDB "Use LEVELDB" ON
"BUILD_CAFFE2" OFF)
Expand Down Expand Up @@ -320,11 +319,6 @@ if (USE_CUDA)

endif()

if (USE_HIP)
# TODO: check if we should include other hip dependency libraries
# to the interface as well.

endif()
# Note(jiayq): when building static libraries, all PRIVATE dependencies
# will also become interface libraries, and as a result if there are any
# dependency libraries that are not exported, the following install export
Expand Down
4 changes: 0 additions & 4 deletions aten/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ ENDIF()
# Find the HIP package, set the HIP paths, load the HIP CMake.
IF(WITH_ROCM)
include(LoadHIP)
if (NOT PYTORCH_FOUND_HIP)
MESSAGE(FATAL_ERROR
"Could not find HIP installation")
endif()
ENDIF()

IF(MSVC)
Expand Down
46 changes: 0 additions & 46 deletions caffe2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ endif()
if (CAFFE2_WHITELISTED_FILES)
caffe2_do_whitelist(Caffe2_CPU_SRCS CAFFE2_WHITELISTED_FILES)
caffe2_do_whitelist(Caffe2_GPU_SRCS CAFFE2_WHITELISTED_FILES)
caffe2_do_whitelist(Caffe2_HIP_SRCS CAFFE2_WHITELISTED_FILES)
endif()

# Debug messages - if you want to get a list of source files, enable the
Expand All @@ -72,11 +71,6 @@ if (FALSE)
message(STATUS " " ${tmp})
endforeach()

message(STATUS "HIP sources: ")
foreach(tmp ${Caffe2_HIP_SRCS})
message(STATUS " " ${tmp})
endforeach()

message(STATUS "CPU test sources: ")
foreach(tmp ${Caffe2_CPU_TEST_SRCS})
message(STATUS " " ${tmp})
Expand All @@ -86,11 +80,6 @@ if (FALSE)
foreach(tmp ${Caffe2_GPU_TEST_SRCS})
message(STATUS " " ${tmp})
endforeach()

message(STATUS "HIP test sources: ")
foreach(tmp ${Caffe2_HIP_TEST_SRCS})
message(STATUS " " ${tmp})
endforeach()
endif()

# ---[ Generate and install header files.
Expand Down Expand Up @@ -195,26 +184,6 @@ if(BUILD_CAFFE2)
list(APPEND Caffe2_MAIN_LIBS caffe2_gpu_library)
install(TARGETS caffe2_gpu EXPORT Caffe2Targets DESTINATION lib)
endif()

# ---[ HIP library.
if(USE_HIP)
HIP_ADD_LIBRARY(caffe2_hip ${Caffe2_HIP_SRCS})
set_target_properties(caffe2_hip PROPERTIES COMPILE_FLAGS ${Caffe2_HIP_CXX_FLAGS})

target_include_directories(
caffe2_hip PUBLIC ${Caffe2_HIP_INCLUDES})
target_include_directories(
caffe2_hip INTERFACE $<INSTALL_INTERFACE:include>)

target_link_libraries(caffe2_hip PUBLIC caffe2)
target_link_libraries(caffe2_hip PUBLIC ${Caffe2_HIP_DEPENDENCY_LIBS})

set_target_properties(caffe2_hip PROPERTIES LINKER_LANGUAGE HIP)

caffe2_interface_library(caffe2_hip caffe2_hip_library)
list(APPEND Caffe2_MAIN_LIBS caffe2_hip_library)
install(TARGETS caffe2_hip EXPORT Caffe2Targets DESTINATION lib)
endif()
endif()

# ---[ Test binaries.
Expand All @@ -224,9 +193,6 @@ if(BUILD_CAFFE2)
if (USE_CUDA)
list(APPEND Caffe2_ALL_TEST_SRCS ${Caffe2_GPU_TEST_SRCS})
endif()
if(USE_HIP)
list(APPEND Caffe2_ALL_TEST_SRCS ${Caffe2_HIP_TEST_SRCS})
endif()

foreach(test_src ${Caffe2_ALL_TEST_SRCS})
get_filename_component(test_name ${test_src} NAME_WE)
Expand All @@ -238,18 +204,6 @@ if(BUILD_CAFFE2)
add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
install(TARGETS ${test_name} DESTINATION test)
endforeach()

if(USE_HIP)
foreach(test_src ${Caffe2_HIP_TEST_SRCS})
get_filename_component(test_name ${test_src} NAME_WE)
set_target_properties(${test_name} PROPERTIES COMPILE_FLAGS ${Caffe2_HIP_CXX_FLAGS})
set_target_properties(${test_name} PROPERTIES LINKER_LANGUAGE HIP)
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.0)
target_compile_features(${test_name} PRIVATE cxx_range_for)
endif()
endforeach()
endif()

endif()
endif()

Expand Down
19 changes: 0 additions & 19 deletions caffe2/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,25 @@ set(Caffe2_GPU_SRCS ${Caffe2_GPU_SRCS} ${tmp})
file(GLOB tmp *_test.cc)
exclude(Caffe2_GPU_SRCS "${Caffe2_GPU_SRCS}" ${tmp})

# ---[ HIP files
# ------[ HIP Sources
file(GLOB tmp *_hip.cc)
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} ${tmp})
# ------[ MIOpen files
file(GLOB tmp *_miopen.cc)
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} ${tmp})
# exclude test files
file(GLOB tmp *_test.cc)
exclude(Caffe2_HIP_SRCS "${Caffe2_HIP_SRCS}" ${tmp})

# ---[ CPU files.
file(GLOB tmp *.cc)
set(Caffe2_CPU_SRCS ${Caffe2_CPU_SRCS} ${tmp})
# exclude test files and gpu files
file(GLOB tmp *_test.cc)
exclude(Caffe2_CPU_SRCS "${Caffe2_CPU_SRCS}" ${tmp})
exclude(Caffe2_CPU_SRCS "${Caffe2_CPU_SRCS}" ${Caffe2_GPU_SRCS})
exclude(Caffe2_CPU_SRCS "${Caffe2_CPU_SRCS}" ${Caffe2_HIP_SRCS})

# ---[ GPU test files
file(GLOB tmp *_gpu_test.cc)
set(Caffe2_GPU_TEST_SRCS ${Caffe2_GPU_TEST_SRCS} ${tmp})

# ---[ HIP test files
file(GLOB tmp *_hip_test.cc)
set(Caffe2_HIP_TEST_SRCS ${Caffe2_HIP_TEST_SRCS} ${tmp})

# ---[ CPU test files
file(GLOB tmp *_test.cc)
set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} ${tmp})
exclude(Caffe2_CPU_TEST_SRCS "${Caffe2_CPU_TEST_SRCS}" ${Caffe2_GPU_TEST_SRCS})
exclude(Caffe2_CPU_TEST_SRCS "${Caffe2_CPU_TEST_SRCS}" ${Caffe2_HIP_TEST_SRCS})

# ---[ Send the lists to the parent scope.
set(Caffe2_CPU_SRCS ${Caffe2_CPU_SRCS} PARENT_SCOPE)
set(Caffe2_GPU_SRCS ${Caffe2_GPU_SRCS} PARENT_SCOPE)
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} PARENT_SCOPE)
set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} PARENT_SCOPE)
set(Caffe2_GPU_TEST_SRCS ${Caffe2_GPU_TEST_SRCS} PARENT_SCOPE)
set(Caffe2_HIP_TEST_SRCS ${Caffe2_HIP_TEST_SRCS} PARENT_SCOPE)

0 comments on commit df52ef6

Please sign in to comment.