Skip to content

Commit

Permalink
Distributed SaveLoad implementation for semi-auto strategy (#59659)
Browse files Browse the repository at this point in the history
* exclude xpu

* demo of running dygraph distributed save load

* support save cross mesh state_dict

* polish

* fix compute overlap bug

* test save load in dp_mp unittest

* fix get local file bug and test

* delete useless files, and rename var

* polish

* format codes

* test use_dist

* fix test

* info to debug

* fix test

* fix

* fix coverage ci

* fix docstring codes

* rename and codestyle

* get rid of use_dist argument

* fix copyright

* polish doc

* polish

* polish

* use tmp file path
  • Loading branch information
pangengzheng authored Dec 7, 2023
1 parent 0e96df8 commit a2c8c9a
Show file tree
Hide file tree
Showing 16 changed files with 1,162 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/paddle/distributed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@

from . import rpc # noqa: F401

from .checkpoint.save_state_dict import save_state_dict
from .checkpoint.load_state_dict import load_state_dict

__all__ = [
"io",
"spawn",
Expand Down Expand Up @@ -157,5 +160,7 @@
"Shard",
"Replicate",
"Partial",
"save_state_dict",
"load_state_dict",
"shard_optimizer",
]
21 changes: 21 additions & 0 deletions python/paddle/distributed/checkpoint/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.

from .save_state_dict import save_state_dict
from .load_state_dict import load_state_dict

__all__ = [
"save_state_dict",
"load_state_dict",
]
Loading

0 comments on commit a2c8c9a

Please sign in to comment.