Given a poorly performing PyTorch training script, walk me through the steps you would take to profile and optimize it.