Achieving Near-Linear Training Scalability for Pinterest’s Foundation Models · The Formula