How Should I Do Least Squares?

I’ve already categorised some ways to do least squares in PyTorch in this gist. Which of these is preferred, or is there some other way that is better? Not necessarily in terms of speed; ie is any way preferred for numerical stability?