From 5e5ae0a004d64e21ae61c75456bc8da81ac392f3 Mon Sep 17 00:00:00 2001 From: Baibaifan <39549453+Baibaifan@users.noreply.github.com> Date: Sat, 16 Apr 2022 13:50:29 +0800 Subject: [PATCH] fix_sharding_copy_right (#41849) --- .../dygraph_optimizer/sharding_optimizer_stage2.py | 13 ++++++++++--- .../sharding/group_sharded_optimizer_stage2.py | 13 ++++++++++--- .../meta_parallel/sharding/group_sharded_stage2.py | 13 ++++++++++--- .../meta_parallel/sharding/group_sharded_storage.py | 13 ++++++++++--- .../fleet/meta_parallel/sharding/sharding_stage2.py | 13 ++++++++++--- .../distributed/fleet/utils/internal_storage.py | 13 ++++++++++--- 6 files changed, 60 insertions(+), 18 deletions(-) diff --git a/python/paddle/distributed/fleet/meta_optimizers/dygraph_optimizer/sharding_optimizer_stage2.py b/python/paddle/distributed/fleet/meta_optimizers/dygraph_optimizer/sharding_optimizer_stage2.py index a2c741667ed..fb43b89e1a6 100644 --- a/python/paddle/distributed/fleet/meta_optimizers/dygraph_optimizer/sharding_optimizer_stage2.py +++ b/python/paddle/distributed/fleet/meta_optimizers/dygraph_optimizer/sharding_optimizer_stage2.py @@ -11,9 +11,16 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -#Taken and modified for fairscale from: -# https://github.com/facebookresearch/fairscale/blob/main/fairscale/optim/oss.py -#Commit: 8acbec718f3c70a6b9785470bb9e05cd84fc3f8e + +# The file has been adapted from fairscale file: +# https://github.com/facebookresearch/fairscale/blob/main/fairscale/optim/oss.py +# Git commit hash: 8acbec718f3c70a6b9785470bb9e05cd84fc3f8e +# We retain the following license from the original files: + +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +# +# This source code is licensed under the BSD license found in the +# LICENSE file in the root directory of this source tree. import copy import logging diff --git a/python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_optimizer_stage2.py b/python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_optimizer_stage2.py index 9df68dc419e..70d2d2a1930 100644 --- a/python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_optimizer_stage2.py +++ b/python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_optimizer_stage2.py @@ -11,9 +11,16 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -#Taken and modified for fairscale from: -# https://github.com/facebookresearch/fairscale/blob/main/fairscale/optim/oss.py -#Commit: 8acbec718f3c70a6b9785470bb9e05cd84fc3f8e + +# The file has been adapted from fairscale file: +# https://github.com/facebookresearch/fairscale/blob/main/fairscale/optim/oss.py +# Git commit hash: 8acbec718f3c70a6b9785470bb9e05cd84fc3f8e +# We retain the following license from the original files: + +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +# +# This source code is licensed under the BSD license found in the +# LICENSE file in the root directory of this source tree. import copy import logging diff --git a/python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_stage2.py b/python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_stage2.py index 5f39ea0fd90..0c045c45fd5 100644 --- a/python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_stage2.py +++ b/python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_stage2.py @@ -11,9 +11,16 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -#Taken and modified for fairscale from: -# https://github.com/facebookresearch/fairscale/blob/main/fairscale/nn/data_parallel/sharded_ddp.py -#Commit: 8acbec718f3c70a6b9785470bb9e05cd84fc3f8e + +# The file has been adapted from fairscale file: +# https://github.com/facebookresearch/fairscale/blob/main/fairscale/nn/data_parallel/sharded_ddp.py +# Git commit hash: 8acbec718f3c70a6b9785470bb9e05cd84fc3f8e +# We retain the following license from the original files: + +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +# +# This source code is licensed under the BSD license found in the +# LICENSE file in the root directory of this source tree. import logging import time diff --git a/python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_storage.py b/python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_storage.py index 7a57fb29b94..4d706870a91 100644 --- a/python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_storage.py +++ b/python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_storage.py @@ -11,9 +11,16 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -#Taken and modified for fairscale from: -# https://github.com/facebookresearch/fairscale/blob/main/fairscale/nn/misc/param_bucket.py -#Commit: 8acbec718f3c70a6b9785470bb9e05cd84fc3f8e + +# The file has been adapted from fairscale file: +# https://github.com/facebookresearch/fairscale/blob/main/fairscale/nn/misc/param_bucket.py +# Git commit hash: 8acbec718f3c70a6b9785470bb9e05cd84fc3f8e +# We retain the following license from the original files: + +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +# +# This source code is licensed under the BSD license found in the +# LICENSE file in the root directory of this source tree. import os import time diff --git a/python/paddle/distributed/fleet/meta_parallel/sharding/sharding_stage2.py b/python/paddle/distributed/fleet/meta_parallel/sharding/sharding_stage2.py index c6f05023e61..b09d256d9bb 100644 --- a/python/paddle/distributed/fleet/meta_parallel/sharding/sharding_stage2.py +++ b/python/paddle/distributed/fleet/meta_parallel/sharding/sharding_stage2.py @@ -11,9 +11,16 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -#Taken and modified for fairscale from: -# https://github.com/facebookresearch/fairscale/blob/main/fairscale/nn/data_parallel/sharded_ddp.py -#Commit: 8acbec718f3c70a6b9785470bb9e05cd84fc3f8e + +# The file has been adapted from fairscale file: +# https://github.com/facebookresearch/fairscale/blob/main/fairscale/nn/data_parallel/sharded_ddp.py +# Git commit hash: 8acbec718f3c70a6b9785470bb9e05cd84fc3f8e +# We retain the following license from the original files: + +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +# +# This source code is licensed under the BSD license found in the +# LICENSE file in the root directory of this source tree. import os import contextlib diff --git a/python/paddle/distributed/fleet/utils/internal_storage.py b/python/paddle/distributed/fleet/utils/internal_storage.py index 469da223667..80d8d8562d4 100644 --- a/python/paddle/distributed/fleet/utils/internal_storage.py +++ b/python/paddle/distributed/fleet/utils/internal_storage.py @@ -11,9 +11,16 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -#Taken and modified for fairscale from: -# https://github.com/facebookresearch/fairscale/blob/main/fairscale/nn/misc/param_bucket.py -#Commit: 8acbec718f3c70a6b9785470bb9e05cd84fc3f8e + +# The file has been adapted from fairscale file: +# https://github.com/facebookresearch/fairscale/blob/main/fairscale/nn/misc/param_bucket.py +# Git commit hash: 8acbec718f3c70a6b9785470bb9e05cd84fc3f8e +# We retain the following license from the original files: + +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +# +# This source code is licensed under the BSD license found in the +# LICENSE file in the root directory of this source tree. import os import time -- GitLab