未验证 提交 75f985c0 编写于 作者: Y Yang Zhang 提交者: GitHub

Disable optimizer fusion for ppdet models (#3408)

* Disable optimizer fusion for RCNN models

waiting for upstream fix

* Disable completely
上级 3a2c1062
...@@ -150,10 +150,11 @@ def main(): ...@@ -150,10 +150,11 @@ def main():
# compile program for multi-devices # compile program for multi-devices
build_strategy = fluid.BuildStrategy() build_strategy = fluid.BuildStrategy()
sync_bn = getattr(model.backbone, 'norm_type', None) == 'sync_bn' build_strategy.fuse_all_optimizer_ops = False
if FLAGS.fp16: if FLAGS.fp16:
build_strategy.fuse_all_reduce_ops = False build_strategy.fuse_all_reduce_ops = False
# only enable sync_bn in multi GPU devices # only enable sync_bn in multi GPU devices
sync_bn = getattr(model.backbone, 'norm_type', None) == 'sync_bn'
build_strategy.sync_batch_norm = sync_bn and devices_num > 1 \ build_strategy.sync_batch_norm = sync_bn and devices_num > 1 \
and cfg.use_gpu and cfg.use_gpu
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册