ValueError: torch.utils.checkpoint: please pass in use_reentrant=True or use_reentrant=False explicitly.

#11
by yangzhengyu - opened

I encountered this error while fine-tuning the Baichuan2-7B model with LoRA. Perhaps in newer versions of PyTorch, the use_reentrant parameter needs to be explicitly specified.

I temporarily resolved the issue by explicitly specifying the use_reentrant parameter as False in the layer_outputs = torch.utils.checkpoint.checkpoint(...) at line 453 in the modeling_baichuan.py file, but I'm not yet clear about what impact this might have.

Sign up or log in to comment