Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ cc_library(
"ngraph_bridge/ngraph_builder.h",
"ngraph_bridge/ngraph_backend_config.h",
"ngraph_bridge/ngraph_backend_manager.h",
"ngraph_bridge/ngraph_bridge_registry.h",
"ngraph_bridge/ngraph_capture_variables.h",
"ngraph_bridge/ngraph_cluster_manager.h",
"ngraph_bridge/ngraph_conversions.h",
Expand Down Expand Up @@ -62,7 +61,6 @@ cc_binary(
"ngraph_bridge/ngraph_assign_clusters.h",
"ngraph_bridge/ngraph_builder.cc",
"ngraph_bridge/ngraph_backend_manager.cc",
"ngraph_bridge/ngraph_bridge_registry.cc",
"ngraph_bridge/ngraph_capture_variables.cc",
"ngraph_bridge/ngraph_cluster_manager.cc",
"ngraph_bridge/ngraph_deassign_clusters.cc",
Expand Down
7 changes: 4 additions & 3 deletions examples/cpp/infer_multiple_networks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ if (APPLE)
endif()

if(NGRAPH_BRIDGE_STATIC_LIB_ENABLE)
target_link_libraries(
infer_multiple_networks
ngraph_bridge_static
target_link_libraries(infer_multiple_networks
-Wl,--whole-archive
ngraph_bridge_static
-Wl,--no-whole-archive
ngraph_lib
lib_cpu_backend_static
lib_interpreter_backend_static
Expand Down
13 changes: 8 additions & 5 deletions examples/cpp/infer_multiple_networks/inference_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,21 @@ Status InferenceEngine::CreateSession(const string& graph_filename,
// The following is related to Grappler - which we are turning off
// Until we get a library fully running
if (tf::ngraph_bridge::ngraph_tf_is_grappler_enabled()) {
options.config.mutable_graph_options()
->mutable_rewrite_options()
->add_custom_optimizers()
->set_name("ngraph-optimizer");
auto* custom_config = options.config.mutable_graph_options()
->mutable_rewrite_options()
->add_custom_optimizers();

custom_config->set_name("ngraph-optimizer");
(*custom_config->mutable_parameter_map())["ngraph_backend"].set_s("CPU");
(*custom_config->mutable_parameter_map())["device_id"].set_s("1");

options.config.mutable_graph_options()
->mutable_rewrite_options()
->set_min_graph_nodes(-1);

options.config.mutable_graph_options()
->mutable_rewrite_options()
->set_meta_optimizer_iterations(RewriterConfig::ONE);
->set_meta_optimizer_iterations(tensorflow::RewriterConfig::ONE);
}

// Load the network
Expand Down
6 changes: 4 additions & 2 deletions examples/cpp/infer_single/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ if (APPLE)
endif()

if(NGRAPH_BRIDGE_STATIC_LIB_ENABLE)
target_link_libraries(
infer_single ngraph_bridge_static
target_link_libraries(infer_single
-Wl,--whole-archive
ngraph_bridge_static
-Wl,--no-whole-archive
ngraph_lib
lib_cpu_backend_static
lib_interpreter_backend_static
Expand Down
2 changes: 0 additions & 2 deletions ngraph_bridge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ set(SRC
ngraph_assign_clusters.cc
ngraph_builder.cc
ngraph_backend_manager.cc
ngraph_bridge_registry.cc
ngraph_capture_variables.cc
ngraph_cluster_manager.cc
ngraph_conversions.cc
Expand Down Expand Up @@ -147,7 +146,6 @@ if(NGRAPH_BRIDGE_STATIC_LIB_ENABLE)

target_link_libraries(
${LIB_NAME_STATIC}
ngraph_logger
ngraph_logger
${TensorFlow_FRAMEWORK_LIBRARY}
ngraph_lib
Expand Down
8 changes: 1 addition & 7 deletions ngraph_bridge/enable_variable_ops/ops/ngraph_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

#include "tensorflow/core/common_runtime/optimization_registry.h"

#include "ngraph_bridge/ngraph_bridge_registry.h"

namespace tensorflow {

namespace ngraph_bridge {
Expand Down Expand Up @@ -101,9 +99,5 @@ REGISTER_OP("NGraphVariable")
.SetIsStateful()
.SetShapeFn(shape_inference::ExplicitShape);

#ifdef NGRAPH_BRIDGE_STATIC_LIB_ENABLE
void register_ngraph_enable_variable_ops() {}
#endif

} // namespace ngraph_bridge
} // namespace tensorflow
} // namespace tensorflow
36 changes: 0 additions & 36 deletions ngraph_bridge/ngraph_bridge_registry.cc

This file was deleted.

34 changes: 0 additions & 34 deletions ngraph_bridge/ngraph_bridge_registry.h

This file was deleted.

6 changes: 0 additions & 6 deletions ngraph_bridge/ngraph_encapsulate_clusters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include "logging/tf_graph_writer.h"
#include "ngraph_bridge/ngraph_api.h"
#include "ngraph_bridge/ngraph_assign_clusters.h"
#include "ngraph_bridge/ngraph_bridge_registry.h"
#include "ngraph_bridge/ngraph_builder.h"
#include "ngraph_bridge/ngraph_cluster_manager.h"
#include "ngraph_bridge/ngraph_encapsulate_clusters.h"
Expand Down Expand Up @@ -100,11 +99,6 @@ Status EncapsulateClusters(
// A map from cluster indices to corresponding NGraphEncapsulate nodes.
std::map<int, Node*> cluster_node_map;

// reference all the bridge ops for static library
#ifdef NGRAPH_BRIDGE_STATIC_LIB_ENABLE
register_ngraph_bridge();
#endif

// Pass 1: Populate the cluster-index-to-device name map for each existing
// cluster. PIGGYBACKING BACKEND TEST HERE, THEY WILL GET COMBINED INTO ONE
for (auto node : graph->op_nodes()) {
Expand Down
6 changes: 0 additions & 6 deletions ngraph_bridge/ops/ngraph_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

#include "tensorflow/core/common_runtime/optimization_registry.h"

#include "ngraph_bridge/ngraph_bridge_registry.h"

namespace tensorflow {

namespace ngraph_bridge {
Expand Down Expand Up @@ -46,9 +44,5 @@ REGISTER_OP("NGraphVariable")
.SetIsStateful()
.SetShapeFn(shape_inference::ExplicitShape);

#ifdef NGRAPH_BRIDGE_STATIC_LIB_ENABLE
void register_ngraph_ops() {}
#endif

} // namespace ngraph_bridge
} // namespace tensorflow
7 changes: 4 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ if (APPLE)
endif()

if(NGRAPH_BRIDGE_STATIC_LIB_ENABLE)
target_link_libraries(
gtest_ngtf
ngraph_bridge_static
target_link_libraries(gtest_ngtf
-Wl,--whole-archive
ngraph_bridge_static
-Wl,--no-whole-archive
ngraph_lib
lib_cpu_backend_static
lib_interpreter_backend_static
Expand Down