From 24040eb4ac1652dd7d445af8a3ca3b36be3a2576 Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Tue, 19 Oct 2021 15:02:11 +0800 Subject: [PATCH] add fp16 to mkldnn --- tools/infer/utility.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/infer/utility.py b/tools/infer/utility.py index 538f55c4..8ac5743b 100755 --- a/tools/infer/utility.py +++ b/tools/infer/utility.py @@ -268,10 +268,11 @@ def create_predictor(args, mode, logger): # cache 10 different shapes for mkldnn to avoid memory leak config.set_mkldnn_cache_capacity(10) config.enable_mkldnn() - + if args.precision == "fp16": + config.enable_mkldnn_bfloat16() # enable memory optim config.enable_memory_optim() - #config.disable_glog_info() + config.disable_glog_info() config.delete_pass("conv_transpose_eltwiseadd_bn_fuse_pass") if mode == 'table': -- GitLab