From d9db5bf730ee7aa252eb7df41ffad09501acbe44 Mon Sep 17 00:00:00 2001 From: hanhuifeng2020 Date: Mon, 25 Jan 2021 22:18:56 +0800 Subject: [PATCH] [Gpu][Bert]enable graph_kernel for any batch --- model_zoo/official/nlp/bert/run_pretrain.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/model_zoo/official/nlp/bert/run_pretrain.py b/model_zoo/official/nlp/bert/run_pretrain.py index d53b423696..16551615d8 100644 --- a/model_zoo/official/nlp/bert/run_pretrain.py +++ b/model_zoo/official/nlp/bert/run_pretrain.py @@ -99,8 +99,7 @@ def _get_optimizer(args_opt, network): def _auto_enable_graph_kernel(device_target, graph_kernel_mode): """Judge whether is suitable to enable graph kernel.""" return graph_kernel_mode in ("auto", "true") and device_target == 'GPU' and \ - cfg.bert_network == 'base' and (cfg.batch_size == 32 or cfg.batch_size == 64 or cfg.batch_size == 160) and \ - cfg.optimizer == 'AdamWeightDecay' + cfg.bert_network == 'base' and cfg.optimizer == 'AdamWeightDecay' def run_pretrain():