未验证 提交 016cf947 编写于 作者: X xiaoting 提交者: GitHub

Paddle2.5 (#10410)

* update paddlenlp version for paddle2.5

* clear fluid
上级 90a54caa
...@@ -84,8 +84,7 @@ class Adam(object): ...@@ -84,8 +84,7 @@ class Adam(object):
if self.group_lr: if self.group_lr:
if self.training_step == 'LF_2': if self.training_step == 'LF_2':
import paddle import paddle
if isinstance(model, paddle.fluid.dygraph.parallel. if isinstance(model, paddle.DataParallel): # multi gpu
DataParallel): # multi gpu
mlm = model._layers.head.MLM_VRM.MLM.parameters() mlm = model._layers.head.MLM_VRM.MLM.parameters()
pre_mlm_pp = model._layers.head.MLM_VRM.Prediction.pp_share.parameters( pre_mlm_pp = model._layers.head.MLM_VRM.Prediction.pp_share.parameters(
) )
......
...@@ -4,4 +4,4 @@ seqeval ...@@ -4,4 +4,4 @@ seqeval
pypandoc pypandoc
attrdict3 attrdict3
python_docx python_docx
paddlenlp>=2.4.1 paddlenlp>=2.5.2
\ No newline at end of file
import numpy as np import numpy as np
from paddle.vision.datasets import Cifar100 from paddle.vision.datasets import Cifar100
from paddle.vision.transforms import Normalize from paddle.vision.transforms import Normalize
from paddle.fluid.dataloader.collate import default_collate_fn
import signal import signal
import os import os
from paddle.io import Dataset, DataLoader, DistributedBatchSampler from paddle.io import Dataset, DataLoader, DistributedBatchSampler
......
...@@ -71,7 +71,7 @@ def amp_scaler(config): ...@@ -71,7 +71,7 @@ def amp_scaler(config):
'FLAGS_cudnn_batchnorm_spatial_persistent': 1, 'FLAGS_cudnn_batchnorm_spatial_persistent': 1,
'FLAGS_max_inplace_grad_add': 8, 'FLAGS_max_inplace_grad_add': 8,
} }
paddle.fluid.set_flags(AMP_RELATED_FLAGS_SETTING) paddle.set_flags(AMP_RELATED_FLAGS_SETTING)
scale_loss = config["AMP"].get("scale_loss", 1.0) scale_loss = config["AMP"].get("scale_loss", 1.0)
use_dynamic_loss_scaling = config["AMP"].get("use_dynamic_loss_scaling", use_dynamic_loss_scaling = config["AMP"].get("use_dynamic_loss_scaling",
False) False)
......
...@@ -112,7 +112,7 @@ def main(): ...@@ -112,7 +112,7 @@ def main():
'FLAGS_cudnn_batchnorm_spatial_persistent': 1, 'FLAGS_cudnn_batchnorm_spatial_persistent': 1,
'FLAGS_max_inplace_grad_add': 8, 'FLAGS_max_inplace_grad_add': 8,
} }
paddle.fluid.set_flags(AMP_RELATED_FLAGS_SETTING) paddle.set_flags(AMP_RELATED_FLAGS_SETTING)
scale_loss = config["Global"].get("scale_loss", 1.0) scale_loss = config["Global"].get("scale_loss", 1.0)
use_dynamic_loss_scaling = config["Global"].get( use_dynamic_loss_scaling = config["Global"].get(
"use_dynamic_loss_scaling", False) "use_dynamic_loss_scaling", False)
......
...@@ -313,7 +313,7 @@ def get_infer_gpuid(): ...@@ -313,7 +313,7 @@ def get_infer_gpuid():
if sysstr == "Windows": if sysstr == "Windows":
return 0 return 0
if not paddle.fluid.core.is_compiled_with_rocm(): if not paddle.device.is_compiled_with_rocm:
cmd = "env | grep CUDA_VISIBLE_DEVICES" cmd = "env | grep CUDA_VISIBLE_DEVICES"
else: else:
cmd = "env | grep HIP_VISIBLE_DEVICES" cmd = "env | grep HIP_VISIBLE_DEVICES"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册