Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

question again on gradient_clipping_threshold

Open yu239-zz opened this issue 9 years ago • 5 comments

In an old Issue #775 , there seemed to be some discussions on how the gradient clipping is triggered. Currently, on a single machine Paddle always uses SgdLocalUpdater. However, gradient clipping is only used in SgdThreadUpdater. Is there any plan to fix this issue? Or can we always use SgdThreadUpdater?

yu239-zz avatar Aug 27 '17 01:08 yu239-zz

I have the same problem. but it hasn't been solved yet ...

lcy-seso avatar Aug 27 '17 02:08 lcy-seso

Previously, I just changed SgdLocalUpdater into SgdThreadUpdater and it worked, but I am not sure whether there may be certain problems.

lcy-seso avatar Aug 27 '17 03:08 lcy-seso

@yu239 The v2 API always use SgdThreadUpdater and the gradient_clipping works well now. If you use binary paddle_trainer to run job, the gradient_clipping doesn't work indeed.

qingqing01 avatar Aug 27 '17 03:08 qingqing01

@qingqing01 I use the class paddle::Trainer in the C++ code. It seems that SgdLocalUpdater is always used. So I can just change the Paddle source code (TrainerInternal.cpp) to use SgdThreadUpdater? Is there any potential issue by doing so?

yu239-zz avatar Aug 31 '17 20:08 yu239-zz

@qingqing01 I can hack the source code so that SgdThreadUpdater is used in place of SgdLocalUpdater. But this does not seem like a final solution. If I use paddle::Trainer, is there any official way that I can specify SgdThreadUpdater without modifying the Paddle source code?

yu239-zz avatar Aug 31 '17 20:08 yu239-zz