Skip to content

Commit c79b019

Browse files
authored
expose api (#42300)
ref clipgradbynorm update Update __init__.py cherry-pick from develop PR #42254
1 parent bbdbf3d commit c79b019

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

python/paddle/incubate/distributed/models/moe/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
15+
from .gate import GShardGate, BaseGate, SwitchGate, NaiveGate
16+
from .moe_layer import MoELayer
17+
from .grad_clip import ClipGradForMOEByGlobalNorm
18+
ClipGradByGlobalNorm = ClipGradForMOEByGlobalNorm

python/setup.py.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ packages=['paddle',
312312
'paddle.distributed.auto_parallel.tuner',
313313
'paddle.distributed.auto_parallel.cost',
314314
'paddle.distributed.passes',
315+
'paddle.distributed.models',
316+
'paddle.distributed.models.moe',
315317
'paddle.framework',
316318
'paddle.jit',
317319
'paddle.jit.dy2static',
@@ -366,6 +368,10 @@ packages=['paddle',
366368
'paddle.incubate.nn.functional',
367369
'paddle.incubate.nn.layer',
368370
'paddle.incubate.optimizer.functional',
371+
'paddle.incubate.distributed',
372+
'paddle.incubate.distributed.models',
373+
'paddle.incubate.distributed.models.moe',
374+
'paddle.incubate.distributed.models.moe.gate',
369375
'paddle.io',
370376
'paddle.optimizer',
371377
'paddle.nn',

0 commit comments

Comments
 (0)