Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OneDNN] Replace cpu.h header in default OneDNN to deploy #59259

Merged

Conversation

zhanglirong1999
Copy link
Contributor

PR types

Bug fixes

PR changes

Others

Description

cpu.h header in default OneDNN will have error in deploy causing by this header files cannot be exposed to the outside world and packaged.

Copy link

paddle-bot bot commented Nov 22, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Nov 22, 2023
@zhanglirong1999 zhanglirong1999 force-pushed the oneDNN_default_cpu_header_fix branch 2 times, most recently from 4b98eec to 6f22ecc Compare November 22, 2023 22:19
@zhanglirong1999
Copy link
Contributor Author

@xinyu-intel @vivienfanghuagood , please help review, thanks~

xinyu-intel
xinyu-intel previously approved these changes Nov 23, 2023
Copy link
Contributor

@vivienfanghuagood vivienfanghuagood left a comment

Choose a reason for hiding this comment

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

LGTM

@yuanlehome
Copy link
Contributor

yuanlehome commented Nov 23, 2023

您好,我有一些建议:

  1. 对用户暴露的接口config.h中放置这么多与config无关的代码和宏,感觉不太优雅
  2. PADDLE_WITH_XBYAK/WITH_NV_JETSON/PADDLE_WITH_ARM等等引入的一些宏是paddle内部编译用的,用户使用推理库编译自己模块时看不到这些宏的
  3. 如果你需要配置一个默认值,我认为可以放在config的构造函数中(.cc文件里赋值)

@yuanlehome
Copy link
Contributor

或者您可以在Predictor的构造函数里(paddle/fluid/inference/api/analysis_predictor.cc),当满足条件时,调用config.EnableMKLDNN();
image

@zhanglirong1999
Copy link
Contributor Author

@yuanlehome ,好的,多谢解答,感觉第二种思路会更好一些

@zhanglirong1999 zhanglirong1999 force-pushed the oneDNN_default_cpu_header_fix branch 4 times, most recently from 40bc60e to 535ba48 Compare November 23, 2023 06:22
@zhanglirong1999
Copy link
Contributor Author

@yuanlehome 能否帮忙看下这样是否合理,这样就不需要对每一个config的构造函数赋值了

@yuanlehome
Copy link
Contributor

@yuanlehome 能否帮忙看下这样是否合理,这样就不需要对每一个config的构造函数赋值了

恩 我认为是合理的~

Copy link
Contributor

@yuanlehome yuanlehome left a comment

Choose a reason for hiding this comment

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

LGTM

@yuanlehome yuanlehome merged commit c645285 into PaddlePaddle:develop Nov 23, 2023
28 checks passed
SecretXV pushed a commit to SecretXV/Paddle that referenced this pull request Nov 28, 2023
…le#59259)

* Fix cpu.h header can not package in deploy

* run CI

* Add win32 header

* enable mkldnn in predictor not in config

* delete useless code

* change logic to filter avx

* fix

* make use_mkldnn_ = false

* exchange position to coverage CI pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers Intel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants