Skip to content

Commit a2c8c9a

Browse files
authored
Distributed SaveLoad implementation for semi-auto strategy (#59659)
* 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
1 parent 0e96df8 commit a2c8c9a

16 files changed

+1162
-0
lines changed

python/paddle/distributed/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@
103103

104104
from . import rpc # noqa: F401
105105

106+
from .checkpoint.save_state_dict import save_state_dict
107+
from .checkpoint.load_state_dict import load_state_dict
108+
106109
__all__ = [
107110
"io",
108111
"spawn",
@@ -157,5 +160,7 @@
157160
"Shard",
158161
"Replicate",
159162
"Partial",
163+
"save_state_dict",
164+
"load_state_dict",
160165
"shard_optimizer",
161166
]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from .save_state_dict import save_state_dict
16+
from .load_state_dict import load_state_dict
17+
18+
__all__ = [
19+
"save_state_dict",
20+
"load_state_dict",
21+
]

0 commit comments

Comments
 (0)