Accelerating LLM Training with Memory-Balanced Pipeline Parallelism