training-nv-pytorch 25.02

Updated at:

Release notes for training-nv-pytorch 25.02. Review the version changes, image contents, NVIDIA driver requirements, key optimizations, and known issues before you run this image on ACS or Lingjun.

Main features and bug fixes

Main features

  • The base image is aligned with NVIDIA GPU Cloud (NGC) 25.01, CUDA is upgraded to 12.8.0, and cuDNN is upgraded to 9.7.0.66.

  • ACCL-N is upgraded to 2.23.4.11and supports ACCL-Barex.

  • Transformers is upgraded to 4.48.3+ali, vLLM is upgraded to 0.7.2, and Ray is upgraded to 2.42.1. This release contains the features and bug fixes from these upstream versions.

Bug fixes

None for this release.

Image contents

Use cases

Training / inference

Framework

PyTorch

Requirements

NVIDIA driver version 570 or later

Key components

  • Ubuntu 24.04

  • Python 3.12.7+gc

  • Torch 2.5.1.6.post2

  • CUDA 12.8.0

  • ACCL-N 2.23.4.11

  • triton 3.1.0

  • TransformerEngine 1.13.0

  • deepspeed 0.15.4+ali

  • flash-attn 2.5.8

  • flashattn-hopper 3.0.0b1

  • transformers 4.48.3+ali

  • megatron-core 0.9.0

  • grouped_gemm 1.1.4

  • accelerate 1.1.0

  • diffusers 0.31.0

  • openmim 0.3.9

  • mmengine 0.10.3

  • mmcv 2.1.0

  • mmdet 3.3.0

  • opencv-python-headless 4.10.0.84

  • ultralytics 8.2.74

  • timm 1.0.13

  • vllm 0.7.2

  • pytorch-dynamic-profiler 0.24.11

  • perf 5.4.30

  • gdb 15.0.50

  • peft 0.13.2

  • ray 2.42.1

Image assets

Public image

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

VPC image

acs-registry-vpc.{region-id}.cr.aliyuncs.com/egslingjun/{image:tag}
Replace {region-id} with the region where your Alibaba Cloud Container Compute Service (ACS) is activated (for example, cn-beijing or cn-wulanchabu).
Replace {image:tag} with the name and tag of the image.
Note

The inference-nv-pytorch:25.03-vllm0.8.2-pytorch2.6-cu124-20250328-serverless and inference-nv-pytorch:25.03-sglang0.4.4.post1-pytorch2.5-cu124-20250327-serverless images are compatible with ACS and Lingjun multi-tenant deployments only. It is not compatible with Lingjun single-tenant deployments.

Note
  • egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun/training-nv-pytorch:25.02-serverlessis suitable for ACS and Lingjun multi-tenant products. It is not compatible with Lingjun single-tenant products.

  • egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun/training-nv-pytorch:25.02 is suitable for Lingjun single-tenant scenarios.

Driver requirements

  • The 25.02 release is aligned with the NGC PyTorch 25.01 image, so the driver for Golden-gpu follows the requirements of that NGC image version. This release is based on CUDA 12.8.0 and requires NVIDIA driver version 570 or later. However, on a data center GPU such as a T4, the following NVIDIA driver releases or later are supported: 470.57 (R470), 525.85 (R525), 535.86 (R535), and 545.23 (R545).

  • The CUDA driver compatibility package supports only specific drivers. Therefore, upgrade from all R418, R440, R450, R460, R510, R520, R530, R545, and R555 drivers. These drivers are not forward-compatible with CUDA 12.8. For a complete list of supported drivers, see CUDA Application Compatibility. For more information, see CUDA Compatibility and Upgrades.

Key features and enhancements

PyTorch compilation optimization

The compilation optimization introduced in PyTorch 2.0 often delivers significant gains for small-scale, single-GPU workloads. However, large language model (LLM) training requires GPU memory optimization. It also requires distributed frameworks such as Fully Sharded Data Parallel (FSDP) or DeepSpeed, so torch.compile() may deliver limited gains or even degrade performance:

  • Controls communication granularity in the DeepSpeed framework so that the compiler captures a more complete compute graph and applies broader compilation optimization.

  • Includes an optimized PyTorch build:

    • Optimizes the PyTorch compiler frontend so that compilation still succeeds when any graph break occurs in the compute graph.

    • Strengthens pattern matching and dynamic shape support to improve the performance of the compiled code.

With these optimizations, 8B-parameter LLM training typically achieves an end-to-end throughput gain of about 20%.

GPU memory optimization for recomputation

A predictive model for GPU memory overhead was built. The model draws on large-scale benchmarking data: different models on different clusters with different training parameter settings, as well as system metrics such as GPU memory utilization collected during the benchmarks. It recommends the optimal number of activation recomputation layers. This capability is integrated into PyTorch, so you can benefit from GPU memory optimization with minimal effort. It is now supported in the DeepSpeed framework.

ACCL communication library

ACCL is a high-performance network communication library that Alibaba Cloud developed in-house for Lingjun. ACCL-N is the version for GPU workloads, customized from NVIDIA NCCL. It is fully compatible with NCCL, fixes some bugs in the official NCCL release, and includes performance and stability optimizations.

End-to-end performance assessment

CNP, a cloud-native AI performance benchmarking and analysis tool, was used to run a full end-to-end performance comparison against a standard base image. The comparison used mainstream open-source models and framework configurations. Ablation studies were run to measure how much each optimization component contributes to overall model training performance.

End-to-end performance contribution analysis of GPU key components

The following tests are based on 25.02 and run end-to-end performance benchmarks and comparisons on a multi-node GPU cluster. The comparison items include:

  1. Base: The NGC PyTorch image.

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

  3. ACS AI Image: AC2+ACCL: The Golden image uses AC2 BaseOS, with no optimization enabled.

  4. ACS AI Image: AC2+ACCL+CompilerOpt: The Golden image uses AC2 BaseOS, with only torch.compile() optimization enabled.

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

image.png

Quick start

The following examples use only Docker to pull the training-nv-pytorch image.

Note

To use the training-nv-pytorch image in ACS, select it in the Artifact Center on the Create Workload page in the console, or specify the image reference in a YAML file.

1. Pull the image

docker pull egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun/training-nv-pytorch:[tag]

2. Call the API to enable compilation optimization and GPU memory optimization for recomputation

  • Enable compilation optimization

    Use the Transformers Trainer API:

    training_args = TrainingArguments(
        bf16=True,
        gradient_checkpointing=True,
        torch_compile=True
    )
  • Enable GPU memory optimization for recomputation

    export CHECKPOINT_OPTIMIZATION=true

3. Start the container

The image includes the model training tool ljperf. The following steps show how to start a container and run a training task.

LLM

# Start and enter the container
docker run --rm -it --ipc=host --net=host  --privileged egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun/training-nv-pytorch:[tag]
# Run the training demo
ljperf benchmark --model deepspeed/llama3-8b 

4. Usage notes

  • Do not reinstall libraries such as PyTorch and DeepSpeed. The image includes changes to these libraries, which will be contributed upstream later.

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

Known issues