Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable building the MatrixDiag and OneHot kernels for GPU on Windows. #6822

Merged
merged 4 commits into from Jan 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions tensorflow/contrib/cmake/tf_core_kernels.cmake
Expand Up @@ -102,6 +102,24 @@ file(GLOB_RECURSE tf_core_gpu_kernels_srcs
"${tensorflow_source_dir}/tensorflow/contrib/rnn/kernels/*.cu.cc"
)

if(WIN32 AND tensorflow_ENABLE_GPU)
file(GLOB_RECURSE tf_core_kernels_cpu_only_srcs
# GPU implementation not working on Windows yet.
"${tensorflow_source_dir}/tensorflow/core/kernels/matrix_diag_op.cc"
"${tensorflow_source_dir}/tensorflow/core/kernels/one_hot_op.cc")
list(REMOVE_ITEM tf_core_kernels_srcs ${tf_core_kernels_cpu_only_srcs})
add_library(tf_core_kernels_cpu_only OBJECT ${tf_core_kernels_cpu_only_srcs})
add_dependencies(tf_core_kernels_cpu_only tf_core_cpu)
# Undefine GOOGLE_CUDA to avoid registering unsupported GPU kernel symbols.
get_target_property(target_compile_flags tf_core_kernels_cpu_only COMPILE_FLAGS)
if(target_compile_flags STREQUAL "target_compile_flags-NOTFOUND")
set(target_compile_flags "/UGOOGLE_CUDA")
else()
set(target_compile_flags "${target_compile_flags} /UGOOGLE_CUDA")
endif()
set_target_properties(tf_core_kernels_cpu_only PROPERTIES COMPILE_FLAGS ${target_compile_flags})
endif(WIN32 AND tensorflow_ENABLE_GPU)

add_library(tf_core_kernels OBJECT ${tf_core_kernels_srcs})
add_dependencies(tf_core_kernels tf_core_cpu)

Expand Down
1 change: 1 addition & 0 deletions tensorflow/contrib/cmake/tf_python.cmake
Expand Up @@ -584,6 +584,7 @@ add_library(pywrap_tensorflow SHARED
$<TARGET_OBJECTS:tf_core_direct_session>
$<$<BOOL:${tensorflow_ENABLE_GRPC_SUPPORT}>:$<TARGET_OBJECTS:tf_core_distributed_runtime>>
$<TARGET_OBJECTS:tf_core_kernels>
$<$<BOOL:${tensorflow_ENABLE_GPU}>:$<TARGET_OBJECTS:tf_core_kernels_cpu_only>>
$<$<BOOL:${tensorflow_ENABLE_GPU}>:$<TARGET_OBJECTS:tf_stream_executor>>
)
target_include_directories(pywrap_tensorflow PUBLIC
Expand Down
5 changes: 1 addition & 4 deletions tensorflow/contrib/cmake/tf_tests.cmake
Expand Up @@ -148,13 +148,10 @@ if (tensorflow_BUILD_PYTHON_TESTS)
"${tensorflow_source_dir}/tensorflow/python/kernel_tests/variable_scope_test.py"
"${tensorflow_source_dir}/tensorflow/python/kernel_tests/reshape_op_test.py"
"${tensorflow_source_dir}/tensorflow/tensorboard/backend/server_test.py"
"${tensorflow_source_dir}/tensorflow/python/kernel_tests/diag_op_test.py" # Silently failing with GPU kernel disabled.
# int32/int64 mixup
"${tensorflow_source_dir}/tensorflow/python/kernel_tests/functional_ops_test.py"
"${tensorflow_source_dir}/tensorflow/python/kernel_tests/py_func_test.py"
# cuda launch failed
"${tensorflow_source_dir}/tensorflow/python/kernel_tests/diag_op_test.py"
"${tensorflow_source_dir}/tensorflow/python/kernel_tests/trace_op_test.py"
"${tensorflow_source_dir}/tensorflow/python/kernel_tests/one_hot_op_test.py" # gpu, T=uint8
# training tests
"${tensorflow_source_dir}/tensorflow/python/training/basic_session_run_hooks_test.py" # Needs tf.contrib fix.
"${tensorflow_source_dir}/tensorflow/python/training/localhost_cluster_performance_test.py" # Needs portpicker.
Expand Down