From 7931a73495e1225a04c2040e2970b1c1f302d751 Mon Sep 17 00:00:00 2001 From: Fabian Boemer Date: Wed, 30 Jan 2019 09:19:25 -0800 Subject: [PATCH] Fboemer/ngtf 0.10.0 rc1 (#131) * Updated to ngtf v0.10.0-rc1 --- README.md | 4 ++-- cmake/ngraph-tf.cmake | 2 +- src/CMakeLists.txt | 2 +- src/he_backend.cpp | 11 +++++++---- src/he_tensor.cpp | 3 ++- test/CMakeLists.txt | 4 ++-- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7e677478..339b9352 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ source external/venv-tf-py3/bin/activate ``` ### 2. Run C++ unit-tests -Ensure the virtual environment is active, i.e. run `source $HE_TRANSFORMER /external/venv-tf-py3/bin/activate` +Ensure the virtual environment is active, i.e. run `source $HE_TRANSFORMER/external/venv-tf-py3/bin/activate` ```bash cd $HE_TRANSFORMER/build # To run CKKS unit-test @@ -67,7 +67,7 @@ cd $HE_TRANSFORMER/build ``` ### 3. Run Simple python example -Ensure the virtual environment is active, i.e. run `source $HE_TRANSFORMER /external/venv-tf-py3/bin/activate` +Ensure the virtual environment is active, i.e. run `source $HE_TRANSFORMER/external/venv-tf-py3/bin/activate` ```bash cd $HE_TRANSFORMER/examples # Run with CPU diff --git a/cmake/ngraph-tf.cmake b/cmake/ngraph-tf.cmake index ce040d36..dcca7612 100644 --- a/cmake/ngraph-tf.cmake +++ b/cmake/ngraph-tf.cmake @@ -20,7 +20,7 @@ set(EXTERNAL_NGRAPH_INSTALL_DIR ${EXTERNAL_INSTALL_DIR}) set(NGRAPH_TF_CMAKE_PREFIX ext_ngraph_tf) SET(NGRAPH_TF_REPO_URL https://github.com/NervanaSystems/ngraph-tf.git) -SET(NGRAPH_TF_GIT_LABEL v0.9.0) +SET(NGRAPH_TF_GIT_LABEL v0.10.0-rc1) SET(NGRAPH_TF_SRC_DIR ${CMAKE_BINARY_DIR}/${NGRAPH_TF_CMAKE_PREFIX}/src/${NGRAPH_TF_CMAKE_PREFIX}) SET(NGRAPH_TF_BUILD_DIR ${NGRAPH_TF_SRC_DIR}/build) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 211b99cc..f28eaf7b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -82,7 +82,7 @@ message("NGRAPH_TF_VENV_LIB_DIR ${NGRAPH_TF_VENV_LIB_DIR}") install(TARGETS he_backend DESTINATION ${EXTERNAL_INSTALL_LIB_DIR}) -# Create symbolic links for CKKS and BFV backends, to allow ng-tf to recognize these backends. +# Create symbolic links for CKKS and BFV backends, to allow ngraph and ngraph-tf to recognize these backends. add_custom_target(he_seal_ckks_backend ALL DEPENDS he_backend COMMAND ${CMAKE_COMMAND} -E create_symlink ${EXTERNAL_INSTALL_LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}he_backend${CMAKE_SHARED_LIBRARY_SUFFIX} diff --git a/src/he_backend.cpp b/src/he_backend.cpp index 51140302..c5efe443 100644 --- a/src/he_backend.cpp +++ b/src/he_backend.cpp @@ -562,6 +562,8 @@ void runtime::he::HEBackend::generate_calls( } break; } + case OP_TYPEID::BroadcastLike: + break; case OP_TYPEID::Concat: { const op::Concat* concat = static_cast(&node); @@ -867,6 +869,8 @@ void runtime::he::HEBackend::generate_calls( } break; } + case OP_TYPEID::ScalarConstantLike: + break; case OP_TYPEID::Slice: { const op::Slice* slice = static_cast(&node); Shape in_shape = node.get_input_shape(0); @@ -938,8 +942,10 @@ void runtime::he::HEBackend::generate_calls( // Unsupported ops case OP_TYPEID::Abs: case OP_TYPEID::Acos: + case OP_TYPEID::All: case OP_TYPEID::AllReduce: case OP_TYPEID::And: + case OP_TYPEID::Any: case OP_TYPEID::ArgMax: case OP_TYPEID::ArgMin: case OP_TYPEID::Asin: @@ -956,10 +962,10 @@ void runtime::he::HEBackend::generate_calls( case OP_TYPEID::Cosh: case OP_TYPEID::Dequantize: case OP_TYPEID::Divide: + case OP_TYPEID::EmbeddingLookup: case OP_TYPEID::Equal: case OP_TYPEID::Exp: case OP_TYPEID::Floor: - case OP_TYPEID::FunctionCall: case OP_TYPEID::GenerateMask: case OP_TYPEID::GetOutputElement: case OP_TYPEID::Greater: @@ -981,14 +987,11 @@ void runtime::he::HEBackend::generate_calls( case OP_TYPEID::Power: case OP_TYPEID::Product: case OP_TYPEID::Quantize: - case OP_TYPEID::Reduce: - case OP_TYPEID::ReduceWindow: case OP_TYPEID::Relu: case OP_TYPEID::ReluBackprop: case OP_TYPEID::ReplaceSlice: case OP_TYPEID::ReverseSequence: case OP_TYPEID::Select: - case OP_TYPEID::SelectAndScatter: case OP_TYPEID::ShapeOf: case OP_TYPEID::Sigmoid: case OP_TYPEID::SigmoidBackprop: diff --git a/src/he_tensor.cpp b/src/he_tensor.cpp index bf6f214e..58248513 100644 --- a/src/he_tensor.cpp +++ b/src/he_tensor.cpp @@ -27,7 +27,8 @@ runtime::he::HETensor::HETensor(const element::Type& element_type, const Shape& shape, const HEBackend* he_backend, bool batched, const string& name) : runtime::Tensor(std::make_shared( - element_type, batch_shape(shape, 0, batched), name)), + element_type, batch_shape(shape, 0, batched), name), + he_backend), m_he_backend(he_backend), m_batched(batched) { m_descriptor->set_tensor_layout( diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8635b43b..001b0b28 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -94,11 +94,11 @@ if(NGRAPH_HE_SANITIZE_ADDRESS) endif() # Add ngraph test utils library -add_library(ngraph_test_util SHARED IMPORTED) +add_library(ngraph_test_util STATIC IMPORTED) set_target_properties( ngraph_test_util PROPERTIES IMPORTED_LOCATION - ${NGRAPH_TF_LIB_DIR}/libngraph_test_util.so + ${NGRAPH_TF_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}ngraph_test_util${CMAKE_STATIC_LIBRARY_SUFFIX} ) target_link_libraries(unit-test libgtest ngraph)