From e05540f7d45e8bc8ea254df626ec7b97fd122cde Mon Sep 17 00:00:00 2001 From: Steffy-zxf <48793257+Steffy-zxf@users.noreply.github.com> Date: Fri, 26 Nov 2021 20:46:53 +0800 Subject: [PATCH] fix data parallel when VOCAB var in program (#37543) * fix data parallel when VOCAB var in program --- python/paddle/fluid/dygraph/parallel.py | 2 ++ python/paddle/fluid/tests/unittests/CMakeLists.txt | 1 + 2 files changed, 3 insertions(+) diff --git a/python/paddle/fluid/dygraph/parallel.py b/python/paddle/fluid/dygraph/parallel.py index 123f8a5876299b..81bb812202c9e0 100644 --- a/python/paddle/fluid/dygraph/parallel.py +++ b/python/paddle/fluid/dygraph/parallel.py @@ -370,6 +370,8 @@ def sync_params_buffers(model, # such as moe's expert parameters if getattr(param, "no_sync", False): continue + if param.type == core.VarDesc.VarType.VOCAB: + continue model_vars.append(param.detach()) if len(model_vars) == 0: diff --git a/python/paddle/fluid/tests/unittests/CMakeLists.txt b/python/paddle/fluid/tests/unittests/CMakeLists.txt index 2b49119c4fb159..548025d9a2c0e9 100644 --- a/python/paddle/fluid/tests/unittests/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/CMakeLists.txt @@ -578,6 +578,7 @@ py_test_modules(test_imperative_static_runner_mnist MODULES test_imperative_stat py_test_modules(test_imperative_static_runner_while MODULES test_imperative_static_runner_while ENVS FLAGS_cudnn_deterministic=1) set_tests_properties(test_conv2d_op PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE") +set_tests_properties(test_faster_tokenizer_op PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE") set_tests_properties(test_conv2d_op_depthwise_conv PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE") set_tests_properties(test_conv2d_api PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE") set_tests_properties(test_conv_nn_grad PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE")