training-xpu-pytorch 25.02, training-xpu-pytorch 25.02

Updated at:
Copy as MD

This document provides the release notes for training-xpu-pytorch 25.02.

What's new

New features

  • Upgraded the PPU SDK in the base image to 1.4.2.

  • The network component is updated to the latest EIC version, adding support for rcopy file distribution and ACCL-Barex.

  • Upgraded vLLM to 0.7.2, Ray to 2.42.1, Transformers to 4.48.3+ali.vlm, and TransformerEngine to 1.13. This update includes new features and bug fixes from these versions.

Bug fixes

  • Upgraded PyTorch to 2.5.1.6.post3+ppu to resolve an issue where the torch profiler was missing CUDA kernel launch information.

Contents

Application scenario

training/inference

Framework

PyTorch

Requirements

PPU SDK 1.4.2

Core components

  • Ubuntu 22.04

  • Python 3.10.13+gc

  • PyTorch 2.5.1.6.post3+ppu

  • CUDA 12.6

  • ACCL-P 1.4.0-7

  • triton 3.1.0+ppu

  • TransformerEngine 1.13.0

  • DeepSpeed 0.15.4+ali

  • flash-attn 2.5.7+pputorch2.5

  • xformers 0.0.29.post1+ppu1.4.2.oe

  • Transformers 4.48.3+ali.vlm

  • megatron-core 0.9.0

  • grouped_gemm 1.1.4

  • accelerate 1.1.0

  • diffusers 0.31.0

  • openmim 0.3.9

  • bitsandbytes 0.43.1

  • mmengine 0.10.3

  • mmcv 2.1.0

  • MMsegmentation 1.2.2

  • mmdet3d 1.4.0

  • AutoGPTQ 0.8.0.dev0+cu126

  • opencv-python-headless 4.10.0.84

  • vLLM 0.7.2+ppu1.4.2.oe

  • pytorch-dynamic-profiler 0.24.11

  • perf 5.4.30

  • gdb 12.1

  • peft 0.13.2

  • ray 2.42.1

  • spacy 3.7.4

  • cumm 0.5.3

  • spconv 2.3.6

  • ffmpeg 7.0.1

  • open3d 0.18.0

Assets

25.02

Public image

  • egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun/training-xpu-pytorch:25.02

[Preview] Nightly-20250219

Note
  • Environment: Torch 2.0, CUDA 11.6, Python 3.8, and Ubuntu 20.04.

  • Supports ffmpeg 7.0.1, open3d 0.18.0, cumm-cu116 0.5.3, spconv-cu116 2.3.6, mmcv-full 1.7.1, and flash-attn 2.4.2.

Public image

  • egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun/training-xpu-pytorch:ppuv1.4.1-pytorch2.0-cuda11.6-ubuntu20.04-20250219

VPC images

  • acs-registry-vpc.{region-id}.cr.aliyuncs.com/egslingjun/{image:tag}

    {region-id} is the ID of the region where your Container Service for Kubernetes (ACK) cluster is located, such as cn-beijing or cn-wulanchabu.
    {image:tag} is the actual image name and tag.

Driver requirements

  • Golden-ppu: Driver version >= 1.1.0

Key features and enhancements

PyTorch compilation optimization

The compilation optimization feature introduced in PyTorch 2.0 typically provides significant performance gains for small-scale, single-card setups. However, when you train large language models (LLMs) that require memory optimization and distributed frameworks such as Fully Sharded Data Parallel (FSDP) or DeepSpeed, torch.compile() may not deliver benefits or can even degrade performance:

  • This optimization controls the granularity of communication within the DeepSpeed framework, which allows the compiler to obtain a more complete computation graph for broader compilation optimization.

  • This image includes an optimized version of PyTorch that:

    • Optimizes the PyTorch compiler front end to ensure successful compilation even when graph breaks occur in the computation graph.

    • Enhances pattern matching and dynamic shape capabilities to improve the performance of compiled code.

These optimizations deliver an end-to-end throughput improvement of approximately 20% for 8B LLM training workloads.

