"src/libtorio/ffmpeg/hw_context.cpp" did not exist on "ca66a1d3a0a000031ee0927c17c5b223dc119077"
Commit 4ff2c963 authored by Mohammad's avatar Mohammad
Browse files

fixed a bug in l2 grad clip

parent fb5b2b36
......@@ -39,6 +39,7 @@ def l2_grad_clipper(parameters, max_norm):
parameters_with_grads = list(filter(
lambda p: p.grad is not None, parameters))
# Filter parameters for norm calculations.
mp_rank_is_zero = (get_model_parallel_rank() == 0)
parameters_for_norm = list(filter(
lambda p: p.model_parallel or mp_rank_is_zero, parameters_with_grads))
# Calculate L2 norm.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment