Skip to content

Conversation

@Superjomn
Copy link
Contributor

@Superjomn Superjomn commented Feb 19, 2019

screencapture-infer-dev-paddlepaddle-org-8000-documentation-docs-zh-develop-advanced_usage-deploy-inference-native_infer-html-2019-02-19-12_26_46

predictors.emplace_back(std::move(main_predictor));
for (int i = 1; i < num_threads; i++) {
predictors.emplace_back(main_predictor->Clone());
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

150-154行:多线程必须在下面的threads.emplace_back([&, tid] 里面clone,不然设置的SetCpuMathLibraryNumThreads会不生效。
参见:PaddlePaddle/Paddle#15310 PaddlePaddle/Paddle#14543

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个有问题啊。 clone 的时候,main_predictor 已经跑起来了,可能不稳定

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前test里面是这样做的。“可能不稳定”,是指会出现什么情况呢?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main_predictor 里的 scope已经在读写,同时Clone会有多线程。 但预测时scope 的锁是去掉的


- `NativeConfig` 原生 engine,由 paddle 原生的 forward operator
组成,可以天然支持所有paddle 训练出的模型,
`Config` 有两种,`NativeConfig` 较简单和稳定,`AnalysisConfig` 功能更新,性能更好
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加句号。

Copy link
Contributor

@shanyi15 shanyi15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#634 (comment) 会在1.4版本修复。

@shanyi15 shanyi15 merged commit 4068367 into develop Feb 21, 2019
@shanyi15 shanyi15 deleted the fea/update_inference_api_doc branch February 21, 2019 05:34
shanyi15 added a commit that referenced this pull request Feb 21, 2019
* update_commitid1.3 (#641)

* update inference c++ API doc (#634)

* update inference c++ API doc

* fix link
shanyi15 added a commit that referenced this pull request Feb 28, 2019
* synchronize with develop (#642)

* update_commitid1.3 (#641)

* update inference c++ API doc (#634)

* update inference c++ API doc

* fix link

* thorough clean for doc (#644)

* thorough clean

* delete_DS_Store

* Cherrypick1.3 (#652)

* thorough clean

* delete_DS_Store

* [Don't merge now]update_install_doc (#643)

* update_install_doc

* follow_comments

* add maxdepth (#646)

* upload_md (#649)

* update_version (#650)

* Translation of 16 new apis (#651)

* fix_windows

* Final update 1.3 (#653)

* thorough clean

* delete_DS_Store

* update_1.3

* Deadlink fix (#654)

* fix_deadlinks

* update_docker

* Update release_note.rst

* Update index_cn.rst

* update_Paddle (#658)

* fix pic (#659)

* [to 1.3] cn api debug (#655) (#661)

* debug

* fix 2 -conv2d

* "锚" ==> anchor(s)
shanyi15 added a commit that referenced this pull request Mar 10, 2019
* synchronize with develop (#642)

* update_commitid1.3 (#641)

* update inference c++ API doc (#634)

* update inference c++ API doc

* fix link

* thorough clean for doc (#644)

* thorough clean

* delete_DS_Store

* Cherrypick1.3 (#652)

* thorough clean

* delete_DS_Store

* [Don't merge now]update_install_doc (#643)

* update_install_doc

* follow_comments

* add maxdepth (#646)

* upload_md (#649)

* update_version (#650)

* Translation of 16 new apis (#651)

* fix_windows

* Final update 1.3 (#653)

* thorough clean

* delete_DS_Store

* update_1.3

* Deadlink fix (#654)

* fix_deadlinks

* update_docker

* Update release_note.rst

* Update index_cn.rst

* update_Paddle (#658)

* fix pic (#659)

* [to 1.3] cn api debug (#655) (#661)

* debug

* fix 2 -conv2d

* "锚" ==> anchor(s)

* Weekly cherrypick0302 (#668)

* Update programming_guide.md (#664)

* Update programming_guide.md

* Update programming_guide_en.md

* Update cn api to 1.3 (#663)

* Update cn api to 1.3 fluid & layers

* Rest to 1.3

* Weeklyupdate 0301 (#666)

* Tables_rm_op

* update_op

* update_index

* update_book_0302 (#667)

* fix_format (#669) (#670)

* fix_format

* Update Tables.md

* Update Tables_en.md

* add dataset api_cn (#673)

* rm fluid.core in desigin_idea (#674)

* Update fluid_design_idea.md

* Update fluid_design_idea_en.md

* Fix array_read code example error. (#671)

Signed-off-by: zhaoyuchen <[email protected]>

* add data_reader_cn (#676)

* fix doc error (#675)

* update_book_commitid (#680)

* update_book_commitid

* commitid0309

* fix typo

* book indexes (#677)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants