You are running out of GPU memory while training a large foundation model. What sequence of steps do you take to diagnose and resolve this?