File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
python/paddle/distributed/fleet/meta_optimizers/dygraph_optimizer Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -225,12 +225,8 @@ def _comm_and_clip(
225225 )
226226 clip_var_fp16 = paddle .cast (clip_var , paddle .float16 )
227227
228- # bf16 is not supported on XPU now
229- if not (
230- paddle .is_compiled_with_xpu ()
231- or isinstance (
232- paddle .framework ._current_expected_place (), paddle .CustomPlace
233- )
228+ if not isinstance (
229+ paddle .framework ._current_expected_place (), paddle .CustomPlace
234230 ):
235231 clip_var_bf16 = paddle .cast (clip_var , paddle .bfloat16 )
236232 for p , g in params_grads :
@@ -241,10 +237,6 @@ def _comm_and_clip(
241237 if g .dtype == paddle .float16 :
242238 g .multiply_ (clip_var_fp16 )
243239 elif g .dtype == paddle .bfloat16 :
244- if paddle .is_compiled_with_xpu ():
245- raise NotImplementedError (
246- "BF16 is not supported on XPU now"
247- )
248240 g .multiply_ (clip_var_bf16 )
249241 else :
250242 g .multiply_ (clip_var )
You can’t perform that action at this time.
0 commit comments