gritlm icon indicating copy to clipboard operation
gritlm copied to clipboard

projection layer

Open CementMaker opened this issue 1 year ago • 2 comments
trafficstars

if i use projection layer for ddp it will cause: RuntimeError: Expected to mark a variable ready only once. This error is caused by one of the following reasons: 1) Use of a module parameter outside the forward function. Please make sure model parameters are not shared across multiple concurrent forward-backward passes. or try to use _set_static_graph() as a workaround if this module graph does not change during training loop.2) Reused parameters in multiple reentrant backward passes. For example, if you use multiple checkpoint functions to wrap the same part of your model, it would result in the same set of parameters been used by different reentrant backward passes multiple times, and hence marking a variable ready multiple times. DDP does not support such use cases in default. You can try to use _set_static_graph() as a workaround if your module graph does not change over iterations.

CementMaker avatar May 24 '24 10:05 CementMaker

You can probably fix this by deactivating activation/gradient checkpointing

Muennighoff avatar May 24 '24 18:05 Muennighoff

if i use projection layer for ddp it will cause: RuntimeError: Expected to mark a variable ready only once. This error is caused by one of the following reasons: 1) Use of a module parameter outside the forward function. Please make sure model parameters are not shared across multiple concurrent forward-backward passes. or try to use _set_static_graph() as a workaround if this module graph does not change during training loop.2) Reused parameters in multiple reentrant backward passes. For example, if you use multiple checkpoint functions to wrap the same part of your model, it would result in the same set of parameters been used by different reentrant backward passes multiple times, and hence marking a variable ready multiple times. DDP does not support such use cases in default. You can try to use _set_static_graph() as a workaround if your module graph does not change over iterations.

您好,我想微调一下现有的模型,但是原始模型的hidden state维度太大了,我想用projection来降维,但是训练了之后并没有保存projection的权重参数,请问您这边儿有碰到这个情况吗

threestone965 avatar Sep 10 '24 07:09 threestone965