Galvatron: An Automatic Distributed System for Efficient Foundation Model Training