Skip to content

Commit

Permalink
update notes/docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sljlp committed Jan 6, 2022
1 parent 33989ba commit 6ab7dbb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/paddle/distributed/model/moe/grad_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class ClipGradForMOEByGlobalNorm(ClipGradBase):
.. code-block:: python
import paddle
from paddle.distributed import moe
x = paddle.uniform([10, 10], min=-1.0, max=1.0, dtype='float32')
linear = paddle.nn.Linear(in_features=10, out_features=10,
Expand All @@ -76,7 +77,7 @@ class ClipGradForMOEByGlobalNorm(ClipGradBase):
loss.backward()
is_expert_func = lambda param: "expert_" in param.name
clip = paddle.nn.ClipGradForMOEByGlobalNorm(clip_norm=1.0,is_expert_func, None)
clip = moe.grad_clip.ClipGradForMOEByGlobalNorm(clip_norm=1.0,is_expert_func, None)
sdg = paddle.optimizer.SGD(learning_rate=0.1, parameters=linear.parameters(), grad_clip=clip)
sdg.step()
"""
Expand Down

1 comment on commit 6ab7dbb

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on 6ab7dbb Jan 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️ CI failures summary

🔍 PR: #34 Commit ID: 6ab7dbb contains failed CI.

🔹 Failed: PR-CI-APPROVAL

approve_failed
2022-01-06 17:20:18 正在解析主机 sys-p0.bj.bcebos.com... 182.61.200.195, 182.61.200.229, 2409:8c04:1001:1002:0:ff:b001:368a
2022-01-06 17:20:18 正在连接 sys-p0.bj.bcebos.com|182.61.200.195|:443... 已连接。
2022-01-06 17:20:18 警告: 证书通用名 “*.bcebos.com” 与所要求的主机名 “sys-p0.bj.bcebos.com” 不符。
2022-01-06 17:20:18 已发出 HTTP 请求,正在等待回应... 200 OK
2022-01-06 17:20:18 长度:5 [application/octet-stream]
2022-01-06 17:20:18 正在保存至: “bk.txt”
2022-01-06 17:20:18 0K 100% 5.29M=0s
2022-01-06 17:20:18 2022-01-06 17:20:14 (5.29 MB/s) - 已保存 “bk.txt” [5/5])
2022-01-06 17:20:22 ****************
2022-01-06 17:20:22 0. You must have Dianhai approval for change 20+ files or add than 1000+ lines of content.
2022-01-06 17:20:22 There are 1 approved errors.
2022-01-06 17:20:22 ****************
2022-01-06 17:20:22 + EXCODE=6
2022-01-06 17:20:22 + echo 'EXCODE: 6'
2022-01-06 17:20:22 EXCODE: 6
2022-01-06 17:20:22 + echo 'ipipe_log_param_EXCODE: 6'
2022-01-06 17:20:22 ipipe_log_param_EXCODE: 6
2022-01-06 17:20:22 + exit 6

Please sign in to comment.