Skip to content

test/deprecated/cpp modify use_mkldnn [fluid_ops] #74502

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

Merged
merged 1 commit into from
Aug 11, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ TEST(AnalysisPredictor, bf16_gpu_pass_strategy) {
config.SetModel(FLAGS_dirname);
config.SwitchIrOptim(true);
config.EnableUseGpu(100, 0);
config.EnableMkldnnBfloat16();
config.EnableOnednnBfloat16();
#ifdef PADDLE_WITH_DNNL
if (phi::backends::cpu::MayIUse(phi::backends::cpu::cpu_isa_t::avx512_core))
ASSERT_EQ(config.onednn_bfloat16_enabled(), true);
Expand All @@ -332,7 +332,7 @@ TEST(AnalysisPredictor, bf16_gpu_pass_strategy) {
TEST(AnalysisPredictor, bf16_pass_strategy) {
std::vector<std::string> passes;
PassStrategy passStrategy(passes);
passStrategy.EnableMkldnnBfloat16();
passStrategy.EnableOnednnBfloat16();
}

TEST(AnalysisPredictor, onednn_fc_pass_strategy) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ TEST(Analyzer_bert, compare) {
CompareNativeAndAnalysisWrapper();
}
#ifdef PADDLE_WITH_DNNL
TEST(Analyzer_bert, compare_mkldnn) {
TEST(Analyzer_bert, compare_onednn) {
auto use_onednn = true;
CompareNativeAndAnalysisWrapper(use_onednn);
}
Expand Down Expand Up @@ -210,7 +210,7 @@ AnalysisConfig SetConfig(bool use_onednn, bool use_bfloat16) {
config.EnableONEDNN();
}

if (use_bfloat16) config.EnableMkldnnBfloat16();
if (use_bfloat16) config.EnableOnednnBfloat16();

return config;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ void SetInput(std::vector<std::vector<PaddleTensor>> *inputs) {
}

// Easy for profiling independently.
void profile(bool use_mkldnn = false) {
void profile(bool use_onednn = false) {
AnalysisConfig cfg;
SetConfig(&cfg);

if (use_mkldnn) {
if (use_onednn) {
cfg.EnableONEDNN();
if (FLAGS_disable_onednn_fc) {
cfg.DisableOnednnFcPasses();
Expand All @@ -59,14 +59,14 @@ void profile(bool use_mkldnn = false) {

TEST(Analyzer_resnet50, profile) { profile(); }
#ifdef PADDLE_WITH_DNNL
TEST(Analyzer_resnet50, profile_mkldnn) { profile(true /* use_mkldnn */); }
TEST(Analyzer_resnet50, profile_onednn) { profile(true /* use_onednn */); }
#endif

// Compare result of NativeConfig and AnalysisConfig
void compare(bool use_mkldnn = false) {
void compare(bool use_onednn = false) {
AnalysisConfig cfg;
SetConfig(&cfg);
if (use_mkldnn) {
if (use_onednn) {
cfg.EnableONEDNN();
if (FLAGS_disable_onednn_fc) {
cfg.DisableOnednnFcPasses();
Expand All @@ -81,7 +81,7 @@ void compare(bool use_mkldnn = false) {

TEST(Analyzer_resnet50, compare) { compare(); }
#ifdef PADDLE_WITH_DNNL
TEST(Analyzer_resnet50, compare_mkldnn) { compare(true /* use_mkldnn */); }
TEST(Analyzer_resnet50, compare_onednn) { compare(true /* use_onednn */); }
#endif

// Compare Deterministic result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ namespace inference {
namespace analysis {
namespace transformer_tester {

void compare(bool use_mkldnn = false) {
void compare(bool use_onednn = false) {
AnalysisConfig cfg;
SetConfig(&cfg);
if (!use_mkldnn) {
if (!use_onednn) {
cfg.DisableONEDNN();
}

Expand All @@ -34,7 +34,7 @@ void compare(bool use_mkldnn = false) {

TEST(Analyzer_Transformer, compare) { compare(); }
#ifdef PADDLE_WITH_DNNL
TEST(Analyzer_Transformer, compare_mkldnn) { compare(true /* use_mkldnn */); }
TEST(Analyzer_Transformer, compare_onednn) { compare(true /* use_onednn */); }
#endif

} // namespace transformer_tester
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ namespace inference {
namespace analysis {
namespace transformer_tester {

void profile(bool use_mkldnn = false) {
void profile(bool use_onednn = false) {
AnalysisConfig cfg;
SetConfig(&cfg);
std::vector<std::vector<PaddleTensor>> outputs;
if (use_mkldnn) {
if (use_onednn) {
cfg.EnableONEDNN();
}

Expand All @@ -37,7 +37,7 @@ void profile(bool use_mkldnn = false) {

TEST(Analyzer_Transformer, profile) { profile(); }
#ifdef PADDLE_WITH_DNNL
TEST(Analyzer_Transformer, profile_mkldnn) { profile(true); }
TEST(Analyzer_Transformer, profile_onednn) { profile(true); }
#endif

} // namespace transformer_tester
Expand Down
Loading