Memory optimization with activation checkpointing

We developed a predictive model for memory overhead by analyzing extensive performance benchmark data, including system metrics like memory utilization across various models, cluster configurations, and training parameters. This model recommends the optimal number of layers for activation checkpointing and is integrated into PyTorch for ease of use. This feature is now compatible with the DeepSpeed framework.

ACCL collective communication library

ACCL (Alibaba Cloud Collective Communication Library) is a high-performance network communication library developed by Alibaba Cloud for Lingjun. It is available in three versions for different hardware scenarios: ACCL-N for NVIDIA GPUs, ACCL-P for PPU, and ACCL-R for AMD GPUs. ACCL-N is a customized version of NVIDIA's NCCL that is fully compatible but includes bug fixes and optimizations for performance and stability. ACCL-P is a collective communication library based on T-Head's open-source pccl. ACCL-R is a collective communication library developed based on AMD ROCm's open-source rccl. This release ports key features from ACCL/ACCL-N to pccl, resolves several issues, and deeply integrates with other proprietary network components.

End-to-end performance evaluation

Using the Cloud-native AI Performance Profiling tool (CNP), we conducted a comprehensive end-to-end performance comparison between this image and the standard base image. We used mainstream open-source models and framework configurations. We also performed ablation studies to assess the contribution of each optimized component to the overall model training performance.

Image comparison: Base vs. iterative improvements

image.png

PPU component contribution to E2E performance

The following tests, based on version 25.02, were conducted on multi-node GPU/PPU clusters to evaluate and compare end-to-end performance. The comparison items include:

  1. Base: The standard PPU PyTorch image.

  2. ACS AI Image: Base+ACCL: The image uses the ACCL collective communication library.

  3. ACS AI Image: AC2+ACCL: The Golden image with AC2 BaseOS, without any optimizations enabled.

  4. ACS AI Image: AC2+ACCL+CompilerOpt: The Golden image with AC2 BaseOS and only the torch compile optimization enabled.

  5. ACS AI Image: AC2+ACCL+CompilerOpt+CkptOpt: The Golden image with AC2 BaseOS and both torch compile and selective gradient checkpointing optimizations enabled.

image.png

Quick start

The following examples show how to pull the training-xpu-pytorch image by using Docker.

Note

To use the training-xpu-pytorch image in ACS, select it from the Artifacts Center page when you create a workload in the console, or specify the image reference in a YAML file.

Step 1: Log in to the registry

docker login egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com

Step 2: Enable optimizations

  • Enable compilation optimization

    Use the Transformers Trainer API:

    image.png

  • Enable memory optimization with activation checkpointing

    export CHECKPOINT_OPTIMIZATION=true

Step 3: Start the container

The image includes a built-in model training tool, ljperf. The following steps describe how to start the container and run a training task by using this tool.

Note

For Alibaba Cloud services, use a YAML file to reference the image.

LLM workloads

# Start the container and go to the command line
docker run --rm -it --ipc=host --net=host  --privileged egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun/training-xpu-pytorch:[tag]

# Run a training demo
ljperf benchmark --model deepspeed/llama3-8b 

Step 4: Usage recommendations

  • The image contains modifications to libraries such as PyTorch and DeepSpeed that will be upstreamed. Do not reinstall these libraries.

  • In your DeepSpeed configuration, leave zero_optimization.stage3_prefetch_bucket_size empty or set it to auto.

Known issues

  • The PPU-compatible cuDNN version does not currently support the FMA feature. As a result, the PPU-compatible TransformerEngine cannot use FusedAttention (cuDNN). We recommend using FlashAttention: export NVTE_FLASH_ATTN=1 && export NVTE_FUSED_ATTN=0.

  • In the PPU operator library, using FP32 tensor cores for Gemm calculations may lead to incorrect results in some corner cases. This issue is scheduled to be fixed in the next release.

  • The PPU cross-node CUDA graph feature has known issues in the current version. A fix is scheduled for the next release.