Skip to content

Commit b139b68

Browse files
committed
Merge remote-tracking branch 'ups/develop' into fix/jit/exp
test=develop
2 parents 7484355 + 67a2b52 commit b139b68

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1364
-222
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ set(THIRD_PARTY_PATH "${CMAKE_BINARY_DIR}/third_party" CACHE STRING
127127
set(FLUID_INSTALL_DIR "${CMAKE_BINARY_DIR}/fluid_install_dir" CACHE STRING
128128
"A path setting fluid shared and static libraries")
129129

130+
set(FLUID_INFERENCE_INSTALL_DIR "${CMAKE_BINARY_DIR}/fluid_inference_install_dir" CACHE STRING
131+
"A path setting fluid inference shared and static libraries")
132+
130133
if (WITH_C_API AND WITH_PYTHON)
131134
message(WARNING "It is suggest not embedded a python interpreter in Paddle "
132135
"when using C-API. It will give an unpredictable behavior when using a "

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Our vision is to enable deep learning for everyone via PaddlePaddle.
1919
Please refer to our [release announcement](https://github.com/PaddlePaddle/Paddle/releases) to track the latest feature of PaddlePaddle.
2020

2121

22-
### Latest PaddlePaddle Release: [Fluid 0.15.0](https://github.com/PaddlePaddle/Paddle/tree/v0.15.0)
22+
### Latest PaddlePaddle Release: [Fluid 1.0.0](https://github.com/PaddlePaddle/Paddle/tree/release/1.0.0)
2323
### Install Latest Stable Release:
2424
```
2525
# Linux CPU
@@ -76,26 +76,26 @@ pip install paddlepaddle-gpu==0.15.0.post85
7676

7777
## Installation
7878

79-
It is recommended to read [this doc](http://paddlepaddle.org/documentation/docs/zh/0.15.0/new_docs/beginners_guide/install/install_doc.html) on our website.
79+
It is recommended to read [this doc](http://paddlepaddle.org/documentation/docs/zh/1.0/beginners_guide/index.html) on our website.
8080

8181
## Documentation
8282

83-
We provide [English](http://paddlepaddle.org/documentation/docs/en/0.15.0/getstarted/index_en.html) and
84-
[Chinese](http://paddlepaddle.org/documentation/docs/zh/0.15.0/new_docs/beginners_guide/index.html) documentation.
83+
We provide [English](http://paddlepaddle.org/documentation/docs/en/1.0.0/getstarted/index_en.html) and
84+
[Chinese](http://paddlepaddle.org/documentation/docs/zh/1.0/beginners_guide/index.html) documentation.
8585

8686
- [Deep Learning 101](https://github.com/PaddlePaddle/book)
8787

8888
You might want to start from this online interactive book that can run in a Jupyter Notebook.
8989

90-
- [Distributed Training](http://paddlepaddle.org/documentation/docs/zh/0.15.0/new_docs/user_guides/howto/training/cluster_howto.html)
90+
- [Distributed Training](http://paddlepaddle.org/documentation/docs/zh/1.0/user_guides/howto/training/cluster_howto.html)
9191

9292
You can run distributed training jobs on MPI clusters.
9393

94-
- [Python API](http://paddlepaddle.org/documentation/api/zh/0.15.0/fluid.html)
94+
- [Python API](http://paddlepaddle.org/documentation/api/zh/1.0/fluid.html)
9595

9696
Our new API enables much shorter programs.
9797

98-
- [How to Contribute](http://paddlepaddle.org/documentation/docs/zh/0.15.0/new_docs/advanced_usage/development/contribute_to_paddle.html)
98+
- [How to Contribute](http://paddlepaddle.org/documentation/docs/zh/1.0/advanced_usage/development/contribute_to_paddle.html)
9999

100100
We appreciate your contributions!
101101

benchmark/fluid/run.sh

100644100755
File mode changed.

cmake/inference_lib.cmake

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,16 @@ if (WITH_ANAKIN AND WITH_MKL)
150150
SRCS
151151
${PADDLE_BINARY_DIR}/paddle/fluid/inference/api/libinference_anakin_api* # compiled anakin api
152152
${ANAKIN_INSTALL_DIR} # anakin release
153-
DSTS ${dst_dir}/inference/anakin ${FLUID_INSTALL_DIR}/third_party/install/anakin)
153+
DSTS ${FLUID_INSTALL_DIR}/third_party/install/anakin ${FLUID_INSTALL_DIR}/third_party/install/anakin)
154154
list(APPEND inference_deps anakin_inference_lib)
155155
endif()
156156

157157
set(module "inference")
158158
copy(inference_lib DEPS ${inference_deps}
159159
SRCS ${src_dir}/${module}/*.h ${PADDLE_BINARY_DIR}/paddle/fluid/inference/libpaddle_fluid.*
160-
${src_dir}/${module}/api/paddle_inference_api.h ${src_dir}/${module}/api/demo_ci
160+
${src_dir}/${module}/api/paddle_inference_api.h
161161
${PADDLE_BINARY_DIR}/paddle/fluid/inference/api/paddle_inference_pass.h
162-
DSTS ${dst_dir}/${module} ${dst_dir}/${module} ${dst_dir}/${module} ${dst_dir}/${module} ${dst_dir}/${module}
162+
DSTS ${dst_dir}/${module} ${dst_dir}/${module} ${dst_dir}/${module} ${dst_dir}/${module}
163163
)
164164

165165
set(module "platform")
@@ -188,18 +188,38 @@ copy(cmake_cache
188188
# This command generates a complete fluid library for both train and inference
189189
add_custom_target(fluid_lib_dist DEPENDS ${fluid_lib_dist_dep})
190190

191+
# Following commands generate a inference-only fluid library
192+
# third_party, version.txt and CMakeCache.txt are the same position with ${FLUID_INSTALL_DIR}
193+
copy(third_party DEPS fluid_lib_dist
194+
SRCS ${FLUID_INSTALL_DIR}/third_party ${FLUID_INSTALL_DIR}/CMakeCache.txt
195+
DSTS ${FLUID_INFERENCE_INSTALL_DIR} ${FLUID_INFERENCE_INSTALL_DIR}
196+
)
197+
198+
# only need libpaddle_fluid.so/a and paddle_inference_api.h for inference-only library
199+
copy(inference_api_lib DEPS fluid_lib_dist
200+
SRCS ${FLUID_INSTALL_DIR}/paddle/fluid/inference/libpaddle_fluid.*
201+
${FLUID_INSTALL_DIR}/paddle/fluid/inference/paddle_inference_api.h
202+
DSTS ${FLUID_INFERENCE_INSTALL_DIR}/paddle/lib ${FLUID_INFERENCE_INSTALL_DIR}/paddle/include
203+
)
204+
205+
add_custom_target(inference_lib_dist DEPENDS third_party inference_api_lib)
206+
191207
# paddle fluid version
192-
execute_process(
193-
COMMAND ${GIT_EXECUTABLE} log --pretty=format:%H -1
194-
WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}
195-
OUTPUT_VARIABLE PADDLE_GIT_COMMIT)
196-
set(version_file ${FLUID_INSTALL_DIR}/version.txt)
197-
file(WRITE ${version_file}
198-
"GIT COMMIT ID: ${PADDLE_GIT_COMMIT}\n"
199-
"WITH_MKL: ${WITH_MKL}\n"
200-
"WITH_GPU: ${WITH_GPU}\n")
201-
if(WITH_GPU)
202-
file(APPEND ${version_file}
203-
"CUDA version: ${CUDA_VERSION}\n"
204-
"CUDNN version: v${CUDNN_MAJOR_VERSION}\n")
205-
endif()
208+
function(version version_file)
209+
execute_process(
210+
COMMAND ${GIT_EXECUTABLE} log --pretty=format:%H -1
211+
WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}
212+
OUTPUT_VARIABLE PADDLE_GIT_COMMIT)
213+
file(WRITE ${version_file}
214+
"GIT COMMIT ID: ${PADDLE_GIT_COMMIT}\n"
215+
"WITH_MKL: ${WITH_MKL}\n"
216+
"WITH_MKLDNN: ${WITH_MKLDNN}\n"
217+
"WITH_GPU: ${WITH_GPU}\n")
218+
if(WITH_GPU)
219+
file(APPEND ${version_file}
220+
"CUDA version: ${CUDA_VERSION}\n"
221+
"CUDNN version: v${CUDNN_MAJOR_VERSION}\n")
222+
endif()
223+
endfunction()
224+
version(${FLUID_INSTALL_DIR}/version.txt)
225+
version(${FLUID_INFERENCE_INSTALL_DIR}/version.txt)

paddle/fluid/API.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ paddle.fluid.layers.mean ArgSpec(args=['x', 'name'], varargs=None, keywords=None
173173
paddle.fluid.layers.mul ArgSpec(args=['x', 'y', 'x_num_col_dims', 'y_num_col_dims', 'name'], varargs=None, keywords=None, defaults=(1, 1, None))
174174
paddle.fluid.layers.sigmoid_cross_entropy_with_logits ArgSpec(args=['x', 'label', 'name'], varargs=None, keywords=None, defaults=(None,))
175175
paddle.fluid.layers.maxout ArgSpec(args=['x', 'groups', 'name'], varargs=None, keywords=None, defaults=(None,))
176+
paddle.fluid.layers.affine_channel ArgSpec(args=['x', 'scale', 'bias', 'data_layout', 'name'], varargs=None, keywords=None, defaults=(None, None, 'NCHW', None))
176177
paddle.fluid.layers.data ArgSpec(args=['name', 'shape', 'append_batch_size', 'dtype', 'lod_level', 'type', 'stop_gradient'], varargs=None, keywords=None, defaults=(True, 'float32', 0, VarType.LOD_TENSOR, True))
177178
paddle.fluid.layers.open_files ArgSpec(args=['filenames', 'shapes', 'lod_levels', 'dtypes', 'thread_num', 'buffer_size', 'pass_num', 'is_test'], varargs=None, keywords=None, defaults=(None, None, 1, None))
178179
paddle.fluid.layers.read_file ArgSpec(args=['reader'], varargs=None, keywords=None, defaults=None)

paddle/fluid/framework/op_desc.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,6 @@ class OpDesc {
100100
std::vector<std::string> InputNames() const { return MapKeys(inputs_); }
101101
std::vector<std::string> OutputNames() const { return MapKeys(outputs_); }
102102

103-
void SetInputMap(const VariableNameMap &input) {
104-
this->inputs_ = input;
105-
this->need_update_ = true;
106-
}
107-
108-
void SetOutputMap(const VariableNameMap &output) {
109-
this->outputs_ = output;
110-
this->need_update_ = true;
111-
}
112-
113103
const VariableNameMap &Inputs() const { return inputs_; }
114104

115105
const VariableNameMap &Outputs() const { return outputs_; }

paddle/fluid/inference/analysis/analyzer_tester.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ void TestWord2vecPrediction(const std::string& model_path) {
5151
config.model_dir = model_path;
5252
config.use_gpu = false;
5353
config.device = 0;
54-
auto predictor =
55-
::paddle::CreatePaddlePredictor<NativeConfig, PaddleEngineKind::kNative>(
56-
config);
54+
auto predictor = ::paddle::CreatePaddlePredictor<NativeConfig>(config);
5755

5856
// One single batch
5957

paddle/fluid/inference/api/analysis_predictor_tester.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ TEST(AnalysisPredictor, ZeroCopy) {
2727
config.model_dir = FLAGS_dirname + "/word2vec.inference.model";
2828
config.use_feed_fetch_ops = false;
2929

30-
auto predictor =
31-
CreatePaddlePredictor<AnalysisConfig, PaddleEngineKind::kAnalysis>(
32-
config);
30+
auto predictor = CreatePaddlePredictor<AnalysisConfig>(config);
3331

3432
auto w0 = predictor->GetInputTensor("firstw");
3533
auto w1 = predictor->GetInputTensor("secondw");

paddle/fluid/inference/api/api_tensorrt_subgraph_engine_tester.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,8 @@ void CompareTensorRTWithFluid(bool enable_tensorrt) {
4141
config1.device = 0;
4242
config1.max_batch_size = 10;
4343

44-
auto predictor0 =
45-
CreatePaddlePredictor<NativeConfig, PaddleEngineKind::kNative>(config0);
46-
auto predictor1 =
47-
CreatePaddlePredictor<MixedRTConfig,
48-
PaddleEngineKind::kAutoMixedTensorRT>(config1);
44+
auto predictor0 = CreatePaddlePredictor<NativeConfig>(config0);
45+
auto predictor1 = CreatePaddlePredictor<MixedRTConfig>(config1);
4946

5047
for (int batch_id = 0; batch_id < 1; batch_id++) {
5148
//# 2. Prepare input.

paddle/fluid/inference/api/demo_ci/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ endif(NOT WIN32)
7777
link_directories("${PADDLE_LIB}/third_party/install/protobuf/lib")
7878
link_directories("${PADDLE_LIB}/third_party/install/glog/lib")
7979
link_directories("${PADDLE_LIB}/third_party/install/gflags/lib")
80-
link_directories("${PADDLE_LIB}/paddle/fluid/inference")
80+
link_directories("${PADDLE_LIB}/paddle/lib")
8181

8282
add_executable(${DEMO_NAME} ${DEMO_NAME}.cc)
8383

@@ -97,10 +97,10 @@ endif()
9797
# Note: libpaddle_inference_api.so/a must put before libpaddle_fluid.so/a
9898
if(WITH_STATIC_LIB)
9999
set(DEPS
100-
${PADDLE_LIB}/paddle/fluid/inference/libpaddle_fluid${CMAKE_STATIC_LIBRARY_SUFFIX})
100+
${PADDLE_LIB}/paddle/lib/libpaddle_fluid${CMAKE_STATIC_LIBRARY_SUFFIX})
101101
else()
102102
set(DEPS
103-
${PADDLE_LIB}/paddle/fluid/inference/libpaddle_fluid${CMAKE_SHARED_LIBRARY_SUFFIX})
103+
${PADDLE_LIB}/paddle/lib/libpaddle_fluid${CMAKE_SHARED_LIBRARY_SUFFIX})
104104
endif()
105105

106106
if (NOT WIN32)

0 commit comments

Comments
 (0)