diff --git a/CMakeLists.txt b/CMakeLists.txt index 5486b6f98df2ad32a75bece4eb49885c671fc9a7..3b21d33489dbce4894ae323fc62dafd5f59fdb31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,8 +65,8 @@ endif() if (NOT CLIENT_ONLY) include(external/jsoncpp) include(external/rocksdb) -include(external/gtest) endif() +#include(external/gtest) include(external/snappy) include(external/leveldb) diff --git a/cmake/external/gtest.cmake b/cmake/external/gtest.cmake index 82af574574dae191aedc785e7aa4cedcf4c88330..cc844acf44091a35ff55410582b2e8dcd89404ac 100644 --- a/cmake/external/gtest.cmake +++ b/cmake/external/gtest.cmake @@ -28,7 +28,7 @@ ExternalProject_Add( GIT_TAG master UPDATE_COMMAND "" CONFIGURE_COMMAND "" - BUILD_COMMAND CXXFLAGS=-fPIC && mkdir build && cd build && cmake .. && make -j ${NUM_OF_PROCESSOR} gtest + BUILD_COMMAND CXXFLAGS=-fPIC && mkdir -p build && cd build && cmake .. && make -j ${NUM_OF_PROCESSOR} gtest INSTALL_COMMAND mkdir -p ${GTEST_INSTALL_DIR}/lib/ && cp ${GTEST_SOURCES_DIR}/src/extern_gtest/build/lib/libgtest.a ${GTEST_LIBRARIES} && cp -r ${GTEST_SOURCES_DIR}/src/extern_gtest/googletest/include ${GTEST_INSTALL_DIR}/ @@ -41,4 +41,3 @@ ADD_LIBRARY(gtest STATIC IMPORTED GLOBAL) SET_PROPERTY(TARGET gtest PROPERTY IMPORTED_LOCATION ${GTEST_LIBRARIES}) LIST(APPEND external_project_dependencies gtest) - diff --git a/core/cube/cube-server/CMakeLists.txt b/core/cube/cube-server/CMakeLists.txt index d9b4012409eefb9f2c1016536b09935e4a030ca7..e33b0b00de65738dbbf83c44a6af6508b96c5cb1 100644 --- a/core/cube/cube-server/CMakeLists.txt +++ b/core/cube/cube-server/CMakeLists.txt @@ -67,10 +67,10 @@ endif() target_link_libraries(cube brpc ${DYNAMIC_LIB} -lpthread -ldl -lz) -add_executable(cube_test ${SRC_LIST} test/cube_test.cpp - ${PROTO_SRC} ${PROTO_HEADER}) +#add_executable(cube_test ${SRC_LIST} test/cube_test.cpp +# ${PROTO_SRC} ${PROTO_HEADER}) -target_link_libraries(cube_test brpc ${DYNAMIC_LIB} gtest -lpthread -ldl -lz) +#target_link_libraries(cube_test brpc ${DYNAMIC_LIB} gtest -lpthread -ldl -lz) # install install(TARGETS cube diff --git a/core/kvdb/CMakeLists.txt b/core/kvdb/CMakeLists.txt index 8eb2ee42cdbe1ff3982af9d375de0d9d2434f15b..e81d32da4a54f98eeb10f2855336463c5d7e6b99 100644 --- a/core/kvdb/CMakeLists.txt +++ b/core/kvdb/CMakeLists.txt @@ -1,54 +1,21 @@ include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/include) -set(SRC_LIST ${CMAKE_CURRENT_LIST_DIR}/src/test_rocksdb.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/rockskvdb_impl.cpp +set(SRC_LIST ${CMAKE_CURRENT_LIST_DIR}/src/rockskvdb_impl.cpp ${CMAKE_CURRENT_LIST_DIR}/src/param_dict_mgr_impl.cpp ${CMAKE_CURRENT_LIST_DIR}/src/mock_param_dict_impl.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/paddle_rocksdb.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/gtest_kvdb.cpp) + ${CMAKE_CURRENT_LIST_DIR}/src/paddle_rocksdb.cpp) add_library(kvdb ${SRC_LIST}) add_dependencies(kvdb rocksdb) install(TARGETS kvdb ARCHIVE DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/lib/) -add_executable(kvdb_test ${SRC_LIST}) -add_dependencies(kvdb_test rocksdb) -target_link_libraries(kvdb_test rocksdb bz2 snappy zlib gtest) -#target_include_directories(kvdb_test PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include/kvdb) -set(SRC_LIST2 ${CMAKE_CURRENT_LIST_DIR}/src/gtest_db_thread.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/rockskvdb_impl.cpp +set(SRC_LIST2 ${CMAKE_CURRENT_LIST_DIR}/src/rockskvdb_impl.cpp ${CMAKE_CURRENT_LIST_DIR}/src/param_dict_mgr_impl.cpp ${CMAKE_CURRENT_LIST_DIR}/src/mock_param_dict_impl.cpp ${CMAKE_CURRENT_LIST_DIR}/src/paddle_rocksdb.cpp) - -add_executable(db_thread ${SRC_LIST2}) -add_dependencies(db_thread rocksdb) -target_link_libraries(db_thread rocksdb bz2 snappy zlib gtest) -#target_include_directories(db_thread PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include/kvdb) - - -set(SRC_LIST3 ${CMAKE_CURRENT_LIST_DIR}/src/gtest_db_func.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/rockskvdb_impl.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/param_dict_mgr_impl.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/mock_param_dict_impl.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/paddle_rocksdb.cpp) - -add_executable(db_func ${SRC_LIST3}) -add_dependencies(db_func rocksdb) -target_link_libraries(db_func rocksdb bz2 snappy zlib gtest) -#target_include_directories(db_func PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include/kvdb) - -install(TARGETS kvdb_test - RUNTIME DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/demo/kvdb_test) -install(TARGETS db_thread - RUNTIME DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/demo/db_thread) -install(TARGETS db_func - RUNTIME DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/demo/db_func) - - file(GLOB kvdb_headers "${CMAKE_CURRENT_LIST_DIR}/include/kvdb/*.h") install(FILES ${kvdb_headers} DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/include/kvdb/) diff --git a/core/kvdb/src/gtest_db_func.cpp b/core/tests/gtest_db_func.cpp similarity index 100% rename from core/kvdb/src/gtest_db_func.cpp rename to core/tests/gtest_db_func.cpp diff --git a/core/kvdb/src/gtest_db_thread.cpp b/core/tests/gtest_db_thread.cpp similarity index 100% rename from core/kvdb/src/gtest_db_thread.cpp rename to core/tests/gtest_db_thread.cpp diff --git a/core/kvdb/src/gtest_kvdb.cpp b/core/tests/gtest_kvdb.cpp similarity index 100% rename from core/kvdb/src/gtest_kvdb.cpp rename to core/tests/gtest_kvdb.cpp diff --git a/core/kvdb/src/test_rocksdb.cpp b/core/tests/test_rocksdb.cpp similarity index 100% rename from core/kvdb/src/test_rocksdb.cpp rename to core/tests/test_rocksdb.cpp diff --git a/doc/README_CN.md b/doc/README_CN.md new file mode 100644 index 0000000000000000000000000000000000000000..7bdcbe40280c954187e3ff619b4f7cf8e6f47a7d --- /dev/null +++ b/doc/README_CN.md @@ -0,0 +1,114 @@ +# Paddle Serving + +Paddle Serving是PaddlePaddle的在线预估服务框架,能够帮助开发者轻松实现从移动端、服务器端调用深度学习模型的远程预测服务。当前Paddle Serving以支持PaddlePaddle训练的模型为主,可以与Paddle训练框架联合使用,快速部署预估服务。Paddle Serving围绕常见的工业级深度学习模型部署场景进行设计,一些常见的功能包括多模型管理、模型热加载、基于[Baidu-rpc](https://github.com/apache/incubator-brpc)的高并发低延迟响应能力、在线模型A/B实验等。与Paddle训练框架互相配合的API可以使用户在训练与远程部署之间无缝过度,提升深度学习模型的落地效率。 + +------------ + +## 快速上手指南 + +Paddle Serving当前的develop版本支持轻量级Python API进行快速预测,并且与Paddle的训练可以打通。我们以最经典的波士顿房价预测为示例,完整说明在单机进行模型训练以及使用Paddle Serving进行模型部署的过程。 + +#### 安装 +``` +pip install paddle-serving-client +pip install paddle-serving-server +``` + +#### 训练脚本 +``` python +import sys +import paddle +import paddle.fluid as fluid + +train_reader = paddle.batch(paddle.reader.shuffle( + paddle.dataset.uci_housing.train(), buf_size=500), batch_size=16) + +test_reader = paddle.batch(paddle.reader.shuffle( + paddle.dataset.uci_housing.test(), buf_size=500), batch_size=16) + +x = fluid.data(name='x', shape=[None, 13], dtype='float32') +y = fluid.data(name='y', shape=[None, 1], dtype='float32') + +y_predict = fluid.layers.fc(input=x, size=1, act=None) +cost = fluid.layers.square_error_cost(input=y_predict, label=y) +avg_loss = fluid.layers.mean(cost) +sgd_optimizer = fluid.optimizer.SGD(learning_rate=0.01) +sgd_optimizer.minimize(avg_loss) + +place = fluid.CPUPlace() +feeder = fluid.DataFeeder(place=place, feed_list=[x, y]) +exe = fluid.Executor(place) +exe.run(fluid.default_startup_program()) + +import paddle_serving_client.io as serving_io + +for pass_id in range(30): + for data_train in train_reader(): + avg_loss_value, = exe.run( + fluid.default_main_program(), + feed=feeder.feed(data_train), + fetch_list=[avg_loss]) + +serving_io.save_model( + "serving_server_model", "serving_client_conf", + {"x": x}, {"y": y_predict}, fluid.default_main_program()) +``` + +#### 服务器端代码 +``` python +import sys +from paddle_serving.serving_server import OpMaker +from paddle_serving.serving_server import OpSeqMaker +from paddle_serving.serving_server import Server + +op_maker = OpMaker() +read_op = op_maker.create('general_reader') +general_infer_op = op_maker.create('general_infer') + +op_seq_maker = OpSeqMaker() +op_seq_maker.add_op(read_op) +op_seq_maker.add_op(general_infer_op) + +server = Server() +server.set_op_sequence(op_seq_maker.get_op_sequence()) +server.load_model_config(sys.argv[1]) +server.prepare_server(workdir="work_dir1", port=9393, device="cpu") +server.run_server() +``` + +#### 服务器端启动 +``` shell +python test_server.py serving_server_model +``` + +#### 客户端预测 +``` python +from paddle_serving_client import Client +import paddle +import sys + +client = Client() +client.load_client_config(sys.argv[1]) +client.connect(["127.0.0.1:9292"]) + +test_reader = paddle.batch(paddle.reader.shuffle( + paddle.dataset.uci_housing.test(), buf_size=500), batch_size=1) + +for data in test_reader(): + fetch_map = client.predict(feed={"x": data[0][0]}, fetch=["y"]) + print("{} {}".format(fetch_map["y"][0], data[0][1][0])) + +``` + +### 文档 + +[设计文档](doc/DESIGN.md) + +[FAQ](doc/FAQ.md) + +### 资深开发者使用指南 + +[编译指南](doc/INSTALL.md) + +## 贡献 +如果你想要给Paddle Serving做贡献,请参考[贡献指南](doc/CONTRIBUTE.md) diff --git a/doc/README_EN.md b/doc/README_EN.md new file mode 100644 index 0000000000000000000000000000000000000000..5a0b61138f96f01387c5586ebdfe4cdd1354e154 --- /dev/null +++ b/doc/README_EN.md @@ -0,0 +1,126 @@ +# Paddle Serving + +Paddle Serving is the online inference service framework of [Paddle](https://github.com/PaddlePaddle/Paddle) that can help developers easily deploy a deep learning model service on server side and send request from mobile devices, edge devices as well as data centers. Currently, Paddle Serving supports the deep learning models produced by Paddle althought it can be very easy to support other deep learning framework's model inference. Paddle Serving is designed oriented from industrial practice. For example, multiple models management for online service, double buffers model loading, models online A/B testing are supported. Highly concurrent [Baidu-rpc](https://github.com/apache/incubator-brpc) is used as the underlying communication library which is also from industry practice. Paddle Serving provides user-friendly API that can integrate with Paddle training code seamlessly, and users can finish model training and model serving in an end-to-end fasion. + + + +## Quick Start + +Paddle Serving supports light-weighted Python API for model inference and can be integrated with trainining process seemlessly. Here is a Boston House Pricing example for users to do quick start. + +### Installation + +```shell +pip install paddle-serving-client +pip install paddle-serving-server +``` + +### Training Scripts + +``` python +import sys +import paddle +import paddle.fluid as fluid + +train_reader = paddle.batch(paddle.reader.shuffle( + paddle.dataset.uci_housing.train(), buf_size=500), batch_size=16) + +test_reader = paddle.batch(paddle.reader.shuffle( + paddle.dataset.uci_housing.test(), buf_size=500), batch_size=16) + +x = fluid.data(name='x', shape=[None, 13], dtype='float32') +y = fluid.data(name='y', shape=[None, 1], dtype='float32') + +y_predict = fluid.layers.fc(input=x, size=1, act=None) +cost = fluid.layers.square_error_cost(input=y_predict, label=y) +avg_loss = fluid.layers.mean(cost) +sgd_optimizer = fluid.optimizer.SGD(learning_rate=0.01) +sgd_optimizer.minimize(avg_loss) + +place = fluid.CPUPlace() +feeder = fluid.DataFeeder(place=place, feed_list=[x, y]) +exe = fluid.Executor(place) +exe.run(fluid.default_startup_program()) + +import paddle_serving_client.io as serving_io + +for pass_id in range(30): + for data_train in train_reader(): + avg_loss_value, = exe.run( + fluid.default_main_program(), + feed=feeder.feed(data_train), + fetch_list=[avg_loss]) + +serving_io.save_model( + "serving_server_model", "serving_client_conf", + {"x": x}, {"y": y_predict}, fluid.default_main_program()) +``` + + + +### Server Side Scripts + +``` +import sys +from paddle_serving.serving_server import OpMaker +from paddle_serving.serving_server import OpSeqMaker +from paddle_serving.serving_server import Server + +op_maker = OpMaker() +read_op = op_maker.create('general_reader') +general_infer_op = op_maker.create('general_infer') + +op_seq_maker = OpSeqMaker() +op_seq_maker.add_op(read_op) +op_seq_maker.add_op(general_infer_op) + +server = Server() +server.set_op_sequence(op_seq_maker.get_op_sequence()) +server.load_model_config(sys.argv[1]) +server.prepare_server(workdir="work_dir1", port=9393, device="cpu") +``` + +### Start Server + +``` +python test_server.py serving_server_model +``` + +### Client Side Scripts + +``` +from paddle_serving_client import Client +import paddle +import sys + +client = Client() +client.load_client_config(sys.argv[1]) +client.connect(["127.0.0.1:9292"]) + +test_reader = paddle.batch(paddle.reader.shuffle( + paddle.dataset.uci_housing.test(), buf_size=500), batch_size=1) + +for data in test_reader(): + fetch_map = client.predict(feed={"x": data[0][0]}, fetch=["y"]) + print("{} {}".format(fetch_map["y"][0], data[0][1][0])) + + +``` + + + +### Document + +[Design Doc(Chinese)](doc/DESIGN.md) + +[FAQ(Chinese)](doc/FAQ.md) + +### Advanced features and development + +[Develop a serving application with C++(Chinese)](doc/CREATING.md) + +[Compile from source code(Chinese)](doc/INSTALL.md) + +## Contribution + +If you want to contribute code to Paddle Serving, please reference [Contribution Guidelines]( diff --git a/Dockerfile b/tools/Dockerfile similarity index 100% rename from Dockerfile rename to tools/Dockerfile diff --git a/Dockerfile.gpu b/tools/Dockerfile.gpu similarity index 100% rename from Dockerfile.gpu rename to tools/Dockerfile.gpu diff --git a/examples/CMakeLists.txt b/tools/cpp_examples/CMakeLists.txt similarity index 100% rename from examples/CMakeLists.txt rename to tools/cpp_examples/CMakeLists.txt diff --git a/examples/bert-gpu-serving/client/bert_service/bert_service.py b/tools/cpp_examples/bert-gpu-serving/client/bert_service/bert_service.py similarity index 100% rename from examples/bert-gpu-serving/client/bert_service/bert_service.py rename to tools/cpp_examples/bert-gpu-serving/client/bert_service/bert_service.py diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/README.md b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/README.md similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/README.md rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/README.md diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/__init__.py b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/__init__.py similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/__init__.py rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/__init__.py diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/run/__init__.py b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/run/__init__.py similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/run/__init__.py rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/run/__init__.py diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/cube.conf b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/cube.conf similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/cube.conf rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/cube.conf diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/gflags.conf b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/gflags.conf similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/gflags.conf rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/gflags.conf diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.0 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.0 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.0 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.0 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.1 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.1 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.1 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.1 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.10 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.10 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.10 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.10 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.11 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.11 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.11 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.11 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.12 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.12 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.12 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.12 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.13 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.13 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.13 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.13 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.14 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.14 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.14 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.14 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.15 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.15 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.15 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.15 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.2 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.2 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.2 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.2 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.3 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.3 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.3 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.3 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.4 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.4 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.4 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.4 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.5 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.5 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.5 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.5 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.6 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.6 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.6 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.6 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.7 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.7 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.7 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.7 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.8 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.8 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.8 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.8 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.9 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.9 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.9 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/model_toolkit.prototxt.9 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.0 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.0 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.0 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.0 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.1 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.1 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.1 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.1 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.10 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.10 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.10 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.10 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.11 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.11 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.11 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.11 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.12 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.12 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.12 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.12 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.13 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.13 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.13 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.13 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.14 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.14 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.14 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.14 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.15 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.15 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.15 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.15 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.2 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.2 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.2 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.2 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.3 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.3 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.3 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.3 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.4 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.4 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.4 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.4 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.5 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.5 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.5 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.5 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.6 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.6 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.6 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.6 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.7 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.7 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.7 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.7 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.8 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.8 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.8 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.8 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.9 b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.9 similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.9 rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/resource.prototxt.9 diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/service.prototxt b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/service.prototxt similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/service.prototxt rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/service.prototxt diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/workflow.prototxt b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/workflow.prototxt similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/workflow.prototxt rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/conf/workflow.prototxt diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/data/model/paddle/fluid_reload_flag b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/data/model/paddle/fluid_reload_flag similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/data/model/paddle/fluid_reload_flag rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/data/model/paddle/fluid_reload_flag diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/data/model/paddle/fluid_time_file b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/data/model/paddle/fluid_time_file similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/data/model/paddle/fluid_time_file rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/paddle_gpu_serving/server/data/model/paddle/fluid_time_file diff --git a/examples/bert-gpu-serving/paddle-gpu-serving/setup.py b/tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/setup.py similarity index 100% rename from examples/bert-gpu-serving/paddle-gpu-serving/setup.py rename to tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/setup.py diff --git a/examples/demo-client/CMakeLists.txt b/tools/cpp_examples/demo-client/CMakeLists.txt similarity index 100% rename from examples/demo-client/CMakeLists.txt rename to tools/cpp_examples/demo-client/CMakeLists.txt diff --git a/examples/demo-client/conf/predictors.prototxt b/tools/cpp_examples/demo-client/conf/predictors.prototxt similarity index 100% rename from examples/demo-client/conf/predictors.prototxt rename to tools/cpp_examples/demo-client/conf/predictors.prototxt diff --git a/examples/demo-client/inference.conf b/tools/cpp_examples/demo-client/inference.conf similarity index 100% rename from examples/demo-client/inference.conf rename to tools/cpp_examples/demo-client/inference.conf diff --git a/examples/demo-client/paddle_serving_client.egg-info/PKG-INFO b/tools/cpp_examples/demo-client/paddle_serving_client.egg-info/PKG-INFO similarity index 100% rename from examples/demo-client/paddle_serving_client.egg-info/PKG-INFO rename to tools/cpp_examples/demo-client/paddle_serving_client.egg-info/PKG-INFO diff --git a/examples/demo-client/paddle_serving_client.egg-info/SOURCES.txt b/tools/cpp_examples/demo-client/paddle_serving_client.egg-info/SOURCES.txt similarity index 100% rename from examples/demo-client/paddle_serving_client.egg-info/SOURCES.txt rename to tools/cpp_examples/demo-client/paddle_serving_client.egg-info/SOURCES.txt diff --git a/examples/demo-client/paddle_serving_client.egg-info/dependency_links.txt b/tools/cpp_examples/demo-client/paddle_serving_client.egg-info/dependency_links.txt similarity index 100% rename from examples/demo-client/paddle_serving_client.egg-info/dependency_links.txt rename to tools/cpp_examples/demo-client/paddle_serving_client.egg-info/dependency_links.txt diff --git a/examples/demo-client/paddle_serving_client.egg-info/not-zip-safe b/tools/cpp_examples/demo-client/paddle_serving_client.egg-info/not-zip-safe similarity index 100% rename from examples/demo-client/paddle_serving_client.egg-info/not-zip-safe rename to tools/cpp_examples/demo-client/paddle_serving_client.egg-info/not-zip-safe diff --git a/examples/demo-client/paddle_serving_client.egg-info/top_level.txt b/tools/cpp_examples/demo-client/paddle_serving_client.egg-info/top_level.txt similarity index 100% rename from examples/demo-client/paddle_serving_client.egg-info/top_level.txt rename to tools/cpp_examples/demo-client/paddle_serving_client.egg-info/top_level.txt diff --git a/examples/demo-client/php/echo.php b/tools/cpp_examples/demo-client/php/echo.php similarity index 100% rename from examples/demo-client/php/echo.php rename to tools/cpp_examples/demo-client/php/echo.php diff --git a/examples/demo-client/php/text_classification.php b/tools/cpp_examples/demo-client/php/text_classification.php similarity index 100% rename from examples/demo-client/php/text_classification.php rename to tools/cpp_examples/demo-client/php/text_classification.php diff --git a/examples/demo-client/predictor.conf b/tools/cpp_examples/demo-client/predictor.conf similarity index 100% rename from examples/demo-client/predictor.conf rename to tools/cpp_examples/demo-client/predictor.conf diff --git a/examples/demo-client/python/echo.py b/tools/cpp_examples/demo-client/python/echo.py similarity index 100% rename from examples/demo-client/python/echo.py rename to tools/cpp_examples/demo-client/python/echo.py diff --git a/examples/demo-client/python/text_classification.py b/tools/cpp_examples/demo-client/python/text_classification.py similarity index 100% rename from examples/demo-client/python/text_classification.py rename to tools/cpp_examples/demo-client/python/text_classification.py diff --git a/examples/demo-client/src/bert_service.cpp b/tools/cpp_examples/demo-client/src/bert_service.cpp similarity index 100% rename from examples/demo-client/src/bert_service.cpp rename to tools/cpp_examples/demo-client/src/bert_service.cpp diff --git a/examples/demo-client/src/ctr_prediction.cpp b/tools/cpp_examples/demo-client/src/ctr_prediction.cpp similarity index 100% rename from examples/demo-client/src/ctr_prediction.cpp rename to tools/cpp_examples/demo-client/src/ctr_prediction.cpp diff --git a/examples/demo-client/src/dense_format.cpp b/tools/cpp_examples/demo-client/src/dense_format.cpp similarity index 100% rename from examples/demo-client/src/dense_format.cpp rename to tools/cpp_examples/demo-client/src/dense_format.cpp diff --git a/examples/demo-client/src/echo.cpp b/tools/cpp_examples/demo-client/src/echo.cpp similarity index 100% rename from examples/demo-client/src/echo.cpp rename to tools/cpp_examples/demo-client/src/echo.cpp diff --git a/examples/demo-client/src/echo_kvdb.cpp b/tools/cpp_examples/demo-client/src/echo_kvdb.cpp similarity index 100% rename from examples/demo-client/src/echo_kvdb.cpp rename to tools/cpp_examples/demo-client/src/echo_kvdb.cpp diff --git a/examples/demo-client/src/general_model.cpp b/tools/cpp_examples/demo-client/src/general_model.cpp similarity index 100% rename from examples/demo-client/src/general_model.cpp rename to tools/cpp_examples/demo-client/src/general_model.cpp diff --git a/examples/demo-client/src/general_model.h b/tools/cpp_examples/demo-client/src/general_model.h similarity index 100% rename from examples/demo-client/src/general_model.h rename to tools/cpp_examples/demo-client/src/general_model.h diff --git a/examples/demo-client/src/general_model_main.cpp b/tools/cpp_examples/demo-client/src/general_model_main.cpp similarity index 100% rename from examples/demo-client/src/general_model_main.cpp rename to tools/cpp_examples/demo-client/src/general_model_main.cpp diff --git a/examples/demo-client/src/int64tensor_format.cpp b/tools/cpp_examples/demo-client/src/int64tensor_format.cpp similarity index 100% rename from examples/demo-client/src/int64tensor_format.cpp rename to tools/cpp_examples/demo-client/src/int64tensor_format.cpp diff --git a/examples/demo-client/src/load_general_model.cpp b/tools/cpp_examples/demo-client/src/load_general_model.cpp similarity index 100% rename from examples/demo-client/src/load_general_model.cpp rename to tools/cpp_examples/demo-client/src/load_general_model.cpp diff --git a/examples/demo-client/src/pybind_general_model.cpp b/tools/cpp_examples/demo-client/src/pybind_general_model.cpp similarity index 100% rename from examples/demo-client/src/pybind_general_model.cpp rename to tools/cpp_examples/demo-client/src/pybind_general_model.cpp diff --git a/examples/demo-client/src/sparse_format.cpp b/tools/cpp_examples/demo-client/src/sparse_format.cpp similarity index 100% rename from examples/demo-client/src/sparse_format.cpp rename to tools/cpp_examples/demo-client/src/sparse_format.cpp diff --git a/examples/demo-client/src/text_classification.cpp b/tools/cpp_examples/demo-client/src/text_classification.cpp similarity index 100% rename from examples/demo-client/src/text_classification.cpp rename to tools/cpp_examples/demo-client/src/text_classification.cpp diff --git a/examples/demo-client/src/text_classification_press.cpp b/tools/cpp_examples/demo-client/src/text_classification_press.cpp similarity index 100% rename from examples/demo-client/src/text_classification_press.cpp rename to tools/cpp_examples/demo-client/src/text_classification_press.cpp diff --git a/examples/demo-client/src/ximage.cpp b/tools/cpp_examples/demo-client/src/ximage.cpp similarity index 100% rename from examples/demo-client/src/ximage.cpp rename to tools/cpp_examples/demo-client/src/ximage.cpp diff --git a/examples/demo-client/src/ximage_press.cpp b/tools/cpp_examples/demo-client/src/ximage_press.cpp similarity index 100% rename from examples/demo-client/src/ximage_press.cpp rename to tools/cpp_examples/demo-client/src/ximage_press.cpp diff --git a/examples/demo-serving/CMakeLists.txt b/tools/cpp_examples/demo-serving/CMakeLists.txt similarity index 100% rename from examples/demo-serving/CMakeLists.txt rename to tools/cpp_examples/demo-serving/CMakeLists.txt diff --git a/examples/demo-serving/conf/cube.conf b/tools/cpp_examples/demo-serving/conf/cube.conf similarity index 100% rename from examples/demo-serving/conf/cube.conf rename to tools/cpp_examples/demo-serving/conf/cube.conf diff --git a/examples/demo-serving/conf/general_model.prototxt b/tools/cpp_examples/demo-serving/conf/general_model.prototxt similarity index 100% rename from examples/demo-serving/conf/general_model.prototxt rename to tools/cpp_examples/demo-serving/conf/general_model.prototxt diff --git a/examples/demo-serving/conf/gflags.conf b/tools/cpp_examples/demo-serving/conf/gflags.conf similarity index 100% rename from examples/demo-serving/conf/gflags.conf rename to tools/cpp_examples/demo-serving/conf/gflags.conf diff --git a/examples/demo-serving/conf/model_toolkit.prototxt b/tools/cpp_examples/demo-serving/conf/model_toolkit.prototxt similarity index 100% rename from examples/demo-serving/conf/model_toolkit.prototxt rename to tools/cpp_examples/demo-serving/conf/model_toolkit.prototxt diff --git a/examples/demo-serving/conf/resource.prototxt b/tools/cpp_examples/demo-serving/conf/resource.prototxt similarity index 100% rename from examples/demo-serving/conf/resource.prototxt rename to tools/cpp_examples/demo-serving/conf/resource.prototxt diff --git a/examples/demo-serving/conf/service.prototxt b/tools/cpp_examples/demo-serving/conf/service.prototxt similarity index 100% rename from examples/demo-serving/conf/service.prototxt rename to tools/cpp_examples/demo-serving/conf/service.prototxt diff --git a/examples/demo-serving/conf/workflow.prototxt b/tools/cpp_examples/demo-serving/conf/workflow.prototxt similarity index 100% rename from examples/demo-serving/conf/workflow.prototxt rename to tools/cpp_examples/demo-serving/conf/workflow.prototxt diff --git a/examples/demo-serving/op/CMakeLists.txt b/tools/cpp_examples/demo-serving/op/CMakeLists.txt similarity index 100% rename from examples/demo-serving/op/CMakeLists.txt rename to tools/cpp_examples/demo-serving/op/CMakeLists.txt diff --git a/examples/demo-serving/op/bert_service_op.cpp b/tools/cpp_examples/demo-serving/op/bert_service_op.cpp similarity index 100% rename from examples/demo-serving/op/bert_service_op.cpp rename to tools/cpp_examples/demo-serving/op/bert_service_op.cpp diff --git a/examples/demo-serving/op/bert_service_op.h b/tools/cpp_examples/demo-serving/op/bert_service_op.h similarity index 100% rename from examples/demo-serving/op/bert_service_op.h rename to tools/cpp_examples/demo-serving/op/bert_service_op.h diff --git a/examples/demo-serving/op/classify_op.cpp b/tools/cpp_examples/demo-serving/op/classify_op.cpp similarity index 100% rename from examples/demo-serving/op/classify_op.cpp rename to tools/cpp_examples/demo-serving/op/classify_op.cpp diff --git a/examples/demo-serving/op/classify_op.h b/tools/cpp_examples/demo-serving/op/classify_op.h similarity index 100% rename from examples/demo-serving/op/classify_op.h rename to tools/cpp_examples/demo-serving/op/classify_op.h diff --git a/examples/demo-serving/op/common_echo_op.cpp b/tools/cpp_examples/demo-serving/op/common_echo_op.cpp similarity index 100% rename from examples/demo-serving/op/common_echo_op.cpp rename to tools/cpp_examples/demo-serving/op/common_echo_op.cpp diff --git a/examples/demo-serving/op/common_echo_op.h b/tools/cpp_examples/demo-serving/op/common_echo_op.h similarity index 100% rename from examples/demo-serving/op/common_echo_op.h rename to tools/cpp_examples/demo-serving/op/common_echo_op.h diff --git a/examples/demo-serving/op/ctr_prediction_op.cpp b/tools/cpp_examples/demo-serving/op/ctr_prediction_op.cpp similarity index 100% rename from examples/demo-serving/op/ctr_prediction_op.cpp rename to tools/cpp_examples/demo-serving/op/ctr_prediction_op.cpp diff --git a/examples/demo-serving/op/ctr_prediction_op.h b/tools/cpp_examples/demo-serving/op/ctr_prediction_op.h similarity index 100% rename from examples/demo-serving/op/ctr_prediction_op.h rename to tools/cpp_examples/demo-serving/op/ctr_prediction_op.h diff --git a/examples/demo-serving/op/dense_echo_op.cpp b/tools/cpp_examples/demo-serving/op/dense_echo_op.cpp similarity index 100% rename from examples/demo-serving/op/dense_echo_op.cpp rename to tools/cpp_examples/demo-serving/op/dense_echo_op.cpp diff --git a/examples/demo-serving/op/dense_echo_op.h b/tools/cpp_examples/demo-serving/op/dense_echo_op.h similarity index 100% rename from examples/demo-serving/op/dense_echo_op.h rename to tools/cpp_examples/demo-serving/op/dense_echo_op.h diff --git a/examples/demo-serving/op/general_model_op.cpp b/tools/cpp_examples/demo-serving/op/general_model_op.cpp similarity index 100% rename from examples/demo-serving/op/general_model_op.cpp rename to tools/cpp_examples/demo-serving/op/general_model_op.cpp diff --git a/examples/demo-serving/op/general_model_op.h b/tools/cpp_examples/demo-serving/op/general_model_op.h similarity index 100% rename from examples/demo-serving/op/general_model_op.h rename to tools/cpp_examples/demo-serving/op/general_model_op.h diff --git a/examples/demo-serving/op/int64tensor_echo_op.cpp b/tools/cpp_examples/demo-serving/op/int64tensor_echo_op.cpp similarity index 100% rename from examples/demo-serving/op/int64tensor_echo_op.cpp rename to tools/cpp_examples/demo-serving/op/int64tensor_echo_op.cpp diff --git a/examples/demo-serving/op/int64tensor_echo_op.h b/tools/cpp_examples/demo-serving/op/int64tensor_echo_op.h similarity index 100% rename from examples/demo-serving/op/int64tensor_echo_op.h rename to tools/cpp_examples/demo-serving/op/int64tensor_echo_op.h diff --git a/examples/demo-serving/op/kvdb_echo_op.cpp b/tools/cpp_examples/demo-serving/op/kvdb_echo_op.cpp similarity index 100% rename from examples/demo-serving/op/kvdb_echo_op.cpp rename to tools/cpp_examples/demo-serving/op/kvdb_echo_op.cpp diff --git a/examples/demo-serving/op/kvdb_echo_op.h b/tools/cpp_examples/demo-serving/op/kvdb_echo_op.h similarity index 100% rename from examples/demo-serving/op/kvdb_echo_op.h rename to tools/cpp_examples/demo-serving/op/kvdb_echo_op.h diff --git a/examples/demo-serving/op/load_general_model_conf_op.cpp b/tools/cpp_examples/demo-serving/op/load_general_model_conf_op.cpp similarity index 100% rename from examples/demo-serving/op/load_general_model_conf_op.cpp rename to tools/cpp_examples/demo-serving/op/load_general_model_conf_op.cpp diff --git a/examples/demo-serving/op/load_general_model_conf_op.h b/tools/cpp_examples/demo-serving/op/load_general_model_conf_op.h similarity index 100% rename from examples/demo-serving/op/load_general_model_conf_op.h rename to tools/cpp_examples/demo-serving/op/load_general_model_conf_op.h diff --git a/examples/demo-serving/op/reader_op.cpp b/tools/cpp_examples/demo-serving/op/reader_op.cpp similarity index 100% rename from examples/demo-serving/op/reader_op.cpp rename to tools/cpp_examples/demo-serving/op/reader_op.cpp diff --git a/examples/demo-serving/op/reader_op.h b/tools/cpp_examples/demo-serving/op/reader_op.h similarity index 100% rename from examples/demo-serving/op/reader_op.h rename to tools/cpp_examples/demo-serving/op/reader_op.h diff --git a/examples/demo-serving/op/sparse_echo_op.cpp b/tools/cpp_examples/demo-serving/op/sparse_echo_op.cpp similarity index 100% rename from examples/demo-serving/op/sparse_echo_op.cpp rename to tools/cpp_examples/demo-serving/op/sparse_echo_op.cpp diff --git a/examples/demo-serving/op/sparse_echo_op.h b/tools/cpp_examples/demo-serving/op/sparse_echo_op.h similarity index 100% rename from examples/demo-serving/op/sparse_echo_op.h rename to tools/cpp_examples/demo-serving/op/sparse_echo_op.h diff --git a/examples/demo-serving/op/text_classification_op.cpp b/tools/cpp_examples/demo-serving/op/text_classification_op.cpp similarity index 100% rename from examples/demo-serving/op/text_classification_op.cpp rename to tools/cpp_examples/demo-serving/op/text_classification_op.cpp diff --git a/examples/demo-serving/op/text_classification_op.h b/tools/cpp_examples/demo-serving/op/text_classification_op.h similarity index 100% rename from examples/demo-serving/op/text_classification_op.h rename to tools/cpp_examples/demo-serving/op/text_classification_op.h diff --git a/examples/demo-serving/op/write_json_op.cpp b/tools/cpp_examples/demo-serving/op/write_json_op.cpp similarity index 100% rename from examples/demo-serving/op/write_json_op.cpp rename to tools/cpp_examples/demo-serving/op/write_json_op.cpp diff --git a/examples/demo-serving/op/write_json_op.h b/tools/cpp_examples/demo-serving/op/write_json_op.h similarity index 100% rename from examples/demo-serving/op/write_json_op.h rename to tools/cpp_examples/demo-serving/op/write_json_op.h diff --git a/examples/demo-serving/op/write_op.cpp b/tools/cpp_examples/demo-serving/op/write_op.cpp similarity index 100% rename from examples/demo-serving/op/write_op.cpp rename to tools/cpp_examples/demo-serving/op/write_op.cpp diff --git a/examples/demo-serving/op/write_op.h b/tools/cpp_examples/demo-serving/op/write_op.h similarity index 100% rename from examples/demo-serving/op/write_op.h rename to tools/cpp_examples/demo-serving/op/write_op.h diff --git a/examples/demo-serving/proto/CMakeLists.txt b/tools/cpp_examples/demo-serving/proto/CMakeLists.txt similarity index 100% rename from examples/demo-serving/proto/CMakeLists.txt rename to tools/cpp_examples/demo-serving/proto/CMakeLists.txt diff --git a/examples/demo-serving/proto/bert_service.proto b/tools/cpp_examples/demo-serving/proto/bert_service.proto similarity index 100% rename from examples/demo-serving/proto/bert_service.proto rename to tools/cpp_examples/demo-serving/proto/bert_service.proto diff --git a/examples/demo-serving/proto/ctr_prediction.proto b/tools/cpp_examples/demo-serving/proto/ctr_prediction.proto similarity index 100% rename from examples/demo-serving/proto/ctr_prediction.proto rename to tools/cpp_examples/demo-serving/proto/ctr_prediction.proto diff --git a/examples/demo-serving/proto/dense_service.proto b/tools/cpp_examples/demo-serving/proto/dense_service.proto similarity index 100% rename from examples/demo-serving/proto/dense_service.proto rename to tools/cpp_examples/demo-serving/proto/dense_service.proto diff --git a/examples/demo-serving/proto/echo_kvdb_service.proto b/tools/cpp_examples/demo-serving/proto/echo_kvdb_service.proto similarity index 100% rename from examples/demo-serving/proto/echo_kvdb_service.proto rename to tools/cpp_examples/demo-serving/proto/echo_kvdb_service.proto diff --git a/examples/demo-serving/proto/echo_service.proto b/tools/cpp_examples/demo-serving/proto/echo_service.proto similarity index 100% rename from examples/demo-serving/proto/echo_service.proto rename to tools/cpp_examples/demo-serving/proto/echo_service.proto diff --git a/examples/demo-serving/proto/general_model_service.proto b/tools/cpp_examples/demo-serving/proto/general_model_service.proto similarity index 100% rename from examples/demo-serving/proto/general_model_service.proto rename to tools/cpp_examples/demo-serving/proto/general_model_service.proto diff --git a/examples/demo-serving/proto/image_class.proto b/tools/cpp_examples/demo-serving/proto/image_class.proto similarity index 100% rename from examples/demo-serving/proto/image_class.proto rename to tools/cpp_examples/demo-serving/proto/image_class.proto diff --git a/examples/demo-serving/proto/int64tensor_service.proto b/tools/cpp_examples/demo-serving/proto/int64tensor_service.proto similarity index 100% rename from examples/demo-serving/proto/int64tensor_service.proto rename to tools/cpp_examples/demo-serving/proto/int64tensor_service.proto diff --git a/examples/demo-serving/proto/load_general_model_service.proto b/tools/cpp_examples/demo-serving/proto/load_general_model_service.proto similarity index 100% rename from examples/demo-serving/proto/load_general_model_service.proto rename to tools/cpp_examples/demo-serving/proto/load_general_model_service.proto diff --git a/examples/demo-serving/proto/sparse_service.proto b/tools/cpp_examples/demo-serving/proto/sparse_service.proto similarity index 100% rename from examples/demo-serving/proto/sparse_service.proto rename to tools/cpp_examples/demo-serving/proto/sparse_service.proto diff --git a/examples/demo-serving/proto/text_classification.proto b/tools/cpp_examples/demo-serving/proto/text_classification.proto similarity index 100% rename from examples/demo-serving/proto/text_classification.proto rename to tools/cpp_examples/demo-serving/proto/text_classification.proto diff --git a/examples/elastic-ctr/CMakeLists.txt b/tools/cpp_examples/elastic-ctr/CMakeLists.txt similarity index 100% rename from examples/elastic-ctr/CMakeLists.txt rename to tools/cpp_examples/elastic-ctr/CMakeLists.txt diff --git a/examples/elastic-ctr/client/CMakeLists.txt b/tools/cpp_examples/elastic-ctr/client/CMakeLists.txt similarity index 100% rename from examples/elastic-ctr/client/CMakeLists.txt rename to tools/cpp_examples/elastic-ctr/client/CMakeLists.txt diff --git a/examples/elastic-ctr/client/api/elastic_ctr_api.cpp b/tools/cpp_examples/elastic-ctr/client/api/elastic_ctr_api.cpp similarity index 100% rename from examples/elastic-ctr/client/api/elastic_ctr_api.cpp rename to tools/cpp_examples/elastic-ctr/client/api/elastic_ctr_api.cpp diff --git a/examples/elastic-ctr/client/api/elastic_ctr_api.h b/tools/cpp_examples/elastic-ctr/client/api/elastic_ctr_api.h similarity index 100% rename from examples/elastic-ctr/client/api/elastic_ctr_api.h rename to tools/cpp_examples/elastic-ctr/client/api/elastic_ctr_api.h diff --git a/examples/elastic-ctr/client/api/python/elasticctr/elastic_ctr_api.py b/tools/cpp_examples/elastic-ctr/client/api/python/elasticctr/elastic_ctr_api.py similarity index 100% rename from examples/elastic-ctr/client/api/python/elasticctr/elastic_ctr_api.py rename to tools/cpp_examples/elastic-ctr/client/api/python/elasticctr/elastic_ctr_api.py diff --git a/examples/elastic-ctr/client/demo/conf/predictors.prototxt b/tools/cpp_examples/elastic-ctr/client/demo/conf/predictors.prototxt similarity index 100% rename from examples/elastic-ctr/client/demo/conf/predictors.prototxt rename to tools/cpp_examples/elastic-ctr/client/demo/conf/predictors.prototxt diff --git a/examples/elastic-ctr/client/demo/conf/slot.conf b/tools/cpp_examples/elastic-ctr/client/demo/conf/slot.conf similarity index 100% rename from examples/elastic-ctr/client/demo/conf/slot.conf rename to tools/cpp_examples/elastic-ctr/client/demo/conf/slot.conf diff --git a/examples/elastic-ctr/client/demo/data/ctr_prediction/data.txt b/tools/cpp_examples/elastic-ctr/client/demo/data/ctr_prediction/data.txt similarity index 100% rename from examples/elastic-ctr/client/demo/data/ctr_prediction/data.txt rename to tools/cpp_examples/elastic-ctr/client/demo/data/ctr_prediction/data.txt diff --git a/examples/elastic-ctr/client/demo/demo.cpp b/tools/cpp_examples/elastic-ctr/client/demo/demo.cpp similarity index 100% rename from examples/elastic-ctr/client/demo/demo.cpp rename to tools/cpp_examples/elastic-ctr/client/demo/demo.cpp diff --git a/examples/elastic-ctr/client/demo/elastic_ctr.py b/tools/cpp_examples/elastic-ctr/client/demo/elastic_ctr.py similarity index 100% rename from examples/elastic-ctr/client/demo/elastic_ctr.py rename to tools/cpp_examples/elastic-ctr/client/demo/elastic_ctr.py diff --git a/examples/elastic-ctr/client/proto/CMakeLists.txt b/tools/cpp_examples/elastic-ctr/client/proto/CMakeLists.txt similarity index 100% rename from examples/elastic-ctr/client/proto/CMakeLists.txt rename to tools/cpp_examples/elastic-ctr/client/proto/CMakeLists.txt diff --git a/examples/elastic-ctr/client/proto/elastic_ctr_prediction.proto b/tools/cpp_examples/elastic-ctr/client/proto/elastic_ctr_prediction.proto similarity index 100% rename from examples/elastic-ctr/client/proto/elastic_ctr_prediction.proto rename to tools/cpp_examples/elastic-ctr/client/proto/elastic_ctr_prediction.proto diff --git a/examples/elastic-ctr/serving/CMakeLists.txt b/tools/cpp_examples/elastic-ctr/serving/CMakeLists.txt similarity index 100% rename from examples/elastic-ctr/serving/CMakeLists.txt rename to tools/cpp_examples/elastic-ctr/serving/CMakeLists.txt diff --git a/examples/elastic-ctr/serving/conf/cube.conf b/tools/cpp_examples/elastic-ctr/serving/conf/cube.conf similarity index 100% rename from examples/elastic-ctr/serving/conf/cube.conf rename to tools/cpp_examples/elastic-ctr/serving/conf/cube.conf diff --git a/examples/elastic-ctr/serving/conf/gflags.conf b/tools/cpp_examples/elastic-ctr/serving/conf/gflags.conf similarity index 100% rename from examples/elastic-ctr/serving/conf/gflags.conf rename to tools/cpp_examples/elastic-ctr/serving/conf/gflags.conf diff --git a/examples/elastic-ctr/serving/conf/model_toolkit.prototxt b/tools/cpp_examples/elastic-ctr/serving/conf/model_toolkit.prototxt similarity index 100% rename from examples/elastic-ctr/serving/conf/model_toolkit.prototxt rename to tools/cpp_examples/elastic-ctr/serving/conf/model_toolkit.prototxt diff --git a/examples/elastic-ctr/serving/conf/resource.prototxt b/tools/cpp_examples/elastic-ctr/serving/conf/resource.prototxt similarity index 100% rename from examples/elastic-ctr/serving/conf/resource.prototxt rename to tools/cpp_examples/elastic-ctr/serving/conf/resource.prototxt diff --git a/examples/elastic-ctr/serving/conf/service.prototxt b/tools/cpp_examples/elastic-ctr/serving/conf/service.prototxt similarity index 100% rename from examples/elastic-ctr/serving/conf/service.prototxt rename to tools/cpp_examples/elastic-ctr/serving/conf/service.prototxt diff --git a/examples/elastic-ctr/serving/conf/workflow.prototxt b/tools/cpp_examples/elastic-ctr/serving/conf/workflow.prototxt similarity index 100% rename from examples/elastic-ctr/serving/conf/workflow.prototxt rename to tools/cpp_examples/elastic-ctr/serving/conf/workflow.prototxt diff --git a/examples/elastic-ctr/serving/data/model/paddle/fluid/.gitignore b/tools/cpp_examples/elastic-ctr/serving/data/model/paddle/fluid/.gitignore similarity index 100% rename from examples/elastic-ctr/serving/data/model/paddle/fluid/.gitignore rename to tools/cpp_examples/elastic-ctr/serving/data/model/paddle/fluid/.gitignore diff --git a/examples/elastic-ctr/serving/data/model/paddle/fluid_reload_flag b/tools/cpp_examples/elastic-ctr/serving/data/model/paddle/fluid_reload_flag similarity index 100% rename from examples/elastic-ctr/serving/data/model/paddle/fluid_reload_flag rename to tools/cpp_examples/elastic-ctr/serving/data/model/paddle/fluid_reload_flag diff --git a/examples/elastic-ctr/serving/data/model/paddle/fluid_time_file b/tools/cpp_examples/elastic-ctr/serving/data/model/paddle/fluid_time_file similarity index 100% rename from examples/elastic-ctr/serving/data/model/paddle/fluid_time_file rename to tools/cpp_examples/elastic-ctr/serving/data/model/paddle/fluid_time_file diff --git a/examples/elastic-ctr/serving/op/CMakeLists.txt b/tools/cpp_examples/elastic-ctr/serving/op/CMakeLists.txt similarity index 100% rename from examples/elastic-ctr/serving/op/CMakeLists.txt rename to tools/cpp_examples/elastic-ctr/serving/op/CMakeLists.txt diff --git a/examples/elastic-ctr/serving/op/elastic_ctr_prediction_op.cpp b/tools/cpp_examples/elastic-ctr/serving/op/elastic_ctr_prediction_op.cpp similarity index 100% rename from examples/elastic-ctr/serving/op/elastic_ctr_prediction_op.cpp rename to tools/cpp_examples/elastic-ctr/serving/op/elastic_ctr_prediction_op.cpp diff --git a/examples/elastic-ctr/serving/op/elastic_ctr_prediction_op.h b/tools/cpp_examples/elastic-ctr/serving/op/elastic_ctr_prediction_op.h similarity index 100% rename from examples/elastic-ctr/serving/op/elastic_ctr_prediction_op.h rename to tools/cpp_examples/elastic-ctr/serving/op/elastic_ctr_prediction_op.h diff --git a/examples/elastic-ctr/serving/proto/CMakeLists.txt b/tools/cpp_examples/elastic-ctr/serving/proto/CMakeLists.txt similarity index 100% rename from examples/elastic-ctr/serving/proto/CMakeLists.txt rename to tools/cpp_examples/elastic-ctr/serving/proto/CMakeLists.txt diff --git a/examples/elastic-ctr/serving/proto/elastic_ctr_prediction.proto b/tools/cpp_examples/elastic-ctr/serving/proto/elastic_ctr_prediction.proto similarity index 100% rename from examples/elastic-ctr/serving/proto/elastic_ctr_prediction.proto rename to tools/cpp_examples/elastic-ctr/serving/proto/elastic_ctr_prediction.proto